On Tuesday, 24 July 2012 04:37:47 UTC-7, Tim Chase wrote:
> On Tuesday, July 24, 2012 12:29:22 AM UTC+2, Graham Jans wrote:
> > Consider this scenario:
> > $ touch "a 1.txt"
> > $ touch "a 2.txt"
> > $ git add "a 1.txt"
> > $ git status --porcelain
> > A "a 1.txt"
> > ?? a 2.txt
> > Note that the added file is properly quoted to account for the space,
> > the unadded file is not.
> > I am using *1.7.11.msysgit.0*.
> I don't know if this is a 1.7.x thing or a msysgit thing, but I'm
> running 126.96.36.199 on Debian Linux and tried the following:
> $ git init
> Initialized empty Git repository in /home/tim/tmp/g/.git/
> $ touch "a 1.txt"
> $ touch "a 2.txt"
> $ touch '"a 3.txt"'
> $ ls -lsF
> total 0
> 0 -rw-r--r-- 1 tim tim 0 Jul 24 06:30 "a 3.txt"
> 0 -rw-r--r-- 1 tim tim 0 Jul 24 06:30 a 1.txt
> 0 -rw-r--r-- 1 tim tim 0 Jul 24 06:30 a 2.txt
> $ git add "a 1.txt"
> $ git status --porcelain
> A a 1.txt
> ?? "\"a 3.txt\""
> ?? a 2.txt
> I don't get quotes around *either* "a 1.txt" or "a 2.txt", but I do
> get peculiar quoting around '"a 3.txt"' (NB: I don't believe that
> double-quotes are valid filename characters on Windows, so YMMV; and
> if you use double-quotes in file-names, you're just asking for trouble)
Yeah, so in your case, the behavior is at least consistent: it doesn't put
quotes around filenames in spaces in either the 'a 1' or 'a 2' case. (In
the case of 'a 3'... that's just odd, I've never seen anyone put quotes
_in_ a filename before! ;) )
I think quoting filenames with spaces in them is the more sensical
behavrior (or escaping the spaces), as this allows the output to be
trivially used as input; but as I mention above, the real issue I have with
what I'm seeing is the _inconsistency_.
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To view this discussion on the web visit
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to
For more options, visit this group at