SparkleShare icon indicating copy to clipboard operation
SparkleShare copied to clipboard

List ignored files somewhere and the reason why

Open Ppjet6 opened this issue 7 years ago • 5 comments

I got a report from a user asking why their folder wasn't up-to-date. When I had a look, launched it manually, SparkleShare was chocking on the error below, trying to do the same over and over.

Version: 1.5.0-2

What happens

09:22:45 | Cmd | repo | git commit --all --message="/ ‘Foo1’
- ‘Foo2'
[..]
- ‘Foo3’
+ ‘Foo4" -> "Foo5’
[..]
" --author="Author <author@domain>"
error: unknown switch `>'
usage: git commit [<options>] [--] <pathspec>...

    -q, --quiet           suppress summary after successful commit
    -v, --verbose         show diff in commit message template
[..]

Note the double quotes on the line 'Foo4" -> "Foo5', that make the git cli choke.

Ppjet6 avatar Dec 05 '17 14:12 Ppjet6

Foo4" -> "Foo5 is that the full file name?

hbons avatar Dec 16 '17 20:12 hbons

So in 2.0, these lines are in SparkleShares exclude file: *<* *>* *:* *"*

This is because these characters caused issues when synced on Windows (and in your case in the command too). It can be made to work on Unix systems, but you never know if those files will be synced to Windows. So sadly we have to use the largest common denominator here. The UI should probably tell you about this though, I'll update the title to track this work.

hbons avatar Dec 16 '17 21:12 hbons

git check-ignore -v * shows a list of ignored files and the matched pattern. Will be a matter of just parsing that.

hbons avatar Dec 16 '17 21:12 hbons

I ran into this kind of issue again today. It would be nice to remove some bits in this $GIT_DIR/info/exclude file. In particular the following bits:

*<*
*>*
*:*
*"*
*|*
*\?*
*\**
*\\*

Is there a reason why these are still here? As you said it causes issues on windows, but this is fixed by #1852 right? Using --file instead of --message.

EDIT: If not possible, I would like to be able to configure these myself, or be able to give the user visual cues.

My main concern is that users are lead to think that all files in the repositories are tracked, when it's not the case, and that creates quite a few issues.

Ppjet6 avatar Oct 03 '18 16:10 Ppjet6

Personally something like the following seems like a robust solution:

  • Remove the OS specific patterns from the exclude file
  • As a problematic file that is detected, pop up a dialog saying Using filename $foo will not work correctly. Would you like to rename it it $bar? [yes] [no]
  • Upon selecting [no] user is prompted to enter a new filename, with a hint for disallowed characters.
  • In either case, one must assume the file is opened at this point Windows - doesn't allow renames when file is opened POSIX - will need to use something like lsof to check Application $foo is using file $bar. Please close the application before renaming the file.

evelikov avatar Oct 09 '18 15:10 evelikov