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

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

From
KHKelly F. Hickel <kfh@mqsoftware.com>
Date
Mar 13, 2009, 13:30 UTC
Message-ID
<63BEA5E623E09F4D92233FB12A9F794302E0F9D8@emailmn.mqsoftware.com>
In-Reply-To
<49BA07E5.2080701@viscovery.net>
Show 6 quoted lines
> -----Original Message-----
> From: Johannes Sixt [mailto:j.sixt@viscovery.net]
> Sent: Friday, March 13, 2009 2:15 AM
> To: Kelly F. Hickel
> Cc: git@vger.kernel.org
> Subject: Re: newb: Given a commit id, find which branches have it as
an
Show 17 quoted lines
> ancestor
> 
> Kelly F. Hickel schrieb:
> >> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org]
> On
> >> Behalf Of Johannes Sixt
> >> Sent: Thursday, March 12, 2009 10:38 AM
> >> To: Kelly F. Hickel
> >
> >> $ git branch -a --contains the-sha1
> >>
> >> -- Hannes
> >>
> >
> > Thanks, that looks like a really useful command.
> >
> > Unfortunately, in this case it didn't print anything out (neither
did
Show 6 quoted lines
> > "git branch -r -a sha1").
> >
> > What I'm beginning to suspect is that all the commits that should
> have
> > gone to master went to some unnamed branch.
> > Is that reasonable/possible/likely?  This commit has a full
ancestry,
> > but doesn't appear to be on any branch.
> >
> > In the above question there's an assumption that if a branch exists
> > without a name, then git branch -a --contains wouldn't print
anything
Show 11 quoted lines
> > out, is that correct?
> 
> Correct.
> 
> Your best bet is perhaps that you create a branch at the commit
> 
>   $ git branch tmp-branch your_sha1
> 
> so that the commits are not lost, then you cherry-pick them to master.
> 
> -- Hannes

Thanks, in the end it turned out that I just hadn't properly understood the Comment about doing your own merge in the git-cvsimport doc. For whatever reason, when doing cvsimport in a workspace on master, after the import I have to do "git merge origin/master" and it fast forwards it and all is well. I *don't* have to do that for any of the other branches that get affected by the cvsimport, so that threw me for awhile.

Thanks for the help, Kelly

Previous: Kelly F. Hickel
Message 5 of 5 in “RE: newb: Given a commit id, find which branches have it as an ancestor”
  1. Kelly F. HickelMar 12, 2009
  2. Johannes SixtMar 13, 2009
  3. Junio C HamanoMar 13, 2009
  4. Kelly F. HickelMar 13, 2009
  5. Kelly F. HickelMar 13, 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.