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

Re: File info from SHA ID

From
CDChristoph Duelli <duelli@melosgmbh.de>
Date
Apr 4, 2008, 13:55 UTC
Message-ID
<47F63339.3070903@melosgmbh.de>
In-Reply-To
<alpine.LFD.1.00.0804031009280.14670@woody.linux-foundation.org>
Linus Torvalds schrieb:
Show 19 quoted lines
> 
> 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
Previous: Linus Torvalds
Message 3 of 3 in “File info from SHA ID”
  1. Christoph DuelliApr 3, 2008
  2. Linus TorvaldsApr 3, 2008
  3. Christoph DuelliApr 4, 2008

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.