identifying blobs (was Re: Memory overrun in http-push.c)
- From
Junio C Hamano <junkio@cox.net>
- Date
- Mar 2, 2007, 22:52 UTC
- Message-ID
- <7vr6s7dzrh.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.63.0703021617040.22628@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 7 quoted lines
> On Fri, 2 Mar 2007, Jakub Narebski wrote: > >> Second, there were some work on git mailing list to create git command >> which given a blob (or sha1 of a blob object) would list all commits (in >> date order) which have this exact version of a file (of a blob). > > It was shot down, and rightly so.
I think this "rightly" needs a clarification (otherwise Jakub wouldn't have said the above).
It wasn't that identifying the commit that contained the version of the file was not needed. It is just there already is a way to do so, and "to create git command" turns out to be unnecessary. Something like:
$ hash=`git hash-object --stdin <$file_in_question`
$ git log -z --raw -r --abbrev=40 |
grep -z '^:[0-7][0-7]* [0-7][0-7]* [0-9a-f][0-9a-f]* '"$hash"'