]> asedeno.scripts.mit.edu Git - git.git/commitdiff
diff A...B: do not limit the syntax too narrowly
authorJunio C Hamano <gitster@pobox.com>
Fri, 16 Jul 2010 19:08:24 +0000 (12:08 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Jul 2010 19:08:27 +0000 (12:08 -0700)
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.

builtin-diff.c

index 62b483bd5fa66e6828f18c9081157cfeb68a9a5f..192cbb212ea00102c838fc6c8af8b9eda9d05750 100644 (file)
@@ -406,19 +406,6 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
        else if (ents == 2)
                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,