All of lore.kernel.org
 help / color / mirror / Atom feed
* File info from SHA ID
@ 2008-04-03 16:58 Christoph Duelli
  2008-04-03 17:16 ` Linus Torvalds
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Duelli @ 2008-04-03 16:58 UTC (permalink / raw)
  To: git

Given (only) a SHA ID (say from a file's $ID$ expansion), is it possible 
to determine the file's name, date of commit etc?
I'd be most interested in the file path.

Best regards, keep up the good work
-- 
Christoph Duelli

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

* Re: File info from SHA ID
  2008-04-03 16:58 File info from SHA ID Christoph Duelli
@ 2008-04-03 17:16 ` Linus Torvalds
  2008-04-04 13:55   ` Christoph Duelli
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Torvalds @ 2008-04-03 17:16 UTC (permalink / raw)
  To: Christoph Duelli; +Cc: git



On Thu, 3 Apr 2008, Christoph Duelli wrote:
>
> Given (only) a SHA ID (say from a file's $ID$ expansion), is it possible to
> determine the file's name, date of commit etc?

Not directly, no.

But you can get it indirectly with a number of variations on

	git whatchanged --raw --no-abbrev

and then just searching for that SHA1 ID in the result. That will also 
show you where in the history that SHA1 came to be or went away.

The SHA1 itself is _purely_ about the actual contents of the file, so it 
has no bearing on where that file actually exists, and two identical files 
in different places will have the same SHA1. So no SHA1 -> filename 
mapping can exist, but you can figure out where in the tree or history it 
existed if you just have the full repository.

			Linus

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

* Re: File info from SHA ID
  2008-04-03 17:16 ` Linus Torvalds
@ 2008-04-04 13:55   ` Christoph Duelli
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Duelli @ 2008-04-04 13:55 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

Linus Torvalds schrieb:
> 
> On Thu, 3 Apr 2008, Christoph Duelli wrote:
>> Given (only) a SHA ID (say from a file's $ID$ expansion), is it possible to
>> determine the file's name, date of commit etc?
> 
> Not directly, no.
> 
> But you can get it indirectly with a number of variations on
> 
> 	git whatchanged --raw --no-abbrev
> 
> and then just searching for that SHA1 ID in the result. That will also 
> show you where in the history that SHA1 came to be or went away.
> 
> The SHA1 itself is _purely_ about the actual contents of the file, so it 
> has no bearing on where that file actually exists, and two identical files 
> in different places will have the same SHA1. So no SHA1 -> filename 
> mapping can exist, but you can figure out where in the tree or history it 
> existed if you just have the full repository.
Ok, thank you. I was able to use the output of "git whatchanged --raw 
--no-abbrev" to achieve what I wanted to do.

-- 
Christoph Duelli

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

end of thread, other threads:[~2008-04-04 13:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-03 16:58 File info from SHA ID Christoph Duelli
2008-04-03 17:16 ` Linus Torvalds
2008-04-04 13:55   ` Christoph Duelli

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.