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

Re: "git log -- SHA-1" - how to get/simulate this functionality?

From
Alex Riesen <raa.lkml@gmail.com>
Date
Apr 26, 2010, 18:08 UTC
Message-ID
<z2m81b0412b1004261108n5453b5d2h179a944fa8db9b49@mail.gmail.com>
In-Reply-To
<x2z76c5b8581004261056lcdb153a5j825db166916069e9@mail.gmail.com>
On Mon, Apr 26, 2010 at 19:56, Eugene Sajine <euguess@gmail.com> wrote:
Show 8 quoted lines
> On Mon, Apr 26, 2010 at 1:54 PM, Eugene Sajine <euguess@gmail.com> wrote:
>> Hi,
>>
>> I'm wondering if there is a way to get some repo information if the
>> only thing i know is SHA-1 (no full path to the file)
>
> I mean of course the SHA-1 of the blob, i.e. the result of git
> hash-object some_file

Try 'git cat-file -t <sha>'. It prints what object type is under the hash. Than you can use either 'git cat-file <type> <sha>' (the most precise version, which shall fail if anything is wrong), 'git cat-file -p <sha>' or plain 'git show <sha>' (which always works, unless repo's broken).

Previous: Eugene SajineNext: Eugene Sajine
Message 3 of 7 in “"git log -- SHA-1" - how to get/simulate this functionality?”
  1. Eugene SajineApr 26, 2010
  2. Eugene SajineApr 26, 2010
  3. Alex RiesenApr 26, 2010
  4. Eugene SajineApr 26, 2010
  5. Alex RiesenApr 26, 2010
  6. Alex RiesenApr 26, 2010
  7. Eugene SajineApr 26, 2010

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.