Skip to content

Commit 7c65b2e

Browse files
moygitster
authored andcommitted
git-fast-import.txt: improve documentation for quoted paths
The documentation mentioned only newlines and double quotes as characters needing escaping, but the backslash also needs it. Also, the documentation was not clearly saying that double quotes around the file name were required (double quotes in the examples could be interpreted as part of the sentence, not part of the actual string). Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 462d97d commit 7c65b2e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Documentation/git-fast-import.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,12 @@ A `<path>` string must use UNIX-style directory separators (forward
562562
slash `/`), may contain any byte other than `LF`, and must not
563563
start with double quote (`"`).
564564

565-
If an `LF` or double quote must be encoded into `<path>` shell-style
566-
quoting should be used, e.g. `"path/with\n and \" in it"`.
565+
A path can use C-style string quoting; this is accepted in all cases
566+
and mandatory if the filename starts with double quote or contains
567+
`LF`. In C-style quoting, the complete name should be surrounded with
568+
double quotes, and any `LF`, backslash, or double quote characters
569+
must be escaped by preceding them with a backslash (e.g.,
570+
`"path/with\n, \\ and \" in it"`).
567571

568572
The value of `<path>` must be in canonical form. That is it must not:
569573

0 commit comments

Comments
 (0)