git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: command to show diff of a commit

From
RWRobert Watson <robert.oo.watson@gmail.com>
Date
Sep 23, 2005, 10:06 UTC
Message-ID
<72499e3b05092303062a466e37@mail.gmail.com>
In-Reply-To
<Pine.LNX.4.58.0509220820011.2553@g5.osdl.org>
On 9/22/05, Linus Torvalds <torvalds@osdl.org> wrote:
Show 22 quoted lines
>
>
> 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
Previous: Linus Torvalds
Message 6 of 6 in “command to show diff of a commit”
  1. Robert WatsonSep 22, 2005
  2. Petr BaudisSep 22, 2005
  3. Robert WatsonSep 22, 2005
  4. Sven VerdoolaegeSep 22, 2005
  5. Linus TorvaldsSep 22, 2005
  6. Robert WatsonSep 23, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.