{"thread":{"id":"4103","subject":"Command to list commits that point to a given tree.","startedAt":"2006-05-08T16:34:37Z","lastAt":"2006-05-08T20:34:24Z","messageCount":2,"participants":["Carl Baldwin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"19717","messageId":"20060508163437.GA17390@hpsvcnb.fc.hp.com","threadId":"4103","inReplyTo":null,"subject":"Command to list commits that point to a given tree.","fromName":"Carl Baldwin","fromEmail":"cnb@fc.hp.com","sentAt":"2006-05-08T16:34:37Z","receivedAt":"2006-05-08T16:34:37Z","isPatch":false,"sender":{"key":"cnb@fc.hp.com","avatar":null},"body":"Hi,\n\nNormally, the natural thing to do is to dereference objects in the\nfollowing directions:\n\ncommit -> tree\ntag    -> commit\ntag    -> other object\n\nHowever, sometimes it is convenient to look in the other direction.  The\ncommand git-name-rev satisfies this need partially by listing symbolic\nnames for given commits.\n\nIs there a command that can do this more generally?  In particular, I am\nlooking for a command that will return a list of commits that point to a\nparticular tree.\n\nRight now I plan to brute force it.  Basically, I will call git-rev-list\nto list the commits and, for each commit, map it to a tree.  Then, I\nwill reverse the map in order to be able to look up a commit based on\nthe tree.\n\nI was thinking, though, that it might be somewhat useful in general to,\nat least, provide a command for the following:\n\n- Given a blob, list the tree and/or tag objects that reference that\n  blob.\n\n- Given a tree, list the tree, commit and/or tag objects that reference\n  it.\n\n- Given a commit, list the commit and/or tag objects that reference it.\n\nCarl\n\n-- \n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n Carl Baldwin                        RADCAD (R&D CAD)\n Hewlett Packard Company\n MS 88                               work: 970 898-1523\n 3404 E. Harmony Rd.                 work: Carl.N.Baldwin@hp.com\n Fort Collins, CO 80525              home: Carl@ecBaldwin.net\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n"},{"id":"19721","messageId":"7vvesgfe7j.fsf@assigned-by-dhcp.cox.net","threadId":"4103","inReplyTo":"20060508163437.GA17390@hpsvcnb.fc.hp.com","subject":"Re: Command to list commits that point to a given tree.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-08T20:34:24Z","receivedAt":"2006-05-08T20:34:24Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carl Baldwin <cnb@fc.hp.com> writes:\n\n> ... In particular, I am\n> looking for a command that will return a list of commits that point to a\n> particular tree.\n>\n> Right now I plan to brute force it.\n\nYou might want to explain what problem you are trying to solve,\nby knowing which commit contains a particular tree object.\nThere might be a solution to that unstated problem which does\nnot require the reverse lookup.\n"}]}