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

Re: [PATCH 2/2] Teach name-rev to identify revisions containing a certain blob

From
Junio C Hamano <junkio@cox.net>
Date
Feb 18, 2007, 08:34 UTC
Message-ID
<7vmz3bj248.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0702171838510.22628@wbgn013.biozentrum.uni-wuerzburg.de>

Having said what I said in the comments on [PATCH 1/2], I think you are either solving a wrong problem, or even if you are solving the right problem, you are solving in a wrong way in this patch.

I do not think Mike wants a way to deal with what he gets in his mailbox from an end user who did this:

	$ cat a-file-whose-name-was-not-told-to-mike >junk
	$ mailx mike.coleman <junk

It's more like he learns the contents _and_ the path from an end-user who is having trouble with a tarball of unknown vintage, and wants to identify which snapshot had that contents at that path [*1*].

So I do not think it is solving the right problem to run around all over the tree without knowing the path, looking for a particular object name. It certainly makes the solution much more expensive.

Even if that were Mike's problem, there is a problem that the same object can appear at different places in different trees. Keeping a single pathname registered in object_hash would mean the answer is "whatever happens to be found first", regardless of the path.

To make "whatever happens to be found first" semantics useful, I think you would need to make the traversal more controllable by the user of name-rev. For example, Mike may know what he gave the end user was from maintenance series of 1.4.4 software, in which case you would want to let him say "traverse from the tip of 1.4.4 maintenance branch down, do not worry about other branches such as 1.5.0 series or 1.4.3 maintenance series".

Your earlier --ref-filter patch would certainly help it, but a solution based on grep over "rev-list | ls-tree --stdin" (which currently does not exist) might be more appropriate and flexible? I dunno.

[Footnote]

*1* To find a revision that had a particular object at a known path, you should be able to do:

	git rev-list <starting refs> |
        git diff-tree --stdin --raw -r -Z |
	grep -z that-object-name

but an earlier commit abd4e222 needs to be further enhanced to add -Z option that means "output fields are not NUL terminated, output records are", which did not happen.

Previous: Johannes SchindelinNext: Junio C Hamano
Message 7 of 9 in “Teach name-rev to identify revisions containing a certain blob”
  1. 2/2 Teach name-rev to identify revisions containing a certain blobJohannes Schindelin, Feb 17, 2007
  2. Junio C HamanoFeb 17, 2007
  3. Johannes SchindelinFeb 17, 2007
  4. Johannes SchindelinFeb 18, 2007
  5. Junio C HamanoFeb 17, 2007
  6. Johannes SchindelinFeb 17, 2007
  7. Junio C HamanoFeb 18, 2007
  8. Junio C HamanoFeb 18, 2007
  9. Johannes SchindelinFeb 18, 2007

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.