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

Re: Confusion about diffing branches

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 27, 2007, 00:18 UTC
Message-ID
<7v6431omn8.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20070826233555.GA7422@mediacenter.austin.rr.com>
Shawn Bohrer <shawn.bohrer@gmail.com> writes:
Show 13 quoted lines
> 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
>
> ...
>    git diff master...topic
>
> ... shows me the
> combined diff of A and B.
That is working as designed.

When you are working on topic it is often desired to see "what have I done since I forked?" and "what have they done while I was looking the other way?".

"git diff master topic" (which is the same as "git diff master..topic" -- the two-dot form is just a syntax sugar to avoid mistypes for people who are too used to type two dots as reflex because that is how you express a revision range) shows a squashed diff that is A+B-E, and often people found "-E" part distracting and useless. Three-dot form was invented specifically to address this problem. You do not have to (and you do not _want_ to) use that form if you _want_ to see the -E part of the diff.

Previous: Shawn BohrerNext: Shawn Bohrer
Message 2 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.