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>
This commit is contained in:
Björn Gustavsson 2009-11-22 20:43:20 +01:00 committed by Junio C Hamano
parent 39add7a36f
commit 64485b4aba
2 changed files with 21 additions and 8 deletions

View File

@ -85,10 +85,21 @@ ifndef::git-format-patch[]
endif::git-format-patch[] endif::git-format-patch[]
ifndef::git-format-patch[] ifndef::git-format-patch[]
-z:: -z::
NUL-line termination on output. This affects the `--raw` ifndef::git-log[]
output field terminator. Also output from commands such When `--raw` or `--numstat` has been given, do not munge
as `git-log` will be delimited with NUL between commits. pathnames and use NULs as output field terminators.
+
Without this option, each pathname output will have TAB, LF, double quotes,
and backslash characters replaced with `\t`, `\n`, `\"`, and `\\`,
respectively, and the pathname will be enclosed in double quotes if
any of those replacements occurred.
endif::git-log[]
ifdef::git-log[]
Separate the commits with NULs instead of with new newlines.
endif::git-log[]
--name-only:: --name-only::
Show only names of changed files. Show only names of changed files.

View File

@ -87,11 +87,13 @@ the information is read from the current index instead.
rejected hunks in corresponding *.rej files. rejected hunks in corresponding *.rej files.
-z:: -z::
When showing the index information, do not munge paths, When `--numstat` has been given, do not munge pathnames,
but use NUL terminated machine readable format. Without but use a NUL-terminated machine-readable format.
this flag, the pathnames output will have TAB, LF, and +
backslash characters replaced with `\t`, `\n`, and `\\`, Without this option, each pathname output will have TAB, LF, double quotes,
respectively. and backslash characters replaced with `\t`, `\n`, `\"`, and `\\`,
respectively, and the pathname will be enclosed in double quotes if
any of those replacements occurred.
-p<n>:: -p<n>::
Remove <n> leading slashes from traditional diff paths. The Remove <n> leading slashes from traditional diff paths. The