{"thread":{"id":"31953","subject":"Strange behaviour of git diff branch1 ... branch2","startedAt":"2012-10-26T21:26:50Z","lastAt":"2012-11-12T17:46:51Z","messageCount":5,"participants":["Aaron Schrab","Nguyen Thai Ngoc Duy","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"201993","messageId":"20121026212650.GB2612@pug.qqx.org","threadId":"31953","inReplyTo":null,"subject":"Strange behaviour of git diff branch1 ... branch2","fromName":"Aaron Schrab","fromEmail":"aaron@schrab.com","sentAt":"2012-10-26T21:26:50Z","receivedAt":"2012-10-26T21:26:50Z","isPatch":false,"sender":{"key":"aaron@schrab.com","avatar":"https://avatars.githubusercontent.com/u/39620?v=4"},"body":"I came across this odd question on stackoverflow:\n\thttp://stackoverflow.com/q/13092854/1507392\n\n\nIf git diff is run with \"...\" as a separate argument between two \ncommit-ish arguments causes it to produce strange output.  The \ndifferences seem to be the same as if \"...\" was left out, but change \nlines begin with 4 + or - characters rather than just 1.\n\nCan anybody explain what is happening here?  I don't have any reason to \nwant to use that form myself, but I'm very curious about why it produces \nthis odd output.\n\nThanks.\n"},{"id":"201997","messageId":"CACsJy8CX4Wbf3Bqez2kcQ7NGYMkqXC8MK+=hrH4iaev+0ZrQ8Q@mail.gmail.com","threadId":"31953","inReplyTo":"20121026212650.GB2612@pug.qqx.org","subject":"Re: Strange behaviour of git diff branch1 ... branch2","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-10-27T03:51:12Z","receivedAt":"2012-10-27T03:51:12Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Oct 27, 2012 at 4:26 AM, Aaron Schrab <aaron@schrab.com> wrote:\n> I came across this odd question on stackoverflow:\n>         http://stackoverflow.com/q/13092854/1507392\n>\n>\n> If git diff is run with \"...\" as a separate argument between two commit-ish\n> arguments causes it to produce strange output.  The differences seem to be\n> the same as if \"...\" was left out, but change lines begin with 4 + or -\n> characters rather than just 1.\n>\n> Can anybody explain what is happening here?  I don't have any reason to want\n> to use that form myself, but I'm very curious about why it produces this odd\n> output.\n\nI'm curious too. It shows this to me\n\ndiff --cc .gitignore\nindex a188a82,a188a82,a188a82,a188a82..d4473d8\n--- a/.gitignore\n+++ b/.gitignore\n@@@@@ -2,9 -2,9 -2,9 -2,9 +2,6 @@@@@\n    /GIT-CFLAGS\n    /GIT-LDFLAGS\n    /GIT-GUI-VARS\n----/GIT-PREFIX\n----/GIT-SCRIPT-DEFINES\n----/GIT-USER-AGENT\n    /GIT-VERSION-FILE\n    /bin-wrappers/\n    /git\n\nNotice the --cc in the first line, which is combined diff. Usually\ncombined-diff is between two points and one parent. Though somehow git\npasses 4 parents down combined-diff.c:show_combined_header, as you can\nsee in the \"index\" line. I think we should fix rev parsing code as it\ndoes not make sense to pass 4 identical parents this way.\n-- \nDuy\n"},{"id":"202006","messageId":"4ecbe65e-4b56-4a49-96c3-1ea8b3f0c473@email.android.com","threadId":"31953","inReplyTo":"CACsJy8CX4Wbf3Bqez2kcQ7NGYMkqXC8MK+=hrH4iaev+0ZrQ8Q@mail.gmail.com","subject":"Re: Strange behaviour of git diff branch1 ... branch2","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-27T12:33:01Z","receivedAt":"2012-10-27T12:33:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\n\nNguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n>\n>Notice the --cc in the first line, which is combined diff. Usually\n>combined-diff is between two points and one parent. Though somehow git\n>passes 4 parents down combined-diff.c:show_combined_header, as you can\n>see in the \"index\" line. I think we should fix rev parsing code as it\n>does not make sense to pass 4 identical parents this way.\n\nThe two heads home from HEAD...HEAD the user has on the command line.\n\nThe user is getting exactly what she asked; there is nothing to fix.\n"},{"id":"202008","messageId":"CACsJy8BkKRxp9AQW0M0vDSL8Mb16VGSrZ1OnQpwCrERWKVLSyA@mail.gmail.com","threadId":"31953","inReplyTo":"4ecbe65e-4b56-4a49-96c3-1ea8b3f0c473@email.android.com","subject":"Re: Strange behaviour of git diff branch1 ... branch2","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-10-27T13:32:46Z","receivedAt":"2012-10-27T13:32:46Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Oct 27, 2012 at 7:33 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n>\n> Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n>>\n>>Notice the --cc in the first line, which is combined diff. Usually\n>>combined-diff is between two points and one parent. Though somehow git\n>>passes 4 parents down combined-diff.c:show_combined_header, as you can\n>>see in the \"index\" line. I think we should fix rev parsing code as it\n>>does not make sense to pass 4 identical parents this way.\n>\n> The two heads home from HEAD...HEAD the user has on the command line.\n>\n> The user is getting exactly what she asked; there is nothing to fix.\n\nIs there any use case where HEAD...HEAD (or \"...\" alone) is actually useful?\n\nI have re-read the git-diff man page and I don't think it explains\n\"git diff foo ... bar\" syntax (from a user's point of view, not a git\nguru's). We could improve the documentation if \"git diff foo ... bar\"\nis useful, or reject it with an error to avoid confusion.\n-- \nDuy\n"},{"id":"202978","messageId":"7vbof2iuic.fsf@alter.siamese.dyndns.org","threadId":"31953","inReplyTo":"CACsJy8BkKRxp9AQW0M0vDSL8Mb16VGSrZ1OnQpwCrERWKVLSyA@mail.gmail.com","subject":"Re: Strange behaviour of git diff branch1 ... branch2","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-11-12T17:46:51Z","receivedAt":"2012-11-12T17:46:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n\n> On Sat, Oct 27, 2012 at 7:33 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>>\n>> Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:\n>>>\n>>>Notice the --cc in the first line, which is combined diff. Usually\n>>>combined-diff is between two points and one parent. Though somehow git\n>>>passes 4 parents down combined-diff.c:show_combined_header, as you can\n>>>see in the \"index\" line. I think we should fix rev parsing code as it\n>>>does not make sense to pass 4 identical parents this way.\n>>\n>> The two heads home from HEAD...HEAD the user has on the command line.\n>>\n>> The user is getting exactly what she asked; there is nothing to fix.\n>\n> Is there any use case where HEAD...HEAD (or \"...\" alone) is actually useful?\n\nThat is an invalid question, implying a proposal that will introduce\nmore confusion to the users while hurting the code.\n\nThere is no use case where \"cat A >>A\" is actually useful, either,\nbut it does not mean \"cat A >>A\" should be special cased to do\nsomething different from what it happens to do in line with the case\nwhere \"cat A >>B\" does.  I think \"diff ...\" or \"diff HEAD...HEAD\"\nare the same as that example.\n"}]}