* command to show diff of a commit
@ 2005-09-22 9:58 Robert Watson
2005-09-22 10:04 ` Petr Baudis
2005-09-22 15:20 ` Linus Torvalds
0 siblings, 2 replies; 6+ messages in thread
From: Robert Watson @ 2005-09-22 9:58 UTC (permalink / raw)
To: git
Hi,
I am wondering what is the best way to show the change introduced by a
commit. In the other words, is there a better way to do this:
git-diff b163512d4eb36ee946908b682c7863658c5a8db4^
b163512d4eb36ee946908b682c7863658c5a8db4
Thanks.
Robertoo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: command to show diff of a commit
2005-09-22 9:58 command to show diff of a commit Robert Watson
@ 2005-09-22 10:04 ` Petr Baudis
2005-09-22 14:25 ` Robert Watson
2005-09-22 15:20 ` Linus Torvalds
1 sibling, 1 reply; 6+ messages in thread
From: Petr Baudis @ 2005-09-22 10:04 UTC (permalink / raw)
To: Robert Watson; +Cc: git
Dear diary, on Thu, Sep 22, 2005 at 11:58:32AM CEST, I got a letter
where Robert Watson <robert.oo.watson@gmail.com> told me that...
> Hi,
Hi,
> I am wondering what is the best way to show the change introduced by a
> commit. In the other words, is there a better way to do this:
>
> git-diff b163512d4eb36ee946908b682c7863658c5a8db4^
> b163512d4eb36ee946908b682c7863658c5a8db4
with Cogito, you would say
cg-diff -p -r b163512d4eb36ee946908b682c7863658c5a8db4
to see the diff against its parent. (You should still choose the parent
manually in case of merge commits.)
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: command to show diff of a commit
2005-09-22 10:04 ` Petr Baudis
@ 2005-09-22 14:25 ` Robert Watson
2005-09-22 14:33 ` Sven Verdoolaege
0 siblings, 1 reply; 6+ messages in thread
From: Robert Watson @ 2005-09-22 14:25 UTC (permalink / raw)
To: git
On 9/22/05, Petr Baudis <pasky@suse.cz> wrote:
> Dear diary, on Thu, Sep 22, 2005 at 11:58:32AM CEST, I got a letter
> where Robert Watson <robert.oo.watson@gmail.com> told me that...
> > Hi,
>
> Hi,
>
> > I am wondering what is the best way to show the change introduced by a
> > commit. In the other words, is there a better way to do this:
> >
> > git-diff b163512d4eb36ee946908b682c7863658c5a8db4^
> > b163512d4eb36ee946908b682c7863658c5a8db4
>
> with Cogito, you would say
>
> cg-diff -p -r b163512d4eb36ee946908b682c7863658c5a8db4
>
> to see the diff against its parent. (You should still choose the parent
> manually in case of merge commits.)
>
Thanks, it is nice to know that cogito can go it. But can I achieve
the same with git-core only?
Thanks,
Robertoo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: command to show diff of a commit
2005-09-22 14:25 ` Robert Watson
@ 2005-09-22 14:33 ` Sven Verdoolaege
0 siblings, 0 replies; 6+ messages in thread
From: Sven Verdoolaege @ 2005-09-22 14:33 UTC (permalink / raw)
To: Robert Watson; +Cc: git
On Thu, Sep 22, 2005 at 03:25:01PM +0100, Robert Watson wrote:
> On 9/22/05, Petr Baudis <pasky@suse.cz> wrote:
> > Dear diary, on Thu, Sep 22, 2005 at 11:58:32AM CEST, I got a letter
> > > I am wondering what is the best way to show the change introduced by a
> > > commit. In the other words, is there a better way to do this:
> > >
> > > git-diff b163512d4eb36ee946908b682c7863658c5a8db4^
> > > b163512d4eb36ee946908b682c7863658c5a8db4
> >
> Thanks, it is nice to know that cogito can go it. But can I achieve
> the same with git-core only?
>
I suppose this is slightly shorter:
git-whatchanged --max-count=1 -p b163512d4eb36ee946908b682c7863658c5a8db4
skimo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: command to show diff of a commit
2005-09-22 9:58 command to show diff of a commit Robert Watson
2005-09-22 10:04 ` Petr Baudis
@ 2005-09-22 15:20 ` Linus Torvalds
2005-09-23 10:06 ` Robert Watson
1 sibling, 1 reply; 6+ messages in thread
From: Linus Torvalds @ 2005-09-22 15:20 UTC (permalink / raw)
To: Robert Watson; +Cc: git
On Thu, 22 Sep 2005, Robert Watson wrote:
>
> I am wondering what is the best way to show the change introduced by a
> commit. In the other words, is there a better way to do this:
>
> git-diff b163512d4eb36ee946908b682c7863658c5a8db4^
> b163512d4eb36ee946908b682c7863658c5a8db4
Oh, absolutely.
Do
git-diff-tree -p --pretty b163512d4eb36ee946908b682c7863658c5a8db4
and you're done.
If you _just_ want the diff (and not the message), skip the "--pretty".
Linus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: command to show diff of a commit
2005-09-22 15:20 ` Linus Torvalds
@ 2005-09-23 10:06 ` Robert Watson
0 siblings, 0 replies; 6+ messages in thread
From: Robert Watson @ 2005-09-23 10:06 UTC (permalink / raw)
To: Linus Torvalds; +Cc: git, Junio C Hamano
On 9/22/05, Linus Torvalds <torvalds@osdl.org> wrote:
>
>
> On Thu, 22 Sep 2005, Robert Watson wrote:
> >
> > I am wondering what is the best way to show the change introduced by a
> > commit. In the other words, is there a better way to do this:
> >
> > git-diff b163512d4eb36ee946908b682c7863658c5a8db4^
> > b163512d4eb36ee946908b682c7863658c5a8db4
>
> Oh, absolutely.
>
> Do
>
> git-diff-tree -p --pretty b163512d4eb36ee946908b682c7863658c5a8db4
>
> and you're done.
>
> If you _just_ want the diff (and not the message), skip the "--pretty".
>
> Linus
>
Many thanks. I know there must be a way to do this.
Here is a patch to make the document a bit clearer.
Regards,
Robertoo
diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt
--- a/Documentation/git-diff-tree.txt
+++ b/Documentation/git-diff-tree.txt
@@ -9,12 +9,15 @@ git-diff-tree - Compares the content and
SYNOPSIS
--------
-'git-diff-tree' [--stdin] [-m] [-s] [-v] [--pretty] [-t] [<common
diff options>] <tree-ish> <tree-ish> [<path>...]
+'git-diff-tree' [--stdin] [-m] [-s] [-v] [--pretty] [-t] [<common
diff options>] <tree-ish> [<tree-ish>] [<path>...]
DESCRIPTION
-----------
Compares the content and mode of the blobs found via two tree objects.
+If there is only one <tree-ish> given, the commit is compared with its parents
+(see --stdin below).
+
Note that "git-diff-tree" can use the tree encapsulated in a commit object.
OPTIONS
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-09-23 10:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-22 9:58 command to show diff of a commit Robert Watson
2005-09-22 10:04 ` Petr Baudis
2005-09-22 14:25 ` Robert Watson
2005-09-22 14:33 ` Sven Verdoolaege
2005-09-22 15:20 ` Linus Torvalds
2005-09-23 10:06 ` Robert Watson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).