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

newb: Given a commit id, find which branches have it as an ancestor

From
KHKelly F. Hickel <kfh@mqsoftware.com>
Date
Mar 12, 2009, 15:21 UTC
Message-ID
<63BEA5E623E09F4D92233FB12A9F794302E0F98D@emailmn.mqsoftware.com>

Hi all, I've been working on testing importing our cvs repo via cvs2git, then using cvsps to pull incremental updates. Something seems to have gone awry with one of the commits, and I'm having trouble tracking it down.

This is a question about how to track something down after the fact, not a question about what went wrong with the cvsps import....

This is git 1.6.1 running on Centos 5.2 linux.

So, the scenario is that one of the last few commits pulled into my git repo by cvsps/cvsimport should have landed on origin/master, but when I look at the file, the change is missing. I'm trying to figure out "where it went", since it didn't go where I expected it.

Things I've tried that didn't tell me what I wanted to know: $ git name-rev 15fa81b 15fa81b undefined

$ git log --children 15fa81b This shows me a bunch of commits that, going by the commit date, appear to be ancestors of the commit I'm interested in, not children.

$ git checkout  15fa81b5ae
Note: moving to "15fa81b5ae" which isn't a local branch If you want to
create a new branch from this checkout, you may do so (now or later) by
using -b with the checkout command again. Example:
  git checkout -b <new_branch_name>
HEAD is now at 15fa81b... Changed version to 4.1.0.157 $ gitk (as
expected, shows me that the commit I care about is the latest in the
workspace)

$ git checkout master Previous HEAD position was 15fa81b... Changed version to 4.1.0.157 Switched to branch "master" $ gitk Doesn't list my target commit, in fact, doesn't list any commits after the cvs2git date, so it appears that none of my cvsps pulled commits landed on master (ok, so maybe this post is about what went wrong, just a little ;-} ).

I suspect that I'm missing some factoid in trying to map my workflow to
Git, but this seems like the kind of thing I'd want to know, i.e. given
a commit, what branches have that commit as an ancestor.  It would seem
to be useful in two cases:
1) I've found a commit that introduced a bug and want to know what
releases that bug ended up in.
2) I've identified a fix for a previous bug and want to know what
releases already contain the fix.
(ok, those are pretty much the same workflow, but different reasons).
What am I missing????
--

Kelly F. Hickel Senior Product Architect MQSoftware, Inc. 952-345-8677 Office 952-345-8721 Fax kfh@mqsoftware.com www.mqsoftware.com Certified IBM SOA Specialty Your Full Service Provider for IBM WebSphere Learn more at www.mqsoftware.com

Next: Johannes Sixt
Message 1 of 2 in “newb: Given a commit id, find which branches have it as an ancestor”
  1. Kelly F. HickelMar 12, 2009
  2. Johannes SixtMar 12, 2009

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.