* Command to list commits that point to a given tree.
@ 2006-05-08 16:34 Carl Baldwin
2006-05-08 20:34 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Carl Baldwin @ 2006-05-08 16:34 UTC (permalink / raw)
To: git
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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Command to list commits that point to a given tree.
2006-05-08 16:34 Command to list commits that point to a given tree Carl Baldwin
@ 2006-05-08 20:34 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2006-05-08 20:34 UTC (permalink / raw)
To: Carl Baldwin; +Cc: git
Carl Baldwin <cnb@fc.hp.com> writes:
> ... 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.
You might want to explain what problem you are trying to solve,
by knowing which commit contains a particular tree object.
There might be a solution to that unstated problem which does
not require the reverse lookup.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-05-08 20:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-08 16:34 Command to list commits that point to a given tree Carl Baldwin
2006-05-08 20:34 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).