Skip to content

Commit 6f2e02a

Browse files
peffgitster
authored andcommitted
doc/git-log: move "Diff Formatting" from rev-list-options
Our rev-list-options.txt include has a "Diff Formatting" section, but it is ifndef'd out for all manpages except git-log. And a few bits of the text are rather out of date. We say "some of these options are specific to git-rev-list". That's obviously silly since we (even before this patch) show the content only for git-log. But moreover, it's not true; each of the listed options is meaningful for other diff commands. We also say "...however other diff options may be given. See git-diff-files for more options." But there's no need to do so; git-log already has a "Common Diff Options" section which includes diff-options.txt. So let's move these options over to git-log and put them with the other diff options, giving a single "diff" section for the git-log documentation. We'll call it "Diff Formatting" but use the all-caps top-level header to match its sibling sections. And we'll rewrite the section intro to remove the useless bits and give a more generic overview of the section which can be later extended. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9ab89a2 commit 6f2e02a

File tree

2 files changed

+40
-48
lines changed

2 files changed

+40
-48
lines changed

Documentation/git-log.txt

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,46 @@ include::rev-list-options.txt[]
111111

112112
include::pretty-formats.txt[]
113113

114-
COMMON DIFF OPTIONS
115-
-------------------
114+
DIFF FORMATTING
115+
---------------
116+
117+
By default, `git log` does not generate any diff output. The options
118+
below can be used to show the changes made by each commit.
119+
120+
-c::
121+
With this option, diff output for a merge commit
122+
shows the differences from each of the parents to the merge result
123+
simultaneously instead of showing pairwise diff between a parent
124+
and the result one at a time. Furthermore, it lists only files
125+
which were modified from all parents.
126+
127+
--cc::
128+
This flag implies the `-c` option and further compresses the
129+
patch output by omitting uninteresting hunks whose contents in
130+
the parents have only two variants and the merge result picks
131+
one of them without modification.
132+
133+
--combined-all-paths::
134+
This flag causes combined diffs (used for merge commits) to
135+
list the name of the file from all parents. It thus only has
136+
effect when -c or --cc are specified, and is likely only
137+
useful if filename changes are detected (i.e. when either
138+
rename or copy detection have been requested).
139+
140+
-m::
141+
--diff-merges::
142+
This flag makes the merge commits show the full diff like
143+
regular commits; for each merge parent, a separate log entry
144+
and diff is generated. An exception is that only diff against
145+
the first parent is shown when `--first-parent` option is given;
146+
in that case, the output represents the changes the merge
147+
brought _into_ the then-current branch.
148+
149+
-r::
150+
Show recursive diffs.
151+
152+
-t::
153+
Show the tree objects in the diff output. This implies `-r`.
116154

117155
:git-log: 1
118156
include::diff-options.txt[]

Documentation/rev-list-options.txt

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,49 +1117,3 @@ ifdef::git-rev-list[]
11171117
by a tab.
11181118
endif::git-rev-list[]
11191119
endif::git-shortlog[]
1120-
1121-
ifndef::git-shortlog[]
1122-
ifndef::git-rev-list[]
1123-
Diff Formatting
1124-
~~~~~~~~~~~~~~~
1125-
1126-
Listed below are options that control the formatting of diff output.
1127-
Some of them are specific to linkgit:git-rev-list[1], however other diff
1128-
options may be given. See linkgit:git-diff-files[1] for more options.
1129-
1130-
-c::
1131-
With this option, diff output for a merge commit
1132-
shows the differences from each of the parents to the merge result
1133-
simultaneously instead of showing pairwise diff between a parent
1134-
and the result one at a time. Furthermore, it lists only files
1135-
which were modified from all parents.
1136-
1137-
--cc::
1138-
This flag implies the `-c` option and further compresses the
1139-
patch output by omitting uninteresting hunks whose contents in
1140-
the parents have only two variants and the merge result picks
1141-
one of them without modification.
1142-
1143-
--combined-all-paths::
1144-
This flag causes combined diffs (used for merge commits) to
1145-
list the name of the file from all parents. It thus only has
1146-
effect when -c or --cc are specified, and is likely only
1147-
useful if filename changes are detected (i.e. when either
1148-
rename or copy detection have been requested).
1149-
1150-
-m::
1151-
--diff-merges::
1152-
This flag makes the merge commits show the full diff like
1153-
regular commits; for each merge parent, a separate log entry
1154-
and diff is generated. An exception is that only diff against
1155-
the first parent is shown when `--first-parent` option is given;
1156-
in that case, the output represents the changes the merge
1157-
brought _into_ the then-current branch.
1158-
1159-
-r::
1160-
Show recursive diffs.
1161-
1162-
-t::
1163-
Show the tree objects in the diff output. This implies `-r`.
1164-
endif::git-rev-list[]
1165-
endif::git-shortlog[]

0 commit comments

Comments
 (0)