@matheusbsbs / matheus-bagliano / commits / 6f2e02aeb0
Fork 0

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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jul 29, 2020 at 16:11 UTC 6f2e02aeb004a2ecd6aec1732f4abeaf88fba4b9
2 files changed +40 -48
Documentation/git-log.txt
+40 -2
@@ -111,8 +111,46 @@ include::rev-list-options.txt[]
111
112 include::pretty-formats.txt[]
113
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`.
154
155 :git-log: 1
156 include::diff-options.txt[]
Documentation/rev-list-options.txt
-46
@@ -1117,49 +1117,3 @@ ifdef::git-rev-list[]
1117 by a tab.
1118 endif::git-rev-list[]
1119 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[]