Documentation: customize diff-options depending on particular command
Customize diff-options depending on particular command as follows, mostly to make git-diff and git-format-patch manuals less confusing: * git-format-patch: - Mark --patch-with-stat as being the default. - Change -p description so that it matches what it actually does and so that it doesn't refer to absent "section on generating patches". * git-diff: mark -p as being the default. * git-diff-index/git-diff-files/git-diff-tree: mark --raw as being the default. Signed-off-by: Sergei Organov <osv@javad.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sergei Organov committed
Nov 15, 2007 at 16:19 UTC
c1a95fa629b837fd291ca0e1428604710a2bc1dd
3 files changed
+25
-1
Documentation/diff-options.txt
+23
-1
@@ -1,5 +1,25 @@
1
+// Please don't remove this comment as asciidoc behaves badly when
2
+// the first non-empty line is ifdef/ifndef. The symptom is that
3
+// without this comment the <git-diff-core> attribute conditionally
4
+// defined below ends up being defined unconditionally.
5
+// Last checked with asciidoc 7.0.2.
6
+
7
+ifndef::git-format-patch[]
8
+ifndef::git-diff[]
9
+:git-diff-core: 1
10
+endif::git-diff[]
11
+endif::git-format-patch[]
12
+
13
+ifdef::git-format-patch[]
14
-p::
2
- Generate patch (see section on generating patches)
15
+ Generate patches without diffstat.
16
+endif::git-format-patch[]
17
+
18
+ifndef::git-format-patch[]
19
+-p::
20
+ Generate patch (see section on generating patches).
21
+ {git-diff? This is the default.}
22
+endif::git-format-patch[]
23
24
-u::
25
Synonym for "-p".
@@ -13,6 +33,7 @@
33
34
--raw::
35
Generate the raw format.
36
+ {git-diff-core? This is the default.}
37
38
--patch-with-raw::
39
Synonym for "-p --raw".
@@ -41,6 +62,7 @@
62
63
--patch-with-stat::
64
Synonym for "-p --stat".
65
+ {git-format-patch? This is the default.}
66
67
-z::
68
NUL-line termination on output. This affects the --raw
Documentation/git-diff.txt
+1
@@ -75,6 +75,7 @@ and the range notations ("<commit>..<commit>" and
75
76
OPTIONS
77
-------
78
+:git-diff: 1
79
include::diff-options.txt[]
80
81
<path>...::
Documentation/git-format-patch.txt
+1
@@ -66,6 +66,7 @@ reference.
66
67
OPTIONS
68
-------
69
+:git-format-patch: 1
70
include::diff-options.txt[]
71
72
-<n>::