Re: Stupid quoting...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Kastrup wrote:
> Junio C Hamano <gitster@xxxxxxxxx> writes:
>> Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:
>>
>>>> I don't see our discourse leading anywhere: the points have been made.
>>>
>>> I would really, really, really like to see a solution. Alas, I
>>> cannot think of one, other than _forcing_ the developers to use
>>> ASCII-only filenames.
>>> Note that there is no convention yet in Git to state which encoding
>>> your filenames are supposed to use. And in fact, we already had a
>>> fine example in git.git why this is particularly difficult. MacOSX
>>> is too clever to be true, in that it gladly takes filenames in one
>>> encoding, but reads those filenames out in _another_
>>> encoding. Thus, a "git add <filename>" can well end up in
>>> git-status saying that a file was deleted, and another file
>>> (actually the same, but in a different encoding) is untracked.
>>
>> Having said that, the absolute minimum that needs to be quoted are
>> double-quote (because it is used by quoting as agreed with GNU
>> diff/patch maintainer), backslash (used to introduce C-like
>> quoting),
>> newline and horizontal tab (makes "patch" confused, as it would make
>> it ambiguous where the pathname ends), so I am not opposed to a
>> patch that introduces a new mode, probably on by default _unless_ we
>> are generating --format=email, that does not quote high byte values.
> 
> I think it would be ok to quote non-graphic characters with octal
> escape sequences.  On ASCII-based systems, those are the characters
> 0x00 to 0x1f.  They don't have a visual representation of their own,
> anyway.  _IF_ they appear in filenames, it is certainly a case
> involved with excessive cleverness and/or garbage.  I'd leave the rest
> alone.

By the way, ls(1) has its --quoting-style=WORD option, why shouldn't
git-diff and friends (including git-format-patch) have the same? And we
could change the default later on...

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux