hbons / SparkleShare

Share and collaborate by syncing with any Git repository instantly. Linux, macOS, and Windows.
https://sparkleshare.org
Other
4.88k stars 579 forks source link

Creating a file with characters in its filename that are not valid in Windows makes the file be removed when synced #1418

Closed knocte closed 10 years ago

knocte commented 10 years ago

Steps to reproduce:

  1. Create a file in a SparkleShare folder, in Linux, which contains an invalid characters for Windows filenames: i.e. "|".
  2. Let it sync.
  3. Start your windows OS (which has SparkleShare configured pointing to the same repo as the Linux instance).

Current results: Windows shows "there was a conflict", and file is removed from the git repository.

Expected results: SparkleShare should show a visual UI warning in the Linux OS as soon as the file is created, but it should sync it. When windows OS tries to pull it, it should not pull the file but show a warning as well. But most importantly: it should not delete the file.

Pandu53 commented 10 years ago

I think its a good idea.

hbons commented 10 years ago

the latest version completely ignores files that have characters that may be problematic on Windows, so those files aren't even synced anymore. it's a bit lame, but i don't know of a better solution.

knocte commented 10 years ago

Well, that's better than before. If we could have a conflict or warning highlighted by the SparkleShare UI, then I think we can close this.

hbons commented 10 years ago

we can list the ignored files with git ls-files --others -i --exclude-from=.git/info/exclude. a notification would be good, but how do we find out which files are relevant? we don't want to list them every time a local change happens.

knocte commented 10 years ago

how do we find out which files are relevant? we don't want to list them every time a local change happens

If that change is in a relevant file, yes?

hbons commented 10 years ago

i've created a wiki page on this: https://github.com/hbons/SparkleShare/wiki/File-names-and-types

knocte commented 10 years ago

Cool.

BTW, regarding this:

files or folders with the following characters in their name won't be synced to avoid problems

Did you add at least a warning log when this happens?

Nukama commented 9 years ago

From the File-names-and-types wikipage: SparkleShare also doesn't sync many common temporary or swap files. It won't sync hidden version control system directories either.

The temporary files (~$ ) while opening files on Windows are synced though. Can they be also excluded?

hbons commented 9 years ago

@Nukama what's the pattern that needs to be excluded exactly? is there some documentation available on this?

Nukama commented 9 years ago

The first two characters of a filename are replaced by: ~$

And I have not found documentation. I think it comes from opening OpenOffice files. Maybe MS Office? LibreOffice is only creating the lock file (.~lock.example.odt#) which is currently excluded in SparkleShare.

git log

commit Author: user mail@example.com Date: Wed Sep 24 00:02:50 2014 +0000

- <E2><80><98>example/~$ample.odt<E2><80>

commit Author: user mail@example.com Date: Wed Sep 24 00:02:18 2014 +0000

+ <E2><80><98>example/~$ample.odt<E2><80>
Silvenga commented 9 years ago

@Nukama

Here's the Knowledgebase article on that (I'm impressed by MS's documentation here): http://support2.microsoft.com/kb/211632

Owner File (Same Directory as Source File) This file name extension begins with a tilde (~) that is followed by a dollar sign ($) that is followed by the remainder of the original file name. This temporary file holds the logon name of person who opens the file. This temporary file is called the "owner file."

It's basically a lock file that provides some meta information.