89734301bc introduced a new useful feature
to `git upstream-diff`, but unfortunately also regressed the behavior
of the tool when used with additional arguments for `git diff`.
This adds some additional documentation to demonstrate the intended
original feature (and fixes some of the bit-rot in the documentation
pipeline).
R=agable@chromium.org, mattm@chromium.org
Change-Id: I3ae48db3232c1ac84a7edbfe2225a17cda391a1e
Reviewed-on: https://chromium-review.googlesource.com/1107491
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
<divclass="paragraph"><p>Shows a diff between a branch and its upstream. If the branch is omitted, the tool shows the diff for the current branch. This is <em>roughly</em> the same as:</p></div>
<divclass="paragraph"><p>Shows a diff between a branch and its upstream. If the --branch option is
omitted or "HEAD", the tool shows the diff for the current branch. Any
additional arguments are passed through to the underlying git-diff command. This
@ -32,12 +32,12 @@ git-upstream-diff \- Print a diff of the current branch, compared to its upstrea
.SH"SYNOPSIS"
.sp
.nf
\fIgit upstream\-diff\fR [\-\-wordwise] [branch] [<extra args for git\-diff>*]
\fIgit upstream\-diff\fR [\-\-wordwise] [\-\-branch branch] [<extra args for git\-diff>*]
.fi
.sp
.SH"DESCRIPTION"
.sp
Shows a diff between a branch and its upstream\&. If the branch is omitted, the tool shows the diff for the current branch\&. This is \fIroughly\fR the same as:
Shows a diff between a branch and its upstream\&. If the \-\-branch option is omitted or "HEAD", the tool shows the diff for the current branch\&. Any additional arguments are passed through to the underlying git\-diff command\&. This is \fIroughly\fR the same as:
.sp
.ifn\{\
.RS4
@ -60,6 +60,27 @@ uses the patience\-diff algorithm, which tends to produce nicer diffs in many ca
The difference is that branch@{upstream} is actually the tagged merge base of your branch (See \fBgit-rebase-update\fR(1))\&. This means that if your upstream branch was rebased, but you haven\(cqt yet rebased the current branch on top of it, you\(cqll still see an accurate diff compared to just diffing against @{upstream}\&.
.sp
The \-\-wordwise option also allows git\-diff to do word\-by\-word comparison in a semi\-intelligent way\&. However, sometimes it can produce surprising results, so it is disabled by default\&.
.sp
Since any additional options are passed through to git\-diff unchanged, you can use this as a general replacement for git diff for things like:
.sp
.ifn\{\
.RS4
.\}
.nf
$ # See what changed in a file on the current branch
'git upstream-diff' [--wordwise] [branch] [<extra args for git-diff>*]
'git upstream-diff' [--wordwise] [--branch branch] [<extra args for git-diff>*]
DESCRIPTION
-----------
Shows a diff between a branch and its upstream. If the branch is omitted, the tool shows the diff for the current branch. This is 'roughly' the same as:
Shows a diff between a branch and its upstream. If the --branch option is
omitted or "HEAD", the tool shows the diff for the current branch. Any
additional arguments are passed through to the underlying git-diff command. This