floccusaddon / floccusaddon/floccus

Sync with git not working when there is a `.gitignore` file

Open
#1,658 1 comment 1 reaction 0 assignees View on GitHub
bug priority: low
Dominant language
JavaScript
Stars
8.5k
Forks
327
Avg merge
3d 14h
Merged PRs (30d)
2

Description

### Which version of floccus are you using?

v5.2.3

### How many bookmarks do you have, roughly?

almost 320

### Are you using other means to sync bookmarks in parallel to floccus?

No

### Sync method

Git

### Which browser are you using?

Chromium

---

### Describe the Bug

Syncing with `git`.

I have a `.gitignore` file with the following content:
```
/*
!0/
0/*
!0/Config/
```
In summary: if ignores everything except the folder `0/Config/`

My bookmarks file is `0/Config/bookmarks.xbel`

With this setting, I'm getting **empty commits** produced by Floccus.

By removing the `.gitignore` file, it works ok again.

### Expected Behavior

I expected that the commits were not empty when syncing bookmarks with git

---

### To Reproduce

1. Create a git repository (let's say, in github or gitlab) and clone it.
2. Create a folder `0/` in it and a subfolder folder `0/Config` with an empty file `0/Config/.gitkeep` and also add a `.gitignore` file to the root directory with the content:
```
/*
!0/
0/*
!0/Config/
```
3. Add all, commit and push. (don't forget to use `git add -f` when adding the `.gitignore` file). The file tree will be like this:
```
│-- .gitignore

└───0
└───Config
-- .gitkeep
```

5. Add this repository to Floccus settings with git sync method with the path to bookmarks file: `0/Config/bookmarks.xbel`.

6. Add an bookmark, let's say, to `youtube.com` and see that commits produced by floccus are empty.

7. Delete the `.gitignore` file, commit and push. Now, add another bookmark and sync with Floccus. The commits are not empty anymore.

---

I created a [public repository here](https://github.com/Diogo-Rossi/test) reproducing the issue. The 3rd commit is empty. Fell free to ask any doubts.

Thankyou for this software!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.