All of lore.kernel.org
 help / color / mirror / Atom feed
* Meaning of two commit-ish hash in git diff
@ 2017-10-31  3:24 Yubin Ruan
  2017-10-31  4:28 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Yubin Ruan @ 2017-10-31  3:24 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Meaning of two commit-ish hash in git diff
  2017-10-31  3:24 Meaning of two commit-ish hash in git diff Yubin Ruan
@ 2017-10-31  4:28 ` Junio C Hamano
  2017-11-01  0:27   ` Philip Oakley
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2017-10-31  4:28 UTC (permalink / raw)
  To: Yubin Ruan; +Cc: git

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Meaning of two commit-ish hash in git diff
  2017-10-31  4:28 ` Junio C Hamano
@ 2017-11-01  0:27   ` Philip Oakley
  2017-11-01  1:07     ` Yubin Ruan
  0 siblings, 1 reply; 5+ messages in thread
From: Philip Oakley @ 2017-11-01  0:27 UTC (permalink / raw)
  To: Yubin Ruan; +Cc: git, Junio C Hamano

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 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Meaning of two commit-ish hash in git diff
  2017-11-01  0:27   ` Philip Oakley
@ 2017-11-01  1:07     ` Yubin Ruan
  2017-11-01  2:48       ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Yubin Ruan @ 2017-11-01  1:07 UTC (permalink / raw)
  To: Philip Oakley; +Cc: git, Junio C Hamano

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Meaning of two commit-ish hash in git diff
  2017-11-01  1:07     ` Yubin Ruan
@ 2017-11-01  2:48       ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2017-11-01  2:48 UTC (permalink / raw)
  To: Yubin Ruan; +Cc: Philip Oakley, git

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 ;-)



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-01  2:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-31  3:24 Meaning of two commit-ish hash in git diff Yubin Ruan
2017-10-31  4:28 ` Junio C Hamano
2017-11-01  0:27   ` Philip Oakley
2017-11-01  1:07     ` Yubin Ruan
2017-11-01  2:48       ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.