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

Re: How do I get a squashed diff for review

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 5, 2011, 23:53 UTC
Message-ID
<7vobwq86tx.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAH_EFyYUja4cKY5YM4Uqn-bnQZCnhnJCNsxGsUitL+SSqj9qxQ@mail.gmail.com>
Alexander Usov <a.s.usov@gmail.com> writes:
Show 10 quoted lines
> Consider the following history:
>
> master: A---B---D---F
>             \    \
> branch:      .-C--E--G
>
> ...
> - "git diff D..branch" would do a trick, but I'm not sure how to
> correctly determine
> D (if I'm to write a script).

D is the merge-base between F and G. So "git diff $(git merge-base F G) G" would compare D and G.

Modern git lets you write it as "git diff F...G" as this is a fairly useful short-hand.

Previous: Alexander UsovNext: Alexander Usov
Message 4 of 5 in “How do I get a squashed diff for review”
  1. Alexander UsovNov 4, 2011
  2. David AguilarNov 5, 2011
  3. Alexander UsovNov 5, 2011
  4. Junio C HamanoNov 5, 2011
  5. Alexander UsovNov 6, 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.