Code

Merge branch 'maint'
[git.git] / Documentation / diff-options.txt
index 3d2b9d0a06f38c42c0df927fa03a053fa1b45277..e4af393515c346528bccb7a4f2d3823aebddddfc 100644 (file)
@@ -1,11 +1,39 @@
+// Please don't remove this comment as asciidoc behaves badly when
+// the first non-empty line is ifdef/ifndef. The symptom is that
+// without this comment the <git-diff-core> attribute conditionally
+// defined below ends up being defined unconditionally.
+// Last checked with asciidoc 7.0.2.
+
+ifndef::git-format-patch[]
+ifndef::git-diff[]
+:git-diff-core: 1
+endif::git-diff[]
+endif::git-format-patch[]
+
+ifdef::git-format-patch[]
 -p::
-       Generate patch (see section on generating patches)
+       Generate patches without diffstat.
+endif::git-format-patch[]
+
+ifndef::git-format-patch[]
+-p::
+       Generate patch (see section on generating patches).
+       {git-diff? This is the default.}
+endif::git-format-patch[]
 
 -u::
        Synonym for "-p".
 
+-U<n>::
+       Shorthand for "--unified=<n>".
+
+--unified=<n>::
+       Generate diffs with <n> lines of context instead of
+       the usual three. Implies "-p".
+
 --raw::
        Generate the raw format.
+       {git-diff-core? This is the default.}
 
 --patch-with-raw::
        Synonym for "-p --raw".
 
 --patch-with-stat::
        Synonym for "-p --stat".
+       {git-format-patch? This is the default.}
 
 -z::
-       \0 line termination on output
+       NUL-line termination on output.  This affects the --raw
+       output field terminator.  Also output from commands such
+       as "git-log" will be delimited with NUL between commits.
 
 --name-only::
        Show only names of changed files.
 
 --ext-diff::
        Allow an external diff helper to be executed. If you set an
-       external diff driver with gitlink:gitattributes(5), you need
-       to use this option with gitlink:git-log(1) and friends.
+       external diff driver with gitlink:gitattributes[5], you need
+       to use this option with gitlink:git-log[1] and friends.
 
 --no-ext-diff::
        Disallow external diff drivers.