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

Re: finding the merge of two or more commits

From
Jeff King <peff@peff.net>
Date
Oct 30, 2009, 18:04 UTC
Message-ID
<20091030180429.GD18583@coredump.intra.peff.net>
In-Reply-To
<32541b130910291434q1b068918x38c5aec543cb1c2a@mail.gmail.com>
On Thu, Oct 29, 2009 at 05:34:45PM -0400, Avery Pennarun wrote:
Show 10 quoted lines
> On Thu, Oct 29, 2009 at 5:12 PM, E R <pc88mxer@gmail.com> wrote:
> > That is, I don't want to merge c1 and c2 myself, but I want to know if
> > someone else has merged c1 and c2, performed any conflict resolution
> > and committed the result.
> 
> Try this:
> 
> (git branch -a --contains c1; git branch -a --contains c2) | sort | uniq -d
> 
> It's not exactly pretty, but it works.

That will tell you whether any branch contains both of them, which is not exactly what the original poster asked for (though it may have been what he meant :) ). To see if there is a specific merge of those two commits, you can do:

  git log --all --format='%H %P' | grep " $c1" | grep " $c2" | cut -d' ' -f1
-Peff
Previous: Avery PennarunNext: Jakub Narebski
Message 3 of 4 in “finding the merge of two or more commits”
  1. E ROct 29, 2009
  2. Avery PennarunOct 29, 2009
  3. Jeff KingOct 30, 2009
  4. Jakub NarebskiOct 30, 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.