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

Command to list commits that point to a given tree.

From
CBCarl Baldwin <cnb@fc.hp.com>
Date
May 8, 2006, 16:34 UTC
Message-ID
<20060508163437.GA17390@hpsvcnb.fc.hp.com>
Hi,

Normally, the natural thing to do is to dereference objects in the following directions:

commit -> tree tag -> commit tag -> other object

However, sometimes it is convenient to look in the other direction. The command git-name-rev satisfies this need partially by listing symbolic names for given commits.

Is there a command that can do this more generally? In particular, I am looking for a command that will return a list of commits that point to a particular tree.

Right now I plan to brute force it. Basically, I will call git-rev-list to list the commits and, for each commit, map it to a tree. Then, I will reverse the map in order to be able to look up a commit based on the tree.

I was thinking, though, that it might be somewhat useful in general to, at least, provide a command for the following:

- Given a blob, list the tree and/or tag objects that reference that
  blob.
- Given a tree, list the tree, commit and/or tag objects that reference
  it.
- Given a commit, list the commit and/or tag objects that reference it.
Carl
-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Carl Baldwin                        RADCAD (R&D CAD)
 Hewlett Packard Company
 MS 88                               work: 970 898-1523
 3404 E. Harmony Rd.                 work: Carl.N.Baldwin@hp.com
 Fort Collins, CO 80525              home: Carl@ecBaldwin.net
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Next: Junio C Hamano
Message 1 of 2 in “Command to list commits that point to a given tree.”
  1. Carl BaldwinMay 8, 2006
  2. Junio C HamanoMay 8, 2006

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.