git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH] diff A...B: do not limit the syntax too narrowly
Date: Fri, 16 Jul 2010 12:14:53 -0700	[thread overview]
Message-ID: <7vsk3js0gi.fsf@alter.siamese.dyndns.org> (raw)

Earlier we tried to make sure that the trees we get are what A...B
syntax produced, by checking that earlier ones are all marked
uninteresting (which has to be true as they are merge bases),
there are two remaining ones that are interesting, and they are
marked as non-symmetric-left and symmetric-left respectively.

The "the last two must be interesting" condition is however wrong when one
is an ancestor of the other between A and B (i.e. fast-forward).  In such
a case, one of them is marked uninteresting.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 * This breakage should have been obvious (e.g. "git diff master...next"
   should exhibit it).  Sorry about it.

   Also "the second from the last one should not be SYMMETRIC_LEFT"
   condition does not hold if somebody does "git diff HEAD...HEAD", but
   that is a bit of borderline insanity.

   We *could* tighten the rule to say "the last two must be interesting or
   listed as one of the merge bases" to tighten the rule again, but I
   don't think it is worth it.

 builtin-diff.c |   13 -------------
 1 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/builtin-diff.c b/builtin-diff.c
index 62b483b..192cbb2 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -407,19 +407,6 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 		result = builtin_diff_tree(&rev, argc, argv, ent);
 	else if (ent[0].item->flags & UNINTERESTING) {
 		/*
-		 * Perhaps the user gave us A...B, which expands
-		 * to a list of negative merge bases followed by
-		 * A (symmetric-left) and B?  Let's make sure...
-		 */
-		for (i = 1; i < ents; i++)
-			if (!(ent[i].item->flags & UNINTERESTING))
-				break;
-		if (ents != i + 2 ||
-		    (ent[i+1].item->flags & UNINTERESTING) ||
-		    (!(ent[i].item->flags & SYMMETRIC_LEFT)) ||
-		    (ent[i+1].item->flags & SYMMETRIC_LEFT))
-			die("what do you mean by that?");
-		/*
 		 * diff A...B where there is at least one merge base
 		 * between A and B.  We have ent[0] == merge-base,
 		 * ent[ents-2] == A, and ent[ents-1] == B.  Show diff
-- 
1.7.2.rc3.255.g7a7d8

                 reply	other threads:[~2010-07-16 19:15 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=7vsk3js0gi.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    /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).