{"thread":{"id":"1907","subject":"command to show diff of a commit","startedAt":"2005-09-22T09:58:32Z","lastAt":"2005-09-23T10:06:04Z","messageCount":6,"participants":["Robert Watson","Petr Baudis","Sven Verdoolaege","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"9095","messageId":"72499e3b05092202583f9a751d@mail.gmail.com","threadId":"1907","inReplyTo":null,"subject":"command to show diff of a commit","fromName":"Robert Watson","fromEmail":"robert.oo.watson@gmail.com","sentAt":"2005-09-22T09:58:32Z","receivedAt":"2005-09-22T09:58:32Z","isPatch":false,"sender":{"key":"robert.oo.watson@gmail.com","avatar":null},"body":"Hi,\n\nI am wondering what is the best way to show the change introduced by a\ncommit. In the other words, is there a better way to do this:\n\ngit-diff b163512d4eb36ee946908b682c7863658c5a8db4^\nb163512d4eb36ee946908b682c7863658c5a8db4\n\nThanks.\nRobertoo\n"},{"id":"9098","messageId":"20050922100458.GF21019@pasky.or.cz","threadId":"1907","inReplyTo":"72499e3b05092202583f9a751d@mail.gmail.com","subject":"Re: command to show diff of a commit","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-09-22T10:04:58Z","receivedAt":"2005-09-22T10:04:58Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Thu, Sep 22, 2005 at 11:58:32AM CEST, I got a letter\nwhere Robert Watson <robert.oo.watson@gmail.com> told me that...\n> Hi,\n\nHi,\n\n> I am wondering what is the best way to show the change introduced by a\n> commit. In the other words, is there a better way to do this:\n> \n> git-diff b163512d4eb36ee946908b682c7863658c5a8db4^\n> b163512d4eb36ee946908b682c7863658c5a8db4\n\nwith Cogito, you would say\n\n\tcg-diff -p -r b163512d4eb36ee946908b682c7863658c5a8db4\n\nto see the diff against its parent. (You should still choose the parent\nmanually in case of merge commits.)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"},{"id":"9112","messageId":"72499e3b0509220725a52fef8@mail.gmail.com","threadId":"1907","inReplyTo":"20050922100458.GF21019@pasky.or.cz","subject":"Re: command to show diff of a commit","fromName":"Robert Watson","fromEmail":"robert.oo.watson@gmail.com","sentAt":"2005-09-22T14:25:01Z","receivedAt":"2005-09-22T14:25:01Z","isPatch":false,"sender":{"key":"robert.oo.watson@gmail.com","avatar":null},"body":"On 9/22/05, Petr Baudis <pasky@suse.cz> wrote:\n> Dear diary, on Thu, Sep 22, 2005 at 11:58:32AM CEST, I got a letter\n> where Robert Watson <robert.oo.watson@gmail.com> told me that...\n> > Hi,\n>\n> Hi,\n>\n> > I am wondering what is the best way to show the change introduced by a\n> > commit. In the other words, is there a better way to do this:\n> >\n> > git-diff b163512d4eb36ee946908b682c7863658c5a8db4^\n> > b163512d4eb36ee946908b682c7863658c5a8db4\n>\n> with Cogito, you would say\n>\n>         cg-diff -p -r b163512d4eb36ee946908b682c7863658c5a8db4\n>\n> to see the diff against its parent. (You should still choose the parent\n> manually in case of merge commits.)\n>\n\nThanks, it is nice to know that cogito can go it.  But can I achieve\nthe same with git-core only?\n\nThanks,\nRobertoo\n"},{"id":"9113","messageId":"20050922143346.GZ15165MdfPADPa@greensroom.kotnet.org","threadId":"1907","inReplyTo":"72499e3b0509220725a52fef8@mail.gmail.com","subject":"Re: command to show diff of a commit","fromName":"Sven Verdoolaege","fromEmail":"skimo@kotnet.org","sentAt":"2005-09-22T14:33:46Z","receivedAt":"2005-09-22T14:33:46Z","isPatch":false,"sender":{"key":"skimo@kotnet.org","avatar":null},"body":"On Thu, Sep 22, 2005 at 03:25:01PM +0100, Robert Watson wrote:\n> On 9/22/05, Petr Baudis <pasky@suse.cz> wrote:\n> > Dear diary, on Thu, Sep 22, 2005 at 11:58:32AM CEST, I got a letter\n> > > I am wondering what is the best way to show the change introduced by a\n> > > commit. In the other words, is there a better way to do this:\n> > >\n> > > git-diff b163512d4eb36ee946908b682c7863658c5a8db4^\n> > > b163512d4eb36ee946908b682c7863658c5a8db4\n> >\n> Thanks, it is nice to know that cogito can go it.  But can I achieve\n> the same with git-core only?\n> \n\nI suppose this is slightly shorter:\n\ngit-whatchanged --max-count=1 -p b163512d4eb36ee946908b682c7863658c5a8db4\n\nskimo\n"},{"id":"9119","messageId":"Pine.LNX.4.58.0509220820011.2553@g5.osdl.org","threadId":"1907","inReplyTo":"72499e3b05092202583f9a751d@mail.gmail.com","subject":"Re: command to show diff of a commit","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-09-22T15:20:51Z","receivedAt":"2005-09-22T15:20:51Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 22 Sep 2005, Robert Watson wrote:\n> \n> I am wondering what is the best way to show the change introduced by a\n> commit. In the other words, is there a better way to do this:\n> \n> git-diff b163512d4eb36ee946908b682c7863658c5a8db4^\n> b163512d4eb36ee946908b682c7863658c5a8db4\n\nOh, absolutely.\n\nDo\n\n\tgit-diff-tree -p --pretty b163512d4eb36ee946908b682c7863658c5a8db4\n\nand you're done.\n\nIf you _just_ want the diff (and not the message), skip the \"--pretty\".\n\n\t\tLinus\n"},{"id":"9168","messageId":"72499e3b05092303062a466e37@mail.gmail.com","threadId":"1907","inReplyTo":"Pine.LNX.4.58.0509220820011.2553@g5.osdl.org","subject":"Re: command to show diff of a commit","fromName":"Robert Watson","fromEmail":"robert.oo.watson@gmail.com","sentAt":"2005-09-23T10:06:04Z","receivedAt":"2005-09-23T10:06:04Z","isPatch":false,"sender":{"key":"robert.oo.watson@gmail.com","avatar":null},"body":"On 9/22/05, Linus Torvalds <torvalds@osdl.org> wrote:\n>\n>\n> On Thu, 22 Sep 2005, Robert Watson wrote:\n> >\n> > I am wondering what is the best way to show the change introduced by a\n> > commit. In the other words, is there a better way to do this:\n> >\n> > git-diff b163512d4eb36ee946908b682c7863658c5a8db4^\n> > b163512d4eb36ee946908b682c7863658c5a8db4\n>\n> Oh, absolutely.\n>\n> Do\n>\n>         git-diff-tree -p --pretty b163512d4eb36ee946908b682c7863658c5a8db4\n>\n> and you're done.\n>\n> If you _just_ want the diff (and not the message), skip the \"--pretty\".\n>\n>                 Linus\n>\n\nMany thanks.  I know there must be a way to do this.\n\nHere is a patch to make the document a bit clearer.\n\nRegards,\nRobertoo\n\ndiff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt\n--- a/Documentation/git-diff-tree.txt\n+++ b/Documentation/git-diff-tree.txt\n@@ -9,12 +9,15 @@ git-diff-tree - Compares the content and\n\n SYNOPSIS\n --------\n-'git-diff-tree' [--stdin] [-m] [-s] [-v] [--pretty] [-t] [<common\ndiff options>] <tree-ish> <tree-ish> [<path>...]\n+'git-diff-tree' [--stdin] [-m] [-s] [-v] [--pretty] [-t] [<common\ndiff options>] <tree-ish> [<tree-ish>] [<path>...]\n\n DESCRIPTION\n -----------\n Compares the content and mode of the blobs found via two tree objects.\n\n+If there is only one <tree-ish> given, the commit is compared with its parents\n+(see --stdin below).\n+\n Note that \"git-diff-tree\" can use the tree encapsulated in a commit object.\n\n OPTIONS\n"}]}