git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Chris Torek <chris.torek@gmail.com>
Subject: [PATCH v2 4/7] doc/git-log: move "Diff Formatting" from rev-list-options
Date: Wed, 29 Jul 2020 16:11:16 -0400	[thread overview]
Message-ID: <20200729201116.GD2989342@coredump.intra.peff.net> (raw)
In-Reply-To: <20200729201002.GA2989059@coredump.intra.peff.net>

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>
---
 Documentation/git-log.txt          | 42 +++++++++++++++++++++++++--
 Documentation/rev-list-options.txt | 46 ------------------------------
 2 files changed, 40 insertions(+), 48 deletions(-)

diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 20e6d21a74..fb3998d8e0 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -111,8 +111,46 @@ include::rev-list-options.txt[]
 
 include::pretty-formats.txt[]
 
-COMMON DIFF OPTIONS
--------------------
+DIFF FORMATTING
+---------------
+
+By default, `git log` does not generate any diff output. The options
+below can be used to show the changes made by each commit.
+
+-c::
+	With this option, diff output for a merge commit
+	shows the differences from each of the parents to the merge result
+	simultaneously instead of showing pairwise diff between a parent
+	and the result one at a time. Furthermore, it lists only files
+	which were modified from all parents.
+
+--cc::
+	This flag implies the `-c` option and further compresses the
+	patch output by omitting uninteresting hunks whose contents in
+	the parents have only two variants and the merge result picks
+	one of them without modification.
+
+--combined-all-paths::
+	This flag causes combined diffs (used for merge commits) to
+	list the name of the file from all parents.  It thus only has
+	effect when -c or --cc are specified, and is likely only
+	useful if filename changes are detected (i.e. when either
+	rename or copy detection have been requested).
+
+-m::
+--diff-merges::
+	This flag makes the merge commits show the full diff like
+	regular commits; for each merge parent, a separate log entry
+	and diff is generated. An exception is that only diff against
+	the first parent is shown when `--first-parent` option is given;
+	in that case, the output represents the changes the merge
+	brought _into_ the then-current branch.
+
+-r::
+	Show recursive diffs.
+
+-t::
+	Show the tree objects in the diff output. This implies `-r`.
 
 :git-log: 1
 include::diff-options.txt[]
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 0785a0cfe9..398178d72a 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -1117,49 +1117,3 @@ ifdef::git-rev-list[]
 	by a tab.
 endif::git-rev-list[]
 endif::git-shortlog[]
-
-ifndef::git-shortlog[]
-ifndef::git-rev-list[]
-Diff Formatting
-~~~~~~~~~~~~~~~
-
-Listed below are options that control the formatting of diff output.
-Some of them are specific to linkgit:git-rev-list[1], however other diff
-options may be given. See linkgit:git-diff-files[1] for more options.
-
--c::
-	With this option, diff output for a merge commit
-	shows the differences from each of the parents to the merge result
-	simultaneously instead of showing pairwise diff between a parent
-	and the result one at a time. Furthermore, it lists only files
-	which were modified from all parents.
-
---cc::
-	This flag implies the `-c` option and further compresses the
-	patch output by omitting uninteresting hunks whose contents in
-	the parents have only two variants and the merge result picks
-	one of them without modification.
-
---combined-all-paths::
-	This flag causes combined diffs (used for merge commits) to
-	list the name of the file from all parents.  It thus only has
-	effect when -c or --cc are specified, and is likely only
-	useful if filename changes are detected (i.e. when either
-	rename or copy detection have been requested).
-
--m::
---diff-merges::
-	This flag makes the merge commits show the full diff like
-	regular commits; for each merge parent, a separate log entry
-	and diff is generated. An exception is that only diff against
-	the first parent is shown when `--first-parent` option is given;
-	in that case, the output represents the changes the merge
-	brought _into_ the then-current branch.
-
--r::
-	Show recursive diffs.
-
--t::
-	Show the tree objects in the diff output. This implies `-r`.
-endif::git-rev-list[]
-endif::git-shortlog[]
-- 
2.28.0.465.gd2839157e3


  parent reply	other threads:[~2020-07-29 20:11 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28 16:36 [PATCH 0/3] making --first-parent imply -m Jeff King
2020-07-28 16:36 ` [PATCH 1/3] log: drop "--cc implies -m" logic Jeff King
2020-07-28 16:38 ` [PATCH 2/3] revision: add "--ignore-merges" option to counteract "-m" Jeff King
2020-07-28 17:52   ` Chris Torek
2020-07-29 18:42     ` Jeff King
2020-07-28 21:01   ` Junio C Hamano
2020-07-29 18:22     ` Jeff King
2020-07-29 18:30       ` Jeff King
2020-07-29 18:53         ` Junio C Hamano
2020-07-28 16:39 ` [PATCH 3/3] log: enable "-m" automatically with "--first-parent" Jeff King
2020-07-28 16:47 ` [PATCH 0/3] making --first-parent imply -m Jeff King
2020-07-28 16:48 ` Junio C Hamano
2020-07-28 16:53   ` Jeff King
2020-07-28 16:55 ` Taylor Blau
2020-07-29 20:10 ` [PATCH v2 0/7] making log " Jeff King
2020-07-29 20:10   ` [PATCH v2 1/7] log: drop "--cc implies -m" logic Jeff King
2020-07-29 20:10   ` [PATCH v2 2/7] revision: add "--no-diff-merges" option to counteract "-m" Jeff King
2020-07-29 20:10   ` [PATCH v2 3/7] log: enable "-m" automatically with "--first-parent" Jeff King
2020-07-29 20:28     ` Junio C Hamano
2020-07-29 20:11   ` Jeff King [this message]
2020-07-29 20:56     ` [PATCH v2 4/7] doc/git-log: move "Diff Formatting" from rev-list-options Junio C Hamano
2020-07-29 21:02       ` Jeff King
2020-07-29 20:11   ` [PATCH v2 5/7] doc/git-log: drop "-r" diff option Jeff King
2020-07-29 20:12   ` [PATCH v2 6/7] doc/git-log: move "-t" into diff-options list Jeff King
2020-07-29 21:10     ` Junio C Hamano
2020-07-29 21:55       ` Jeff King
2020-07-29 20:12   ` [PATCH v2 7/7] doc/git-log: clarify handling of merge commit diffs Jeff King
2020-07-29 21:03   ` [PATCH v2 0/7] making log --first-parent imply -m Chris Torek
2020-07-29 21:41   ` Sergey Organov
2020-07-31 23:08     ` Jeff King
2020-08-02 12:59       ` Sergey Organov
2020-08-02 17:35         ` Junio C Hamano
2020-08-03 15:47           ` Sergey Organov
2020-08-03 16:35             ` Junio C Hamano
2020-08-03 16:41               ` Sergey Organov
2020-08-03 17:21                 ` Junio C Hamano
2020-08-03 20:25                   ` Sergey Organov
2020-08-03 20:58                     ` Jeff King
2020-08-03 21:16                       ` Sergey Organov
2020-08-03 18:08             ` Jeff King
2020-08-03 20:00               ` Sergey Organov
2020-08-03 20:55                 ` Jeff King
2020-08-03 21:18                   ` Sergey Organov
2020-08-04 17:50               ` Sergey Organov
2020-08-04 19:42                 ` Junio C Hamano
2020-08-04 20:00                   ` Jeff King
2020-08-04 20:55                     ` Sergey Organov
2020-08-04 21:22                       ` Jeff King
2020-08-04 21:55                         ` Junio C Hamano
2020-08-04 22:06                           ` Sergey Organov
2020-08-04 22:14                             ` Jeff King
2020-08-04 22:49                               ` Junio C Hamano
2020-08-07  8:26                                 ` Jeff King
2020-08-07  9:25                                   ` Sergey Organov
2020-08-07 17:43                                   ` Junio C Hamano
2020-08-07 17:52                                     ` Sergey Organov
2020-08-07 19:01                                       ` Junio C Hamano
2020-08-07 19:12                                         ` Sergey Organov
2020-08-07 19:20                                           ` Jeff King
2020-08-07 19:28                                             ` Sergey Organov
2020-08-07 19:46                                           ` Junio C Hamano
2020-08-07 20:29                                             ` Sergey Organov
2020-08-07 20:39                                               ` Junio C Hamano
2020-08-07 21:08                                                 ` Sergey Organov
2020-08-07 21:54                                                   ` Junio C Hamano
2020-08-07 23:07                                                     ` Sergey Organov
2020-08-04 22:53                               ` Sergey Organov
2020-08-04 21:21                     ` Sergey Organov
2020-08-04 21:26                       ` Jeff King
2020-08-04 19:58                 ` Jeff King
2020-08-04 20:56                   ` Sergey Organov
2020-08-04 21:25                     ` Jeff King
2020-08-04 21:41                       ` Sergey Organov
2020-08-04 22:07                         ` Jeff King
2020-08-04 22:15                           ` Sergey Organov
2020-08-04 21:27                     ` Junio C Hamano
2020-08-04 21:44                       ` Sergey Organov
2020-08-04 21:58                   ` Sergey Organov
2020-08-04 22:08                     ` Jeff King
2020-08-04 22:26                       ` [PATCH] revision: fix die() message for "--unpacked=" Sergey Organov
2020-08-05  0:03                         ` Junio C Hamano
2020-08-05 15:37                   ` [PATCH v2 0/7] making log --first-parent imply -m Sergey Organov
2020-08-05 16:05                     ` Junio C Hamano
2020-08-05 17:55                       ` Sergey Organov
2020-08-05 19:24                         ` Junio C Hamano
2020-08-05 20:27                           ` Sergey Organov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200729201116.GD2989342@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=chris.torek@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).