Re: Stupid quoting...

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

 



Jakub Narebski <jnareb@xxxxxxxxx> writes:

> 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...

Because interpreting a diff means interpreting both file names as well
as contents.  It does not make much sense to use different forms of
escaping (\01a and similar) here, though in the diff command line,
some additional quoting might be called for.

It is also worth noting that bash's echo -e can interpret octal
escapes only when they start with \0, and the quoted 3-character forms
of 0x00-0x1f incidentally do start in this manner.  There is still
potential for misinterpretation if an escaped character is immediately
followed by a digit.  Since octal ASCII digits are in the range 060 to
067, one can get around this problem by continuing to escape
characters until one hits a non-octal-digit.  So there is at least a
reasonable builtin way for bash scripts to translate the three-digit
octal escapes for 0x00 to 0x1f uniquely into the proper corresponding
strings.

With regard to escaping: unless used unarmored in Email (a bad idea)
or on a terminal, it might be easiest (for post-processors) to
completely refrain from escaping (in effect ignoring the
non-printability of characters) and just apply a minimal level of
quoting on the file names.

-- 
David Kastrup

-
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