From: Junio C Hamano Date: Fri, 02 Mar 2007 22:52:34 GMT Subject: identifying blobs (was Re: Memory overrun in http-push.c) Message-ID: <7vr6s7dzrh.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Johannes Schindelin writes: > 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"'