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

Confusion about diffing branches

From
Shawn Bohrer <shawn.bohrer@gmail.com>
Date
Aug 26, 2007, 23:35 UTC
Message-ID
<20070826233555.GA7422@mediacenter.austin.rr.com>

So I imagine I'm missing something, or perhaps I'm just looking at this from the wrong perspective, but here is what I'm seeing. Lets say I have something like:

         A---B topic
        /
   C---D---E master

If I want to see a diff of all of the changes between the two branches I can say:

   git diff master topic

Which shows me the combined diff of commits A, B and E. That is exactly what I would expect however, I would expect that equivalently I could say:

   git diff master...topic

to see all commits reachable from topic and master but not both. However, this doesn't do what I expect but instead only shows me the combined diff of A and B. Likewise:

   git diff topic...master

Shows me the diff of E. Am I crazy or isn't this supposed to be the behavior of the topic..master notation? Strangely enough running either

   git diff master..topic
   git diff topic..master

both show me the diff of A, B and E, which is what I would expect from the master...topic notation. Am I the only one who thinks this is backwards? The same experiment using git log shows me what I would expect so somehow I think I'm missing something.

Next: Junio C Hamano
Message 1 of 14 in “Confusion about diffing branches”
  1. Shawn BohrerAug 26, 2007
  2. Junio C HamanoAug 27, 2007
  3. Shawn BohrerAug 27, 2007
  4. Mike HommeyAug 27, 2007
  5. Junio C HamanoAug 27, 2007
  6. Mike HommeyAug 27, 2007
  7. Francis MoreauAug 27, 2007
  8. Mike HommeyAug 27, 2007
  9. Junio C HamanoAug 27, 2007
  10. Mike HommeyAug 27, 2007
  11. Theodore TsoAug 27, 2007
  12. Junio C HamanoAug 27, 2007
  13. Theodore TsoAug 27, 2007
  14. Jakub NarebskiAug 27, 2007

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.