{"thread":{"id":"43923","subject":"diff <commit> using 3-dot behavior","startedAt":"2016-08-24T14:28:33Z","lastAt":"2016-08-24T21:47:09Z","messageCount":6,"participants":["Robert Dailey","Michael J Gruber","Junio C Hamano","Jacob Keller","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"300050","messageId":"CAHd499DL2WiTgnk5A--qihUh-jF9m7aXDzHAQuW=bLRVW4Bniw@mail.gmail.com","threadId":"43923","inReplyTo":null,"subject":"diff <commit> using 3-dot behavior","fromName":"Robert Dailey","fromEmail":"rcdailey.lists@gmail.com","sentAt":"2016-08-24T14:28:24Z","receivedAt":"2016-08-24T14:28:33Z","isPatch":false,"sender":{"key":"rcdailey.lists@gmail.com","avatar":null},"body":"I want to view the complete diff of my branch (topic) relative to its\nparent branch (master). This should include cached/staged files and\nunstaged working tree changes.\n\nIf I do this:\n\n$ git diff master\n\nThis will include changes on master *since* my last merge, which I do\nnot want (I don't want to see changes on master, only on topic). I\ntried this:\n\n$ git diff master --not master\n\nThis didn't give me any output. If I do this:\n\n$ git diff master...topic\n\nThis shows me only committed changes on topic, but excludes staged &\nunstaged changes.\n\nHow can I get the results I want?\n"},{"id":"300066","messageId":"9efbdfbb-4c82-1355-1f89-5edca7135179@drmicha.warpmail.net","threadId":"43923","inReplyTo":"CAHd499DL2WiTgnk5A--qihUh-jF9m7aXDzHAQuW=bLRVW4Bniw@mail.gmail.com","subject":"Re: diff <commit> using 3-dot behavior","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2016-08-24T16:00:11Z","receivedAt":"2016-08-24T16:00:20Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Robert Dailey venit, vidit, dixit 24.08.2016 16:28:\n> I want to view the complete diff of my branch (topic) relative to its\n> parent branch (master). This should include cached/staged files and\n> unstaged working tree changes.\n> \n> If I do this:\n> \n> $ git diff master\n> \n> This will include changes on master *since* my last merge, which I do\n> not want (I don't want to see changes on master, only on topic). I\n> tried this:\n> \n> $ git diff master --not master\n> \n> This didn't give me any output. If I do this:\n> \n> $ git diff master...topic\n> \n> This shows me only committed changes on topic, but excludes staged &\n> unstaged changes.\n> \n> How can I get the results I want?\n\nThe 3-dot notation means:\n\nShow the difference between the merge-base of master and topic, and topic.\n\nI'm not completely sure, but I guess what you want is:\n\nShow the difference between the merge-base of master and topic, and the\nworktree.\n\nYou can accomplish this with:\n\ngit diff $(git merge-base master topic)\n\nI guess a shorter notation for that could come in handy. OTOH, I usually\ndiff against HEAD in a situation like that.\n\nCheers,\nMichael\n"},{"id":"300069","messageId":"CAHd499DTkxAmLhEyGc4t+g1gFBnJpVRwgS5dhRRE=E+pUU5WDg@mail.gmail.com","threadId":"43923","inReplyTo":"9efbdfbb-4c82-1355-1f89-5edca7135179@drmicha.warpmail.net","subject":"Re: diff <commit> using 3-dot behavior","fromName":"Robert Dailey","fromEmail":"rcdailey.lists@gmail.com","sentAt":"2016-08-24T16:10:56Z","receivedAt":"2016-08-24T16:11:02Z","isPatch":false,"sender":{"key":"rcdailey.lists@gmail.com","avatar":null},"body":"On Wed, Aug 24, 2016 at 11:00 AM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> The 3-dot notation means:\n>\n> Show the difference between the merge-base of master and topic, and topic.\n>\n> I'm not completely sure, but I guess what you want is:\n>\n> Show the difference between the merge-base of master and topic, and the\n> worktree.\n>\n> You can accomplish this with:\n>\n> git diff $(git merge-base master topic)\n>\n> I guess a shorter notation for that could come in handy. OTOH, I usually\n> diff against HEAD in a situation like that.\n\nGreat solution. I feel silly now, the answer ended up being rather\nobvious. I can create an alias for that. But I can't diff against HEAD\nbecause then I am not seeing a diff of changes already committed.\nThanks for your help.\n"},{"id":"300072","messageId":"xmqqbn0irvan.fsf@gitster.mtv.corp.google.com","threadId":"43923","inReplyTo":"CAHd499DL2WiTgnk5A--qihUh-jF9m7aXDzHAQuW=bLRVW4Bniw@mail.gmail.com","subject":"Re: diff <commit> using 3-dot behavior","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-08-24T16:22:40Z","receivedAt":"2016-08-24T16:24:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robert Dailey <rcdailey.lists@gmail.com> writes:\n\n> $ git diff master...topic\n\n... which is defined roughly as\n\n\tgit diff $(git merge-base master topic) topic\n\nThe merge-base is to compute the point you forked your topic from\nthe mainline.  So if you want to compare your current state in the\nindex with the fork point, you'd do\n\n\tgit diff --cached $(git merge-base master topic)\n\nand comparing your working tree state would be\n\n\tgit diff --cached $(git merge-base master topic)\n\n"},{"id":"300112","messageId":"CA+P7+xpv--eA8rdgwGLRCucSpVD5X9LjiN3_3Oo9o4L0t5Uk9Q@mail.gmail.com","threadId":"43923","inReplyTo":"xmqqbn0irvan.fsf@gitster.mtv.corp.google.com","subject":"Re: diff <commit> using 3-dot behavior","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2016-08-24T20:48:30Z","receivedAt":"2016-08-24T20:50:13Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Wed, Aug 24, 2016 at 9:22 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> The merge-base is to compute the point you forked your topic from\n> the mainline.  So if you want to compare your current state in the\n> index with the fork point, you'd do\n>\n>         git diff --cached $(git merge-base master topic)\n>\n> and comparing your working tree state would be\n>\n>         git diff --cached $(git merge-base master topic)\n>\n\nThose are both identical?\n\nThanks,\nJake\n"},{"id":"300121","messageId":"20160824213934.vyfikgj5cccku57z@sigill.intra.peff.net","threadId":"43923","inReplyTo":"CA+P7+xpv--eA8rdgwGLRCucSpVD5X9LjiN3_3Oo9o4L0t5Uk9Q@mail.gmail.com","subject":"Re: diff <commit> using 3-dot behavior","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-08-24T21:39:34Z","receivedAt":"2016-08-24T21:47:09Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Aug 24, 2016 at 01:48:30PM -0700, Jacob Keller wrote:\n\n> On Wed, Aug 24, 2016 at 9:22 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> > The merge-base is to compute the point you forked your topic from\n> > the mainline.  So if you want to compare your current state in the\n> > index with the fork point, you'd do\n> >\n> >         git diff --cached $(git merge-base master topic)\n> >\n> > and comparing your working tree state would be\n> >\n> >         git diff --cached $(git merge-base master topic)\n> >\n> \n> Those are both identical?\n\nI imagine the second one just meant to drop \"--cached\".\n\n-Peff\n"}]}