{"thread":{"id":"26352","subject":"help understanding git diff output","startedAt":"2011-01-27T22:11:57Z","lastAt":"2011-01-27T23:23:22Z","messageCount":3,"participants":["Eugene Sajine","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"159960","messageId":"AANLkTi=H1LuGfQC8+u83So+6XyOqJxHJ3zsdgs4JTdkc@mail.gmail.com","threadId":"26352","inReplyTo":null,"subject":"help understanding git diff output","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2011-01-27T22:11:57Z","receivedAt":"2011-01-27T22:11:57Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"Hi,\n\nCould you please  help understanding the output of git diff.\n\nI have two branches with this type or relationship:\n\n0-a-b-c-d-e-f-g (branch1)\n\\a1-a2-a3-b-c-d1-d2-e-f1-f2-g (branch2)\n\nWhere commits a1,a2 and a3 as well as other numbered commits in\nbranch2 are the split version of their counterparts in branch1.\nThe the branch2 was created by creating the branch2 from branch one\nand rebased on 0 with few commits being cplit up during the rebase.\n\nI.e. the resulting state is the same for both branches.\n\nI get empty diff when i execute:\n\n$git diff branch1..branch2\n\nand i also get empty diff when running\n\n$git diff branch2..branch1\n\nWhat i cannot wrap my mind around is why the command below with\nsymmetric difference range gives me non-empty diff\n\n$git diff branch1...branch2\n\nPlease, advise\n\nThanks a lot,\nEugene\n"},{"id":"159962","messageId":"7vk4hqgd71.fsf@alter.siamese.dyndns.org","threadId":"26352","inReplyTo":"AANLkTi=H1LuGfQC8+u83So+6XyOqJxHJ3zsdgs4JTdkc@mail.gmail.com","subject":"Re: help understanding git diff output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-01-27T23:05:22Z","receivedAt":"2011-01-27T23:05:22Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eugene Sajine <euguess@gmail.com> writes:\n\n> I get empty diff when i execute:\n>\n> $git diff branch1..branch2\n>\n> and i also get empty diff when running\n>\n> $git diff branch2..branch1\n\nThe thing is, \"diff\" is about comparing \"two endpoints\".\n\nWe still do support, as a backward compatibility measure, the A..B\nnotation to help people who learned \"git diff\" from ancient documents, and\nwe don't plan to deprecate the notation in any way, but don't be fooled by\nthe notation which usually means \"the range from A to B\".  In the context\nof diff, it does not mean a range, as diff is about two \"endpoints\".\n\n> What i cannot wrap my mind around is why the command below with\n> symmetric difference range gives me non-empty diff\n>\n> $git diff branch1...branch2\n\n\"git diff A...B\" is a short-hand for \"git diff $(git merge-base A B) B\",\nnaming the fork point between branches A and B as one end, and B as the\nother end, of the diff.  Again, diff is about two \"endpoints\", and the\nnotation does not mean a symmetric difference range.\n"},{"id":"159963","messageId":"AANLkTimtHvn3uO2pf8+VWz_1VYediChRx9fdmVw_vVtU@mail.gmail.com","threadId":"26352","inReplyTo":"7vk4hqgd71.fsf@alter.siamese.dyndns.org","subject":"Re: help understanding git diff output","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2011-01-27T23:23:22Z","receivedAt":"2011-01-27T23:23:22Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"On Thu, Jan 27, 2011 at 6:05 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Eugene Sajine <euguess@gmail.com> writes:\n>\n>> I get empty diff when i execute:\n>>\n>> $git diff branch1..branch2\n>>\n>> and i also get empty diff when running\n>>\n>> $git diff branch2..branch1\n>\n> The thing is, \"diff\" is about comparing \"two endpoints\".\n>\n> We still do support, as a backward compatibility measure, the A..B\n> notation to help people who learned \"git diff\" from ancient documents, and\n> we don't plan to deprecate the notation in any way, but don't be fooled by\n> the notation which usually means \"the range from A to B\".  In the context\n> of diff, it does not mean a range, as diff is about two \"endpoints\".\n>\n>> What i cannot wrap my mind around is why the command below with\n>> symmetric difference range gives me non-empty diff\n>>\n>> $git diff branch1...branch2\n>\n> \"git diff A...B\" is a short-hand for \"git diff $(git merge-base A B) B\",\n> naming the fork point between branches A and B as one end, and B as the\n> other end, of the diff.  Again, diff is about two \"endpoints\", and the\n> notation does not mean a symmetric difference range.\n>\n>\n>\n\nThanks a lot, Junio. I was looking at the wrong place in the\ndocumentation. Skipped the part in diff doc explaining that range\nnotations are not exactly ranges for diff.\n\nThanks,\nEugene\n"}]}