floccusaddon / floccus

:cloud: Sync your bookmarks privately across browsers and devices
https://floccus.org
Mozilla Public License 2.0
5.33k stars 234 forks source link

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

Open Diogo-Rossi opened 2 weeks ago

Diogo-Rossi commented 2 weeks ago

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
  4. Add this repository to Floccus settings with git sync method with the path to bookmarks file: 0/Config/bookmarks.xbel.

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

  6. 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 reproducing the issue. The 3rd commit is empty. Fell free to ask any doubts.

Thankyou for this software!

github-actions[bot] commented 2 weeks ago

Hello :wave:

Thank you for taking the time to open this issue with floccus. I know it's frustrating when software causes problems. You have made the right choice to come here and open an issue to make sure your problem gets looked at and if possible solved. I'm Marcel and I created floccus and have been maintaining it ever since. I currently work for Nextcloud which leaves me with less time for side projects like this one than I used to have. I still try to answer all issues and if possible fix all bugs here, but it sometimes takes a while until I get to it. Until then, please be patient. Note also that GitHub is a place where people meet to make software better together. Nobody here is under any obligation to help you, solve your problems or deliver on any expectations or demands you may have, but if enough people come together we can collaborate to make this software better. For everyone. Thus, if you can, you could also have a look at other issues to see whether you can help other people with your knowledge and experience. If you have coding experience it would also be awesome if you could step up to dive into the code and try to fix the odd bug yourself. Everyone will be thankful for extra helping hands! One last word: If you feel, at any point, like you need to vent, this is not the place for it; you can go to the forum, to twitter or somewhere else. But this is a technical issue tracker, so please make sure to focus on the tech and keep your opinions to yourself.

I look forward to working with you on this issue Cheers :blue_heart: