git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: `git status --porcelain` disagrees with documentation about quoting filenames with spaces

From
Kevin Ballard <kevin@sb.org>
Date
Oct 28, 2010, 21:17 UTC
Message-ID
<EFFE2D68-BBA3-4EF4-B56A-AA4882EDE1E4@sb.org>
In-Reply-To
<7v39rqb1ji.fsf@alter.siamese.dyndns.org>
On Oct 28, 2010, at 11:44 AM, Junio C Hamano wrote:
> Kevin Ballard <kevin@sb.org> writes:
> 
> [jc: why do you send messages with toooooooooooo loooooong lines sometimes
> and normal line lengths some other times...?]

I use a GUI mail client to write email. Anything I copy&paste is hard-wrapped, anything I write directly tends to not include hard linebreaks at all. Would it be better if I hard-wrapped my lines?

Show 18 quoted lines
>> Given that the removal of quoting for filenames with spaces was an
>> intentional change, does anybody have any strong opinions about whether
>> we should restore the quotes in this scenario? The alternative is to
>> simply change the documentation, but the un-parsability of the
>> --porcelain format has me worried.
> 
> 28fba29 (Do not quote SP., 2005-10-17) explicitly addressed a breakage
> that quoted pathnames in contexts like this one:
> 
>    diff --git a/My Documents/hello.txt b/My Documents/hello.txt
> 
> I personally think people who add SP to their pathnames need to get their
> head examined, and in that sense I do not strongly mind if the pathnames
> in the above are quoted (that is why the original quotation before the
> said commit quoted them), but apparently other people did mind.  I also
> think people who have " -> " in their pathnames are even less sane beyond
> salvation, and between the two insanity, I'd rather help less insane ones
> by not quoting the above.

I agree that SP in pathnames in source is insane, but it's perfectly common to do when working with non-source files. For example, in the project I'm using right now, I have a file named "Application 1.0.xcdatamodel" and another named "Application 1.1.xcdatamodel". These are data files and their name on disk matches the name given to them in the IDE. In this case, I think the SP is perfectly justified. Granted, having " -> " in your pathname is also pretty insane, but my motivation here is just ensuring that the --porcelain format is parseable even if you are insane.

> The best would probably be to special case SP (which is normally not to be
> quoted) _only_ in the context of "something" -> "something".
That's what I was thinking. I'll look into doing just that.
-Kevin Ballard
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 7 in “`git status --porcelain` disagrees with documentation about quoting filenames with spaces”
  1. Kevin BallardOct 27, 2010
  2. Junio C HamanoOct 28, 2010
  3. Kevin BallardOct 28, 2010
  4. Junio C HamanoOct 28, 2010
  5. Kevin BallardOct 29, 2010
  6. Kevin BallardOct 29, 2010
  7. status: Quote paths with spaces in short formatKevin Ballard, Nov 9, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.