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

Re: ident hash usage question

From
Alex Riesen <raa.lkml@gmail.com>
Date
Oct 20, 2009, 19:19 UTC
Message-ID
<81b0412b0910201219q4d16c472n43cab4b5d17cf63c@mail.gmail.com>
In-Reply-To
<76c5b8580910201159i75a90f28pb882e83f0c7c40ae@mail.gmail.com>
On Tue, Oct 20, 2009 at 20:59, Eugene Sajine <euguess@gmail.com> wrote:
Show 8 quoted lines
>>
>> Well, not exactly impossible, but you can end up with multiple paths,
>> some of which may not have anything to do the original path.
>>
>> Just run git log --no-abbrev --raw --all and grep for the SHA-1
>
> This is exactly what I was looking for! Thank you!
>
Very likely it isn't, but it's your choice.
> Because after having this hash one can build up all necessary info from it:
Depending on your definition of "necessary".
> #finding blobs with SHA indicated in $Id$ keword
> $ git log --no-abbrev --raw --all | grep SHA-1

yeah. These are all starting from commit which introduced the hash under a specific path, ending at the commit where the path contains another SHA-1.

Show 10 quoted lines
> # little script or regexp here (don’t have it)
> $ pull out path from result
>
> # last commit for the path with all corresponding info
> $ git log -1 HEAD path
>
> So, this seems to cover most of the needs of people who would like to
> use keywords expansion, if they are not ready to forget about them…
>
> Does it make sense?

Not much. You'll always get a long list of commits which didn't change the damned blob. And you have absolutely no way to find out exactly which of the commits have produced the blob you're looking at (because you decided to do away with the information).

What's so hard with storing the SHA-1 of the *commit*, anyway?
Previous: Eugene SajineNext: Johannes Sixt
Message 5 of 18 in “ident hash usage question”
  1. Eugene SajineOct 20, 2009
  2. Alex RiesenOct 20, 2009
  3. Alex RiesenOct 20, 2009
  4. Eugene SajineOct 20, 2009
  5. Alex RiesenOct 20, 2009
  6. Johannes SixtOct 20, 2009
  7. Alex RiesenOct 20, 2009
  8. Eugene SajineOct 20, 2009
  9. Junio C HamanoOct 20, 2009
  10. Eugene SajineOct 20, 2009
  11. Junio C HamanoOct 20, 2009
  12. Eugene SajineOct 20, 2009
  13. Daniel BarkalowOct 21, 2009
  14. Nanako ShiraishiOct 21, 2009
  15. Alex RiesenOct 20, 2009
  16. Eugene SajineOct 20, 2009
  17. Alex RiesenOct 21, 2009
  18. Eugene SajineOct 21, 2009

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.