git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: git@vger.kernel.org
Cc: Heikki Hokkanen <hoxu@users.sf.net>,
	Adam Simpkins <simpkins@facebook.com>,
	Thomas Rast <trast@student.ethz.ch>
Subject: [BUG] log -m --graph does not work
Date: Sun, 17 Oct 2010 15:29:40 -0500	[thread overview]
Message-ID: <20101017202940.GA4534@burratino> (raw)

"git log" can pass "-m" to the internal diff-tree helper, with
the handy result of multiple diffs for a merge, one against
each parent.  Unfortunately the graph pretty-printer doesn't
know what to do with the second diff:

 $ git log -m --graph --oneline --shortstat origin/pu
 *   2ee46ba (from a13ef41) Merge branch 'jh/notes-merge' into pu
 |\
 | |  17 files changed, 3367 insertions(+), 143 deletions(-)
 | |
 | |
 | |
 | |
 | |
[...]

Error out to avoid getting the user's hopes up (unless -c, --cc,
or --first-parent was supplied, since they work fine).

Noticed-by: Heikki Hokkanen <hoxu@users.sf.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
This patch breaks "git log --ancestry-path --graph -m -p" even in the
cases when it sort of works.  It's probably better to go straight to a
fix without this band-aid.

Hints?

 revision.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/revision.c b/revision.c
index b1c1890..80e0cdb 100644
--- a/revision.c
+++ b/revision.c
@@ -1681,6 +1681,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
 	if (revs->reflog_info && revs->graph)
 		die("cannot combine --walk-reflogs with --graph");
 
+	if (!revs->ignore_merges && revs->graph &&
+	    !revs->combine_merges && !revs->first_parent_only)
+		die("cannot combine -m with --graph");
+
 	return left;
 }
 
-- 
1.7.2.3

                 reply	other threads:[~2010-10-17 20:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20101017202940.GA4534@burratino \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=hoxu@users.sf.net \
    --cc=simpkins@facebook.com \
    --cc=trast@student.ethz.ch \
    /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).