SparkleShare
SparkleShare copied to clipboard
List ignored files somewhere and the reason why
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.
Foo4" -> "Foo5
is that the full file name?
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.
git check-ignore -v *
shows a list of ignored files and the matched pattern. Will be a matter of just parsing that.
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.
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.