@matheusbsbs / matheus-bagliano / commits / 64485b4aba
Fork 0

Clarify and correct -z

The description for -z is too vague and general for the apply, diff*, and log commands. Change the description of -z for 'git log' to note that commits will be separated by NULs. Change the description of -z for 'git diff*' and 'git apply' to note that it applies to the --numstat option, and for 'git diff*' also for --raw option. Also correct the description of the "munging" of pathanmes that takes place in the absence of -z for the 'git diff*' and 'git apply' commands, namely that apart from the characters mentioned, double quotes will also be escaped and that the pathname will be enclosed in double quotes if any characters are escaped. Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Björn Gustavsson committed Nov 22, 2009 at 20:43 UTC 64485b4aba98b39f2cf4528aed95b6ddca62f332
2 files changed +21 -8
Documentation/diff-options.txt
+14 -3
@@ -85,10 +85,21 @@ ifndef::git-format-patch[]
85 endif::git-format-patch[]
86
87 ifndef::git-format-patch[]
88 +
89 -z::
89 - NUL-line termination on output. This affects the `--raw`
90 - output field terminator. Also output from commands such
91 - as `git-log` will be delimited with NUL between commits.
90 +ifndef::git-log[]
91 + When `--raw` or `--numstat` has been given, do not munge
92 + pathnames and use NULs as output field terminators.
93 ++
94 +Without this option, each pathname output will have TAB, LF, double quotes,
95 +and backslash characters replaced with `\t`, `\n`, `\"`, and `\\`,
96 +respectively, and the pathname will be enclosed in double quotes if
97 +any of those replacements occurred.
98 +endif::git-log[]
99 +
100 +ifdef::git-log[]
101 + Separate the commits with NULs instead of with new newlines.
102 +endif::git-log[]
103
104 --name-only::
105 Show only names of changed files.
Documentation/git-apply.txt
+7 -5
@@ -87,11 +87,13 @@ the information is read from the current index instead.
87 rejected hunks in corresponding *.rej files.
88
89 -z::
90 - When showing the index information, do not munge paths,
91 - but use NUL terminated machine readable format. Without
92 - this flag, the pathnames output will have TAB, LF, and
93 - backslash characters replaced with `\t`, `\n`, and `\\`,
94 - respectively.
90 + When `--numstat` has been given, do not munge pathnames,
91 + but use a NUL-terminated machine-readable format.
92 ++
93 +Without this option, each pathname output will have TAB, LF, double quotes,
94 +and backslash characters replaced with `\t`, `\n`, `\"`, and `\\`,
95 +respectively, and the pathname will be enclosed in double quotes if
96 +any of those replacements occurred.
97
98 -p<n>::
99 Remove <n> leading slashes from traditional diff paths. The