From: David Aguilar <davvid@gmail.com>
To: Alexander Usov <a.s.usov@gmail.com>
Cc: git@vger.kernel.org, Roland Kaufmann <rlndkfmn+git@gmail.com>
Subject: Re: How do I get a squashed diff for review
Date: Sat, 5 Nov 2011 02:15:15 -0700 [thread overview]
Message-ID: <20111105091514.GA97860@gmail.com> (raw)
In-Reply-To: <CAH_EFyZ_0JB0-5cw-6VEJkfJhSjbmA=3upByQ3YpmnVSvR+9Pg@mail.gmail.com>
On Fri, Nov 04, 2011 at 07:15:01PM +0000, Alexander Usov wrote:
> Hi,
>
> I'm wondering if there is an easy way to get a squashed diff of the
> changes done on the feature branch for review.
> In the simple cases (where feature branch is linear) there is an
> absolutely fantastic way to get a patch for review:
> git diff master...feature
>
> However if the feature branch happened to be long-lived and had
> mainline merged into it it's not going to work -- the
> resulting diff would contain changes from the merge. The way we are
> doing things now is to merge master into it
> once more and then diff, however this is somewhat cumbersome. Is there
> easier way to do it?
"git diff A...B" is equivalent to "git diff <merge-base A B> B".
The merge-base can be found with "git merge-base A B"
and is simply the common ancestor of A and B.
Diffing against the merge base (which doesn't contain the merged
work done in master) is why you're seeing the merges in the diff.
It sounds like you want the simpler form of "diff" which doesn't
do any merge-base calculation.
e.g. "git diff A B" and its synonymn "git diff A..B".
> And while we are on the topic -- is there a tool for git similar to "bzr qdiff"?
> It's a simple graphical diff viewer with 2 nice features -- it shows
> complete diff (of multiple files) in a single window and
> has a checkbox to switch between diff-only & full-text modes.
> I have seen difftool, but it seems to work on per-file basis, and
> something like "vi <(git diff ...)" lacks the easy way to
> switch into full-text mode.
difftool is a wrapper around specialized diff tools, so the
ability to switch from diff to full view is tool-dependent.
A contrib "git-dirdiff" script was posted to the list recently.
It builds upon diff tools that can diff directory trees.
http://thread.gmane.org/gmane.comp.version-control.git/184528
There may be a newer version of this script, too. Roland would
know for sure...
--
David
next prev parent reply other threads:[~2011-11-05 9:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-04 19:15 How do I get a squashed diff for review Alexander Usov
2011-11-05 9:15 ` David Aguilar [this message]
2011-11-05 17:56 ` Alexander Usov
2011-11-05 23:53 ` Junio C Hamano
2011-11-06 2:33 ` Alexander Usov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111105091514.GA97860@gmail.com \
--to=davvid@gmail.com \
--cc=a.s.usov@gmail.com \
--cc=git@vger.kernel.org \
--cc=rlndkfmn+git@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).