summaryrefslogtreecommitdiffstats
path: root/diff-format.txt
diff options
context:
space:
mode:
authorJunio C Hamano <junio@hera.kernel.org>2007-12-12 21:34:02 +0000
committerJunio C Hamano <junio@hera.kernel.org>2007-12-12 21:34:02 +0000
commit3a70234ac18c2126eeef7a31f798af975301194c (patch)
treede1d4725380dd0e28caed3e92b62994e4689b193 /diff-format.txt
parent8d1e471a2604950142943a3b721a1e2d97df84fd (diff)
downloadgit-htmldocs-3a70234ac18c2126eeef7a31f798af975301194c.tar.gz
Autogenerated HTML docs for v1.5.3.7-1170-g8d08
Diffstat (limited to 'diff-format.txt')
-rw-r--r--diff-format.txt61
1 files changed, 61 insertions, 0 deletions
diff --git a/diff-format.txt b/diff-format.txt
index 2c3a4c433..400cbb3b1 100644
--- a/diff-format.txt
+++ b/diff-format.txt
@@ -84,3 +84,64 @@ all parents.
include::diff-generate-patch.txt[]
+
+
+other diff formats
+------------------
+
+The `--summary` option describes newly added, deleted, renamed and
+copied files. The `--stat` option adds diffstat(1) graph to the
+output. These options can be combined with other options, such as
+`-p`, and are meant for human consumption.
+
+When showing a change that involves a rename or a copy, `--stat` output
+formats the pathnames compactly by combining common prefix and suffix of
+the pathnames. For example, a change that moves `arch/i386/Makefile` to
+`arch/x86/Makefile` while modifying 4 lines will be shown like this:
+
+------------------------------------
+arch/{i386 => x86}/Makefile | 4 +--
+------------------------------------
+
+The `--numstat` option gives the diffstat(1) information but is designed
+for easier machine consumption. An entry in `--numstat` output looks
+like this:
+
+----------------------------------------
+1 2 README
+3 1 arch/{i386 => x86}/Makefile
+----------------------------------------
+
+That is, from left to right:
+
+. the number of added lines;
+. a tab;
+. the number of deleted lines;
+. a tab;
+. pathname (possibly with rename/copy information);
+. a newline.
+
+When `-z` output option is in effect, the output is formatted this way:
+
+----------------------------------------
+1 2 README NUL
+3 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL
+----------------------------------------
+
+That is:
+
+. the number of added lines;
+. a tab;
+. the number of deleted lines;
+. a tab;
+. a NUL (only exists if renamed/copied);
+. pathname in preimage;
+. a NUL (only exists if renamed/copied);
+. pathname in postimage (only exists if renamed/copied);
+. a NUL.
+
+The extra `NUL` before the preimage path in renamed case is to allow
+scripts that read the output to tell if the current record being read is
+a single-path record or a rename/copy record without reading ahead.
+After reading added and deleted lines, reading up to `NUL` would yield
+the pathname, but if that is `NUL`, the record will show two paths.