From: Junio C Hamano Date: Tue, 08 Sep 2020 04:41:00 GMT Subject: Re: [Bug report] git status doesn't escape paths of untracked files Message-ID: In-Reply-To: Junio C Hamano writes: > "brian m. carlson" writes: > >> git-status(1) says: >> >> If a filename contains whitespace or other nonprintable characters, >> that field will be quoted in the manner of a C string literal: >> surrounded by ASCII double quote (34) characters, and with interior >> special characters backslash-escaped. >> >> Note that that differs from the standard behavior of not handling >> spaces, which I expect is due to the need to handle renames >> unambiguously. > > Not really. We use "rename from" and "rename to" extended header > lines in our output to unambiguously handle renamed paths. Ah, I think I misunderstood you. We don't special case SP in what you called "the standard behaviour", i.e. "diff" output because we use "rename from/to", but a short format "status" that does not use NUL delimited output, we do need to give two paths, separate by whitespaces, and the quoting each path separately does help.