Re: [PATCH 1/2] git-fast-import.txt: improve documentation for quoted paths

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 1/2] git-fast-import.txt: improve documentation for quoted paths

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:55:27

Jeff King [off-list ref] writes:
On Thu, Nov 29, 2012 at 06:00:54PM +0100, Matthieu Moy wrote:
quoted
The documentation mentionned only newlines and double quotes as
s/nn/n/
quoted
diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt
index 6603a7a..35b909c 100644
--- a/Documentation/git-fast-import.txt
+++ b/Documentation/git-fast-import.txt
@@ -558,8 +558,9 @@ A `<path>` string must use UNIX-style directory separators (forward
 slash `/`), may contain any byte other than `LF`, and must not
 start with double quote (`"`).
 
-If an `LF` or double quote must be encoded into `<path>` shell-style
-quoting should be used, e.g. `"path/with\n and \" in it"`.
+If an `LF`, backslash or double quote must be encoded into `<path>`
+shell-style quoting should be used, and the complete name should be
+surrounded with double quotes e.g. `"path/with\n, \\ and \" in it"`.
That "shell-style" contradicts with what fast-import.c says, though.
It claims to grok \octal and described as C-style.

Re: [PATCH 1/2] git-fast-import.txt: improve documentation for quoted paths

From: Jeff King <hidden>
Date: 2016-06-15 22:55:27

On Thu, Nov 29, 2012 at 11:15:56AM -0800, Junio C Hamano wrote:
quoted
quoted
-If an `LF` or double quote must be encoded into `<path>` shell-style
-quoting should be used, e.g. `"path/with\n and \" in it"`.
+If an `LF`, backslash or double quote must be encoded into `<path>`
+shell-style quoting should be used, and the complete name should be
+surrounded with double quotes e.g. `"path/with\n, \\ and \" in it"`.
That "shell-style" contradicts with what fast-import.c says, though.
It claims to grok \octal and described as C-style.
Yeah, I think it was just laziness by the original author to use
"shell-style" to mean "quotes and backslash escaping" without thinking
too hard about which escape sequences are available. Saying C-style is
more accurate (and Matthieu's more recent update does that).

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help