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, 09:39 UTC
Message-ID
<4D75F96B.7000707@drmicha.warpmail.net>
In-Reply-To
<AANLkTinOEutM92k4SUGEXbfTpzGcQitpW4CZbcQbg0R4@mail.gmail.com>
Jay Soffian venit, vidit, dixit 08.03.2011 10:35:
Show 12 quoted lines
> On Tue, Mar 8, 2011 at 3:48 AM, Michael J Gruber
> <git@drmicha.warpmail.net> wrote:
>> 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 ;)
> 
> Ah. The rev-list man page entry on --ancestry-path only talks about
> using it with '..', so I didn't even try it with the symmetric diff
> operator ('...').

I understood --ancestry-path only after looking at revision.c, where there's talk about "bottom commits", which gave me the right hint (because I've been messing with the walker lately).

Show 5 quoted lines
> 
> That said, seems it would be useful to have an easy way to get to the
> merge which has a merge-base as one of its parents. Maybe even a
> generic way to find all commits which have a particular parent. I
> think rev-list --parents | grep is the only way to do that today.

I had a patch for that but it was shot down because of the "grep" workaround:

http://permalink.gmane.org/gmane.comp.version-control.git/157636
Maybe I should try again...
Michael
Previous: Jay SoffianNext: Jay Soffian
Message 4 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.