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

Re: Getting a list of commits between 2 points without upstream changes

From
Jeff King <peff@peff.net>
Date
Jul 18, 2011, 00:17 UTC
Message-ID
<20110718001749.GA706@sigill.intra.peff.net>
In-Reply-To
<CAFOYHZC5hQ9JV8a5d20AaPR_eYFDViama+4148MPumvvJ-n6wQ@mail.gmail.com>
On Mon, Jul 18, 2011 at 11:49:57AM +1200, Chris Packham wrote:
Show 14 quoted lines
> I'm trying to send round an incremental changelog for my project which
> contains just my changes without changes that have been made upstream.
> The history look something like this.
> 
> ---o--o--o--o--o--o--o--o-- upstream
>     \          \        \
>      \-m--A--m--B--m--C--D-- topic
> 
> What I want is a changelog with just B, C and D in it (i.e. no merge
> commits and no commits already in upstream). I know if I wanted A,B,C
> and D I could just do 'git log --no-merges upstream..topic'. If I do
> 'git log --no-merges B..topic' I get the merged commits from upstream.
> In set-speak what I think want is the union of upstream..topic and
> B..topic.

I'm not clear on what makes "B" more special than "A" in the graph above. But assuming you know A, don't you just want:

  git log --no-merges topic ^upstream ^A

? That is, "everything in topic, but not in upstream, nor in the parent of A". Or if you know A and not B, you can use "^B^!" (which means "do not include commits that are in any parent of B").

-Peff
Previous: Chris PackhamNext: Chris Packham
Message 2 of 4 in “Getting a list of commits between 2 points without upstream changes”
  1. Chris PackhamJul 17, 2011
  2. Jeff KingJul 18, 2011
  3. Chris PackhamJul 18, 2011
  4. Jeff KingJul 18, 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.