# Output from git diff-tree (documentation)

8 messages from 2009-07-27 to 2009-07-30. Participants: David Kågedal, Junio C Hamano, Pat Notz.
Thread: https://gitlist.dev/t/20250

## David Kågedal, 2009-07-27 19:54

Subject: Output from git diff-tree (documentation)
Message-ID: <87hbwxaolw.fsf@krank.kagedal.org>
URL: https://gitlist.dev/e/87hbwxaolw.fsf%40krank.kagedal.org

```
The "git diff-tree HEAD" command (with the default raw output) starts
by printing a hash, which seems to be the hash for the commit (HEAD in
this case).

I can't find any description of this in the documentation for
diff-tree.

The "output format" sectionis the generic diff-format.txt that
describes the format of the lines for the files that differ. Nothing
wrong with that, but it doesn't explain the initial line of diff-tree.

The documentation of the --stdin flag mentions some initial output,
but that is not relevant in this case.

-- 
David Kågedal

```

## Junio C Hamano, 2009-07-27 21:03

Subject: Re: Output from git diff-tree (documentation)
Message-ID: <7vbpn5g7og.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vbpn5g7og.fsf%40alter.siamese.dyndns.org
In-Reply-To: <87hbwxaolw.fsf@krank.kagedal.org>

```
David Kågedal <davidk@lysator.liu.se> writes:

> The "git diff-tree HEAD" command (with the default raw output) starts
> by printing a hash, which seems to be the hash for the commit (HEAD in
> this case).

That was because "git diff-tree" was the historical workhorse of "git
log".  The latter literally was "rev-list HEAD | git diff-tree --stdin".

Giving a commit on the command line and giving one from the stdin was made
consistent.  IOW, "rev-list HEAD | xargs -n1 git diff-tree" would give you
a similar output.

```

## Junio C Hamano, 2009-07-28 20:34

Subject: Re: [PATCH] Update the documentation of the raw diff output format
Message-ID: <7vhbww5yxb.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vhbww5yxb.fsf%40alter.siamese.dyndns.org
In-Reply-To: <87prbl8ay5.fsf_-_@krank.kagedal.org>

```
Looks reasonable; thanks.

```

## David Kågedal, 2009-07-29 06:11

Subject: Re: [PATCH] Update the documentation of the raw diff output format
Message-ID: <873a8grpay.fsf@krank.kagedal.org>
URL: https://gitlist.dev/e/873a8grpay.fsf%40krank.kagedal.org
In-Reply-To: <7vhbww5yxb.fsf@alter.siamese.dyndns.org>

```
Junio C Hamano <gitster@pobox.com> writes:

> Looks reasonable; thanks.

Great. But my patch mail doesn't seem to have reached the list, for
some reason. At least I can't find it in gmane.

-- 
David Kågedal

```

## David Kågedal, 2009-07-29 17:20

Subject: Output from git diff
Message-ID: <873a8fflt2.fsf@krank.kagedal.org>
URL: https://gitlist.dev/e/873a8fflt2.fsf%40krank.kagedal.org
In-Reply-To: <87hbwxaolw.fsf@krank.kagedal.org>

```
Here is another diff output question. The updated documentation in
diff-format.txt still claims that the output from the diff commands
has this format:

:100644 100644 bcd1234... 0123456... M file0

This is true for "git diff --raw", but diff-tree and friends print
full 40-char hashes.

I can get diff-tree to use abbreviated hashes with --abbrev, but how
do I tell diff to stop abbreviating?

And what should the documentation really say?

-- 
David Kågedal

```

## Pat Notz, 2009-07-29 17:29

Subject: Re: Output from git diff
Message-ID: <1cd1989b0907291029r2efd78br3506ded03dedf438@mail.gmail.com>
URL: https://gitlist.dev/e/1cd1989b0907291029r2efd78br3506ded03dedf438%40mail.gmail.com
In-Reply-To: <873a8fflt2.fsf@krank.kagedal.org>

```
On Wed, Jul 29, 2009 at 11:20 AM, David Kågedal<davidk@lysator.liu.se> wrote:
> Here is another diff output question. The updated documentation in
> diff-format.txt still claims that the output from the diff commands
> has this format:
>
> :100644 100644 bcd1234... 0123456... M file0
>
> This is true for "git diff --raw", but diff-tree and friends print
> full 40-char hashes.
>
> I can get diff-tree to use abbreviated hashes with --abbrev, but how
> do I tell diff to stop abbreviating?

Probably not the answer you *really* want but 'git diff --raw
--abbrev=40' will give you the full sha1

>
> And what should the documentation really say?
>
> --
> David Kågedal
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

```

## Junio C Hamano, 2009-07-29 18:26

Subject: Re: Output from git diff
Message-ID: <7vab2nuyz3.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vab2nuyz3.fsf%40alter.siamese.dyndns.org
In-Reply-To: <873a8fflt2.fsf@krank.kagedal.org>

```
David Kågedal <davidk@lysator.liu.se> writes:

> And what should the documentation really say?

"git diff" unlike "git diff-<whatiscompared>" is a Porcelain, to produce
human-readable output, and defaults to the abbreviated form.

```

## Junio C Hamano, 2009-07-30 08:06

Subject: Re: Output from git diff
Message-ID: <7v7hxqh9wu.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v7hxqh9wu.fsf%40alter.siamese.dyndns.org
In-Reply-To: <87y6q6ehx8.fsf@krank.kagedal.org>

```
David Kågedal <davidk@lysator.liu.se> writes:

> Or perhaps the --raw flag to git diff isn't really meant to ever be
> used?

I do not think "git diff" Porcelain had --raw originally.

If you really need to know, you would need to dig the archives yourself,
sorry.

```
