git-annex/Utility
Joey Hess ebd778c519 Escape ':' in file/directory names to avoid it being treated as a pathspec by some git commands
A git pathspec is a filename, except when it starts with ':', it's taken
to refer to a branch, etc. Rather than special case ':', any filename
starting with anything unusual is prefixed with "./"

This could have been a real mess to deal with, but luckily SafeCommand
is already extensively used and so we know at the type level the difference
between parameters that are files, and parameters that are command options.

Testing did show that Git.Queue was not using SafeCommand on
filenames fed to xargs. (Filenames starting with '-' worked before only
because -- was used to separate filenames from options when calling eg git
add.)

The test suite now passes with filenames starting with ':'. However, I did
not keep that change to it, because such filenames are probably not legal
on windows, and I have enough ugly windows ifdefs in there as it is.

This commit was sponsored by Otavio Salvador. Thanks!
2013-08-01 15:15:49 -04:00
..
DirWatcher let's put type modules under the parent module, not in a Types directory 2013-03-10 22:24:13 -04:00
Gpg GnuPG options for symmetric encryption. 2013-03-11 09:48:38 -04:00
Applicative.hs pointlessness 2012-06-29 10:00:05 -04:00
Base64.hs tag xmpp pushes with jid 2013-03-06 16:29:19 -04:00
Batch.hs simpler ifdef for linux 2013-06-21 13:09:09 -04:00
CoProcess.hs got file descriptors mixed up in last commit 2013-06-14 17:59:22 -04:00
CopyFile.hs Android: Fix use of cp command to not try to use features present only on build system. 2013-06-14 11:54:44 -04:00
Daemon.hs fix a minor fd leak 2013-05-27 16:48:41 -04:00
DataUnits.hs refactor and unify code 2013-07-19 19:39:14 -04:00
DBus.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
Directory.hs better nukefile 2013-05-21 13:03:46 -04:00
DirWatcher.hs assistant: Fix OSX bug that prevented committing changed files to a repository when in indirect mode. 2013-03-17 17:01:43 -04:00
DiskFree.hs tweak 2013-03-13 14:54:52 -04:00
Dot.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
Env.hs fix the day's windows permissions damage 2013-05-12 19:09:48 -04:00
Exception.hs avoid warnings when built with ghc 7.6 2013-06-02 15:01:58 -04:00
ExternalSHA.hs configure: Better checking that sha commands output in the desired format. 2013-05-08 11:17:09 -04:00
FileMode.hs fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
FileSystemEncoding.hs Fix a few bugs involving filenames that are at or near the filesystem's maximum filename length limit. 2013-07-30 19:18:29 -04:00
Format.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
FreeDesktop.hs linux standalone auto-install icons 2013-07-09 20:50:41 -04:00
FSEvents.hs let's put type modules under the parent module, not in a Types directory 2013-03-10 22:24:13 -04:00
Gpg.hs Allow building with gpg2. 2013-05-19 17:59:58 -04:00
HumanNumber.hs refactor and unify code 2013-07-19 19:39:14 -04:00
HumanTime.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
InodeCache.hs fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
INotify.hs catch does not exist error when adding a watch 2013-07-17 15:32:24 -04:00
JSONStream.hs whitespace fixes 2012-12-13 00:45:27 -04:00
Kqueue.hs let's put type modules under the parent module, not in a Types directory 2013-03-10 22:24:13 -04:00
libdiskfree.c Makefile now builds using cabal, taking advantage of cabal's automatic detection of appropriate build flags. 2013-02-27 02:39:22 -04:00
libdiskfree.h Renamed diskfree.c to avoid OSX case insensativity bug. 2012-04-13 11:26:39 -04:00
libkqueue.c include sys/types.h 2013-04-24 10:39:52 -04:00
libkqueue.h fix prototype 2012-06-19 01:57:19 -04:00
libmounts.c cleanup 2012-07-19 21:20:38 -04:00
libmounts.h Got removable media mount detection working on Android. 2013-05-04 16:19:25 -04:00
LogFile.hs fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
Lsof.hs clean up from windows porting 2013-05-11 18:23:41 -04:00
Matcher.hs fix handling of Not in the matcher 2013-05-25 13:50:27 -04:00
Metered.hs webapp: Progess bar fixes for many types of special remotes. 2013-03-28 17:04:37 -04:00
Misc.hs fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
Monad.hs assistant: In direct mode, objects are now only dropped when all associated files are unwanted. This avoids a repreated drop/get loop of a file that has a copy in an archive directory, and a copy not in an archive directory. (Indirect mode still has some buggy behavior in this area, since it does not keep track of associated files.) Closes: #712060 2013-06-15 14:44:43 -04:00
Mounts.hsc avoid warnings when built with ghc 7.6 2013-06-02 15:01:58 -04:00
Network.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
NotificationBroadcaster.hs webapp: Fix a race that sometimes caused alerts or other notifications to be missed if they occurred while a page was loading. 2013-03-27 14:56:20 -04:00
OSX.hs squelch warning 2012-11-26 16:29:05 -04:00
Parallel.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
PartialPrelude.hs rename readMaybe to readish 2012-01-23 17:00:10 -04:00
Path.hs Fix a few bugs involving filenames that are at or near the filesystem's maximum filename length limit. 2013-07-30 19:18:29 -04:00
Percentage.hs cleanup 2013-07-20 20:56:04 -04:00
Process.hs reorg 2013-07-08 14:51:43 -04:00
QuickCheck.hs Stop depending on testpack. 2013-02-27 23:23:41 -04:00
Rsync.hs deal with Cygwin rsync paths issue 2013-05-14 13:24:15 -04:00
SafeCommand.hs Escape ':' in file/directory names to avoid it being treated as a pathspec by some git commands 2013-08-01 15:15:49 -04:00
Shell.hs fix use of wrong shebang when android is installing git-annex-shell wrapper on server 2013-05-06 15:58:13 -04:00
SRV.hs remove debug prints 2013-05-30 13:36:51 -04:00
Tense.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
ThreadLock.hs reorg 2012-06-17 14:02:40 -04:00
ThreadScheduler.hs fix warning 2013-05-26 16:02:55 -04:00
TList.hs add two long-running XMPP push threads, no more inversion of control 2013-05-22 15:13:31 -04:00
Tmp.hs Fix a few bugs involving filenames that are at or near the filesystem's maximum filename length limit. 2013-07-30 19:18:29 -04:00
Touch.hsc finished where indentation changes 2012-12-13 00:24:19 -04:00
Url.hs importfeed: git-annex becomes a podcatcher in 150 LOC 2013-07-28 16:55:42 -04:00
UserInfo.hs fix the day's windows permissions damage 2013-05-12 19:09:48 -04:00
Verifiable.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
WebApp.hs now builds with both yesod 1.2 and 1.1 2013-06-03 18:14:22 -04:00
Yesod.hs fix a build failure on android 2013-06-27 15:25:28 -04:00