Thread (20 messages) 20 messages, 6 authors, 2016-12-22

Re: [PATCH 1/2] alternates: accept double-quoted paths

From: Jeff King <hidden>
Date: 2016-12-13 11:52:27

Possibly related (same subject, not in this thread)

On Tue, Dec 13, 2016 at 06:30:15PM +0700, Duy Nguyen wrote:
On Tue, Dec 13, 2016 at 2:52 AM, Jeff King [off-list ref] wrote:
quoted
Instead, let's treat names as unquoted unless they begin
with a double-quote, in which case they are interpreted via
our usual C-stylke quoting rules. This also breaks
backwards-compatibility, but in a smaller way: it only
matters if your file has a double-quote as the very _first_
character in the path (whereas an escape character is a
problem anywhere in the path).  It's also consistent with
many other parts of git, which accept either a bare pathname
or a double-quoted one, and the sender can choose to quote
or not as required.
At least attr has the same problem and is going the same direction
[1]. Cool. (I actually thought the patch was in and evidence that this
kind of backward compatibility breaking was ok, turns out the patch
has stayed around for years)

[1] http://public-inbox.org/git/%3C20161110203428.30512-18-sbeller@google.com%3E/
Thanks for digging that up. As soon as I came up with the idea[1], I
wanted to use the attr code as an example of a similar problem and
solution, but I couldn't find it in the code. Which makes sense if it
wasn't merged.

I do think it's a pretty reasonable approach in general, and would be OK
for the attributes code.

-Peff

[1] One could argue that I did not come up with the idea at all, but
    rather just remembered that somebody else had done so. :)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help