# Meaning of two commit-ish hash in git diff

5 messages from 2017-10-31 to 2017-11-01. Participants: Yubin Ruan, Junio C Hamano, Philip Oakley.
Thread: https://gitlist.dev/t/47078

## Yubin Ruan, 2017-10-31 03:24

Subject: Meaning of two commit-ish hash in git diff
Message-ID: <ab9b5c63-ca38-6157-6732-78aa5d5f291f@gmail.com>
URL: https://gitlist.dev/e/ab9b5c63-ca38-6157-6732-78aa5d5f291f%40gmail.com

```
Hi,

Can anyone tell me what does the "f8886b4..a1c96df" mean in a git diff output,
as below?

diff --git a/path/somefile b/path/somefile
index f8886b4..a1c96df 100644
--- a/path/somefile
+++ b/path/somefile
<snip>

This is output by a `git diff` between two adjacent commits but they are
not any commit hash. I grep through the whole $(git log) but still cannot
find those hash.

And BTW, are there any special meanings for that .. ?

Thanks,
Yubin

```

## Junio C Hamano, 2017-10-31 04:28

Subject: Re: Meaning of two commit-ish hash in git diff
Message-ID: <xmqqd1542b5r.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqd1542b5r.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <ab9b5c63-ca38-6157-6732-78aa5d5f291f@gmail.com>

```
Yubin Ruan <ablacktshirt@gmail.com> writes:

> diff --git a/path/somefile b/path/somefile
> index f8886b4..a1c96df 100644
> --- a/path/somefile
> +++ b/path/somefile
> <snip>
>
> This is output by a `git diff` between two adjacent commits but they are
> not any commit hash. I grep through the whole $(git log) but still cannot
> find those hash.

The f8886b4 you see on the left is the name of the blob object on
the left hand side of the comparison that produced this output;
similarly a1c96df is the name of the blob object on the right hand
side of the comparison.

IOW, if you have the contents of the blob whose object name is
f8886b4, by applying this patch, you will get a blob whose object
name is a1c96df.

The information is used by "git am -3" when the patch does not apply
cleanly to fall back to the 3-way merge.

```

## Philip Oakley, 2017-11-01 00:27

Subject: Re: Meaning of two commit-ish hash in git diff
Message-ID: <2A1B66E868594FC984FED8F0EDEAF900@PhilipOakley>
URL: https://gitlist.dev/e/2A1B66E868594FC984FED8F0EDEAF900%40PhilipOakley
In-Reply-To: <xmqqd1542b5r.fsf@gitster.mtv.corp.google.com>

```
Yubin ,

From: "Junio C Hamano" <gitster@pobox.com>
> Yubin Ruan <ablacktshirt@gmail.com> writes:
>
>> diff --git a/path/somefile b/path/somefile
>> index f8886b4..a1c96df 100644
>> --- a/path/somefile
>> +++ b/path/somefile
>> <snip>
>>
>> This is output by a `git diff` between two adjacent commits but they are
>> not any commit hash. I grep through the whole $(git log) but still cannot
>> find those hash.
>
> The f8886b4 you see on the left is the name of the blob object on
> the left hand side of the comparison that produced this output;
> similarly a1c96df is the name of the blob object on the right hand
> side of the comparison.
>
> IOW, if you have the contents of the blob whose object name is
> f8886b4, by applying this patch, you will get a blob whose object
> name is a1c96df.
>
> The information is used by "git am -3" when the patch does not apply
> cleanly to fall back to the 3-way merge.

The ability to 'git describe` those blob object IDs is currently the subject 
of a patch series
https://public-inbox.org/git/20171031211852.13001-1-sbeller@google.com/

Maybe see if would have helped ;-)

Philip 


```

## Yubin Ruan, 2017-11-01 01:07

Subject: Re: Meaning of two commit-ish hash in git diff
Message-ID: <127f7748-4b5d-f6be-2c64-fa4ee079b871@gmail.com>
URL: https://gitlist.dev/e/127f7748-4b5d-f6be-2c64-fa4ee079b871%40gmail.com
In-Reply-To: <2A1B66E868594FC984FED8F0EDEAF900@PhilipOakley>

```
Thanks Philip,

On 11/01/2017 08:27 AM, Philip Oakley wrote:
> Yubin ,
> 
> From: "Junio C Hamano" <gitster@pobox.com>
>> Yubin Ruan <ablacktshirt@gmail.com> writes:
>>
>>> diff --git a/path/somefile b/path/somefile
>>> index f8886b4..a1c96df 100644
>>> --- a/path/somefile
>>> +++ b/path/somefile
>>> <snip>
>>>
>>> This is output by a `git diff` between two adjacent commits but they are
>>> not any commit hash. I grep through the whole $(git log) but still cannot
>>> find those hash.
>>
>> The f8886b4 you see on the left is the name of the blob object on
>> the left hand side of the comparison that produced this output;
>> similarly a1c96df is the name of the blob object on the right hand
>> side of the comparison.
>>
>> IOW, if you have the contents of the blob whose object name is
>> f8886b4, by applying this patch, you will get a blob whose object
>> name is a1c96df.
>>
>> The information is used by "git am -3" when the patch does not apply
>> cleanly to fall back to the 3-way merge.
> 
> The ability to 'git describe` those blob object IDs is currently the subject of a patch series
> https://public-inbox.org/git/20171031211852.13001-1-sbeller@google.com/
> 
> Maybe see if would have helped ;-)

What would be other use case of the blob object / blob name ?

Yubin


```

## Junio C Hamano, 2017-11-01 02:48

Subject: Re: Meaning of two commit-ish hash in git diff
Message-ID: <xmqqfu9yww7x.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqfu9yww7x.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <127f7748-4b5d-f6be-2c64-fa4ee079b871@gmail.com>

```
Yubin Ruan <ablacktshirt@gmail.com> writes:

>>> IOW, if you have the contents of the blob whose object name is
>>> f8886b4, by applying this patch, you will get a blob whose object
>>> name is a1c96df.
>>>
>>> The information is used by "git am -3" when the patch does not apply
>>> cleanly to fall back to the 3-way merge.
>> 
>> The ability to 'git describe` those blob object IDs is currently the subject of a patch series
>> https://public-inbox.org/git/20171031211852.13001-1-sbeller@google.com/
>> 
>> Maybe see if would have helped ;-)
>
> What would be other use case of the blob object / blob name ?

Perhaps start from "git cat-file blob $name".  And follow the path
your imagination leads you to ;-)



```
