Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit c1a95fa

Browse files
Sergei Organovgitster
Sergei Organov
authored andcommitted
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>
1 parent 8e7b07c commit c1a95fa

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

Documentation/diff-options.txt

+23-1
Original file line numberDiff line numberDiff line change
@@ -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[]
114
-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[]
323

424
-u::
525
Synonym for "-p".
@@ -13,6 +33,7 @@
1333

1434
--raw::
1535
Generate the raw format.
36+
{git-diff-core? This is the default.}
1637

1738
--patch-with-raw::
1839
Synonym for "-p --raw".
@@ -41,6 +62,7 @@
4162

4263
--patch-with-stat::
4364
Synonym for "-p --stat".
65+
{git-format-patch? This is the default.}
4466

4567
-z::
4668
NUL-line termination on output. This affects the --raw

Documentation/git-diff.txt

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ and the range notations ("<commit>..<commit>" and
7575

7676
OPTIONS
7777
-------
78+
:git-diff: 1
7879
include::diff-options.txt[]
7980

8081
<path>...::

Documentation/git-format-patch.txt

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ reference.
6666

6767
OPTIONS
6868
-------
69+
:git-format-patch: 1
6970
include::diff-options.txt[]
7071

7172
-<n>::

0 commit comments

Comments
 (0)