syncthing icon indicating copy to clipboard operation
syncthing copied to clipboard

Consolidate syncthing files into .stfolder

Open BeatLink opened this issue 2 years ago • 2 comments

Currently, Syncthing needs an .stignore file to store files to be ignored as well as an .stversions folder to store previous versions. This is in addition to the fact that Syncthing requires a .stfolder inside every folder to be functional. Could all these files be consolidated into one folder? This would reduce clutter in each folder and make things a bit easier to understand for users. It would also bring syncthing in line with how other folder based tools such as git function (all related data under a .git folder in each repo)

My proposal would be the following:

  • Rename .stfolder to .syncthing
  • Move .stignore to .syncthing/ignore
  • Move .stversions to .syncthing/versions

The resultant folder structure would look like this

  • Documents
    • .syncthing
      • versions
      • ignore
      • any other files and folders Syncthing has or wishes to introduce in the future

BeatLink avatar Sep 07 '23 00:09 BeatLink

The heavy lifting with implementing this would be updating any hardcoded references and documentation to match the new format. The good news is, as the .stfolder is mandatory for syncthing to acknowledge the folder, the application can expect that its .syncthing equivalent will always be present when checking for the subfolders and files.

BeatLink avatar Sep 07 '23 00:09 BeatLink

There are already a few opened issues about a part of this:

  • https://github.com/syncthing/syncthing/issues/6844 (about renaming .stfolder to .syncthing)
  • https://github.com/syncthing/syncthing/issues/6001 (moving ignores to .stfolder)

There doesn't seem to be any opened issues about moving .stversions though.

The heavy lifting with implementing this would be updating any hardcoded references and documentation to match the new format.

This is the easy part. One of the main problems is that .stfolder isn't actually (fully) hardcoded. Right now, you are free to use custom folder markers which can also be files, not folders. And, in that case, you can't put any folders inside them. The new code would need to take this into account.

In addition, moving existing ignores is very problematic due to #include and other complex relative paths that people use in their ignore patterns. Moving versions should be easy though.

Also, there have been multiple discussions on this matter on the forum as well, but so far no-one has managed to implement such a large change.

tomasz1986 avatar Sep 07 '23 01:09 tomasz1986