Re: How do I get a squashed diff for review
- From
- Alexander Usov <a.s.usov@gmail.com>
- Date
- Nov 6, 2011, 02:33 UTC
- Message-ID
- <CAH_EFyZgsGPtJRUTrc2Qhkj1Tr3o9SKd6KZuBM2M5AjU-n_BQA@mail.gmail.com>
- In-Reply-To
- <7vobwq86tx.fsf@alter.siamese.dyndns.org>
On 5 November 2011 23:53, Junio C Hamano <gitster@pobox.com> wrote:
Show 18 quoted lines
> Alexander Usov <a.s.usov@gmail.com> writes: > >> 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.
Strange. I definitely remember reading about "git diff F...G" and trying it out. And somehow the result wasn't really correct -- as if commit B was chosen to be merge-base. I can't reproduce it right now on a sample repo -- will try it once more back in the office.
Thanks for help.
-- Best regards, Alexander.