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

Re: how to list commits on branch since last merge

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Mar 8, 2011, 08:48 UTC
Message-ID
<4D75ED72.8030203@drmicha.warpmail.net>
In-Reply-To
<AANLkTi=zW9hOhnddw6HsjQwV2qLf_R_qeNna+XeN6U6x@mail.gmail.com>
Jay Soffian venit, vidit, dixit 08.03.2011 08:24:
Show 19 quoted lines
> Given this history:
> 
> o---o---x---o---...    foo
>  \       \
>   o---o---m---o---...  bar
> 
> I want to list the commits on bar newer than merge m (the last merge
> from foo). merge-base returns x.
> 
> I feel like I'm going to face-palm upon reply, but the only way I see
> to do it is:
> 
>   $ git rev-list --ancestry-path $(git merge-base foo bar)..bar
> 
> Or by greping the output of rev-list --merges --parents foo..bar
> looking for the merge base.
> 
> I must be missing something obvious, since this feels like it should
> be a common operation. :-)
Have you tried:
git rev-list --ancestry-path --left-right foo...bar

If the ">" commits are the ones that you want you only have to wait for the "--right-only" option which is cooking in pu. And grep '^>' for now ;)

Michael
Previous: Jay SoffianNext: Jay Soffian
Message 2 of 13 in “how to list commits on branch since last merge”
  1. Jay SoffianMar 8, 2011
  2. Michael J GruberMar 8, 2011
  3. Jay SoffianMar 8, 2011
  4. Michael J GruberMar 8, 2011
  5. Jay SoffianMar 8, 2011
  6. Michael J GruberMar 8, 2011
  7. Jay SoffianMar 8, 2011
  8. Michael J GruberMar 8, 2011
  9. Jeff KingMar 8, 2011
  10. Jay SoffianMar 8, 2011
  11. Jeff KingMar 8, 2011
  12. Andreas SchwabMar 8, 2011
  13. Jeff KingMar 8, 2011

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.