{"thread":{"id":"24418","subject":"[PATCH] diff A...B: do not limit the syntax too narrowly","startedAt":"2010-07-16T19:14:53Z","lastAt":"2010-07-16T19:14:53Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"145704","messageId":"7vsk3js0gi.fsf@alter.siamese.dyndns.org","threadId":"24418","inReplyTo":null,"subject":"[PATCH] diff A...B: do not limit the syntax too narrowly","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-16T19:14:53Z","receivedAt":"2010-07-16T19:14:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Earlier we tried to make sure that the trees we get are what A...B\nsyntax produced, by checking that earlier ones are all marked\nuninteresting (which has to be true as they are merge bases),\nthere are two remaining ones that are interesting, and they are\nmarked as non-symmetric-left and symmetric-left respectively.\n\nThe \"the last two must be interesting\" condition is however wrong when one\nis an ancestor of the other between A and B (i.e. fast-forward).  In such\na case, one of them is marked uninteresting.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * This breakage should have been obvious (e.g. \"git diff master...next\"\n   should exhibit it).  Sorry about it.\n\n   Also \"the second from the last one should not be SYMMETRIC_LEFT\"\n   condition does not hold if somebody does \"git diff HEAD...HEAD\", but\n   that is a bit of borderline insanity.\n\n   We *could* tighten the rule to say \"the last two must be interesting or\n   listed as one of the merge bases\" to tighten the rule again, but I\n   don't think it is worth it.\n\n builtin-diff.c |   13 -------------\n 1 files changed, 0 insertions(+), 13 deletions(-)\n\ndiff --git a/builtin-diff.c b/builtin-diff.c\nindex 62b483b..192cbb2 100644\n--- a/builtin-diff.c\n+++ b/builtin-diff.c\n@@ -407,19 +407,6 @@ int cmd_diff(int argc, const char **argv, const char *prefix)\n \t\tresult = builtin_diff_tree(&rev, argc, argv, ent);\n \telse if (ent[0].item->flags & UNINTERESTING) {\n \t\t/*\n-\t\t * Perhaps the user gave us A...B, which expands\n-\t\t * to a list of negative merge bases followed by\n-\t\t * A (symmetric-left) and B?  Let's make sure...\n-\t\t */\n-\t\tfor (i = 1; i < ents; i++)\n-\t\t\tif (!(ent[i].item->flags & UNINTERESTING))\n-\t\t\t\tbreak;\n-\t\tif (ents != i + 2 ||\n-\t\t    (ent[i+1].item->flags & UNINTERESTING) ||\n-\t\t    (!(ent[i].item->flags & SYMMETRIC_LEFT)) ||\n-\t\t    (ent[i+1].item->flags & SYMMETRIC_LEFT))\n-\t\t\tdie(\"what do you mean by that?\");\n-\t\t/*\n \t\t * diff A...B where there is at least one merge base\n \t\t * between A and B.  We have ent[0] == merge-base,\n \t\t * ent[ents-2] == A, and ent[ents-1] == B.  Show diff\n-- \n1.7.2.rc3.255.g7a7d8\n"}]}