{"thread":{"id":"18288","subject":"newb: Given a commit id, find which branches have it as an ancestor","startedAt":"2009-03-12T15:21:50Z","lastAt":"2009-03-12T15:38:15Z","messageCount":2,"participants":["Kelly F. Hickel","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"107837","messageId":"63BEA5E623E09F4D92233FB12A9F794302E0F98D@emailmn.mqsoftware.com","threadId":"18288","inReplyTo":null,"subject":"newb: Given a commit id, find which branches have it as an ancestor","fromName":"Kelly F. Hickel","fromEmail":"kfh@mqsoftware.com","sentAt":"2009-03-12T15:21:50Z","receivedAt":"2009-03-12T15:21:50Z","isPatch":false,"sender":{"key":"kfh@mqsoftware.com","avatar":null},"body":"Hi all, I've been working on testing importing our cvs repo via cvs2git,\nthen using cvsps to pull incremental updates.  Something seems to have\ngone awry with one of the commits, and I'm having trouble tracking it\ndown.\n\nThis is a question about how to track something down after the fact, not\na question about what went wrong with the cvsps import....\n\nThis is git 1.6.1 running on Centos 5.2 linux.\n\nSo, the scenario is that one of the last few commits pulled into my git\nrepo by cvsps/cvsimport should have landed on origin/master, but when I\nlook at the file, the change is missing.  I'm trying to figure out\n\"where it went\", since it didn't go where I expected it.\n\nThings I've tried that didn't tell me what I wanted to know:\n$ git name-rev 15fa81b\n15fa81b undefined\n\n\n$ git log --children 15fa81b\nThis shows me a bunch of commits that, going by the commit date, appear\nto be ancestors of the commit I'm interested in, not children.\n\n$ git checkout  15fa81b5ae\nNote: moving to \"15fa81b5ae\" which isn't a local branch If you want to\ncreate a new branch from this checkout, you may do so (now or later) by\nusing -b with the checkout command again. Example:\n  git checkout -b <new_branch_name>\nHEAD is now at 15fa81b... Changed version to 4.1.0.157 $ gitk (as\nexpected, shows me that the commit I care about is the latest in the\nworkspace)\n\n$ git checkout master\nPrevious HEAD position was 15fa81b... Changed version to 4.1.0.157\nSwitched to branch \"master\"\n$ gitk\nDoesn't list my target commit, in fact, doesn't list any commits after\nthe cvs2git date, so it appears that none of my cvsps pulled commits\nlanded on master (ok, so maybe this post is about what went wrong, just\na little ;-} ).\n\nI suspect that I'm missing some factoid in trying to map my workflow to\nGit, but this seems like the kind of thing I'd want to know, i.e. given\na commit, what branches have that commit as an ancestor.  It would seem\nto be useful in two cases:\n1) I've found a commit that introduced a bug and want to know what\nreleases that bug ended up in.\n2) I've identified a fix for a previous bug and want to know what\nreleases already contain the fix.\n(ok, those are pretty much the same workflow, but different reasons).\n\nWhat am I missing????\n\n\n\n--\n\nKelly F. Hickel\nSenior Product Architect\nMQSoftware, Inc.\n952-345-8677 Office\n952-345-8721 Fax\nkfh@mqsoftware.com\nwww.mqsoftware.com\nCertified IBM SOA Specialty\nYour Full Service Provider for IBM WebSphere\nLearn more at www.mqsoftware.com \n"},{"id":"107841","messageId":"49B92C67.5080304@viscovery.net","threadId":"18288","inReplyTo":"63BEA5E623E09F4D92233FB12A9F794302E0F98D@emailmn.mqsoftware.com","subject":"Re: newb: Given a commit id, find which branches have it as an ancestor","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-03-12T15:38:15Z","receivedAt":"2009-03-12T15:38:15Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"$ git branch -a --contains the-sha1\n\n-- Hannes\n"}]}