git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Adam Monsen <haircut@gmail.com>,
	git@vger.kernel.org, Jakub Narebski <jnareb@gmail.com>
Subject: Re: [PATCH 1/2] documentation fix: git log -p does not imply -c.
Date: Mon, 7 Mar 2011 14:12:18 -0500	[thread overview]
Message-ID: <20110307191218.GA20930@sigill.intra.peff.net> (raw)
In-Reply-To: <7vtyfe22vy.fsf@alter.siamese.dyndns.org>

On Mon, Mar 07, 2011 at 10:37:21AM -0800, Junio C Hamano wrote:

> > Hmm. "git show" seems to show --cc, but "git log -p" does not show
> > anything.
> 
> The intention has always been to default to --cc since 0fe7c1d (built-in
> diff: assorted updates., 2006-04-29) for "diff" if I am not misremembering
> things, but you are right---"log" is a tad different.
> 
> The code does not want to use --cc by default for "log", and I don't think
> that should change.  See 1aec791 (git log: don't do merge diffs by
> default, 2006-04-19).

Thanks for the history. I think the doc problem was an inaccuracy that
snuck in during 272bd3c (Include diff options in the git-log manpage,
2007-11-01). Nearly identical text (without the inaccuracy) is in the
"Diff Format For Merges" section in diff-format.txt.

Furthermore, the copied text talks about diff-index and diff-tree, but
gets included inline in git-log(1) (although the part in diff-format.txt
does not get included in git-log's manpage)[1]. So probably it's
reasonable to clean it up to something like:

diff --git a/Documentation/diff-generate-patch.txt b/Documentation/diff-generate-patch.txt
index 3ac2bea..3d02da9 100644
--- a/Documentation/diff-generate-patch.txt
+++ b/Documentation/diff-generate-patch.txt
@@ -74,10 +74,12 @@ separate lines indicate the old and the new mode.
 combined diff format
 --------------------
 
-"git-diff-tree", "git-diff-files" and "git-diff" can take '-c' or
-'--cc' option to produce 'combined diff'.  For showing a merge commit
-with "git log -p", this is the default format; you can force showing
-full diff with the '-m' option.
+Any diff-generating command can take the `-c` or `--cc` option to
+produced a 'combined diff' when showing a merge. This is the default
+format when showing merge conflicts with linkgit:git-diff[1] or a merge
+commit with linkgit:git-show[1]. Note also that you can vie the full
+diff with the `-m` option.
+
 A 'combined diff' format looks like this:
 
 ------------

-- >8 --

Is there any way to get "git diff" to show combined-form besides an
index with conflicts? I couldn't convince it to show me a merge commit
beside its parents, since it doesn't have an equivalent to diff-tree's
--stdin option.

-Peff

[1] Reading over this, the whole section could use some editing. I think
this is another example that needs to be broken out into its own
user-visible manpage. That is, we have too much "if you use the -p
option to command X, or command Y by default, or command Z without
--raw, then you see this format". That's pretty dense. Instead command X
should have:

  -p::
  --stat::
  --summary::
  [etc]
    Generate diffs in this format. See "git help diff-formats" for
    details. The default format is "-p".

and then diff-format.txt should _just_ be a description of the diff
formats, without worrying about commands at all. And probably the text
above should be factored out as part of diff-options.txt. But that's all
part of a much bigger documentation architecture change that I am hoping
to get to eventually. For now, I think it's worth just tweaking this
text to stop being inaccurate.

  reply	other threads:[~2011-03-07 19:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-05  6:20 frustrated forensics: hard to find diff that undid a fix Adam Monsen
2011-03-05 10:00 ` Jonathan del Strother
2011-03-05 11:33 ` Jakub Narebski
2011-03-05 12:51   ` Jonathan Nieder
2011-03-05 13:48     ` Jeff King
2011-03-05 14:34   ` Adam Monsen
2011-03-05 19:56     ` [PATCH 0/2] improve combined diff documentation Adam Monsen
2011-03-05 19:56     ` [PATCH 1/2] documentation fix: git log -p does not imply -c Adam Monsen
2011-03-07  0:36       ` Junio C Hamano
2011-03-07 15:47         ` Jeff King
2011-03-07 18:37           ` Junio C Hamano
2011-03-07 19:12             ` Jeff King [this message]
2011-03-07 21:57               ` [PATCH v3] Documentation " Adam Monsen
2011-03-08  0:21                 ` Junio C Hamano
2011-03-08  0:49                   ` [PATCH v4] " Adam Monsen
2011-03-08 19:43                     ` Junio C Hamano
2011-03-08 20:46                       ` Adam Monsen
2011-03-09  0:58                         ` Junio C Hamano
2011-03-09 21:25                           ` Adam Monsen
2011-03-09 21:27                             ` [PATCH] SubmittingPatches: clean up commit message tips Adam Monsen
2011-03-09 22:20                               ` Junio C Hamano
2011-03-08 20:51                       ` [PATCH v5] diff format documentation: clarify --cc and -c Adam Monsen
2011-03-08 21:03                       ` [PATCH v6] " Adam Monsen
2011-03-08  1:19                   ` [PATCH v3] Documentation fix: git log -p does not imply -c Jeff King
2011-03-05 19:56     ` [PATCH 2/2] English grammar fixes for combined diff doc Adam Monsen
2011-03-05 14:29 ` frustrated forensics: hard to find diff that undid a fix Martin von Zweigbergk

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=20110307191218.GA20930@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=haircut@gmail.com \
    --cc=jnareb@gmail.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).