Display diffs of changes to the VC fileset since the merge base of this
branch and its upstream counterpart (vc-diff-outgoing-base).
Display all changes since the merge base of this branch and its upstream
counterpart (vc-root-diff-outgoing-base).
For decentralized version control systems (see Decentralized vs Centralized Repositories), these commands provide specialized versions of C-x v M D (see see Merge Bases) which also take into account the state of upstream repositories. These commands are useful both when working on a single branch and when developing features on a separate branch (see Version Control Branches). These two cases involve using the commands differently, and so we will describe them separately.
First, consider working on a single branch. Outstanding changes are those which you haven’t yet pushed upstream. This includes both unpushed commits and uncommitted changes in your working tree. In many cases the reason these changes are not pushed yet is that they are not finished: the changes committed so far don’t make sense in isolation.
Type C-x v o D (vc-root-diff-outgoing-base) to display a
summary of all these changes, committed and uncommitted. This summary
is in the form of a diff of what committing and pushing (see Pulling/Pushing Changes into/from a Branch) all these changes would do to the upstream repository. You
can use C-x v o = (vc-diff-outgoing-base) instead to limit
the display of changes to the current VC fileset. (The difference
between C-x v o D and C-x v o = is like the
difference between C-x v D and C-x v = (see Examining And Comparing Old Revisions).)21
Second, consider developing a feature on a separate branch. Call this the topic branch,22 and call the branch from which the topic branch was originally created the trunk or development trunk.
In this case, outstanding changes is a more specific notion than just unpushed and uncommitted changes on the topic branch. You’re not finished sharing changes with your collaborators until they have been merged into the trunk, and pushed. Therefore, in this example, outstanding changes are those which haven’t yet been integrated into the upstream repository’s development trunk. That means committed changes on the topic branch that haven’t yet been merged into the trunk, plus uncommitted changes.
The outgoing base is the upstream location for which the changes are destined once they are no longer outstanding. In this case, that’s the upstream version of the trunk, to which you and your collaborators push finished work.
To display a summary of outgoing changes in this multi-branch example, supply a prefix argument, by typing C-u C-x v o = or C-u C-x v o D. When prompted, enter the outgoing base. Exactly what you must supply here depends on the name of your development trunk and the version control system in use. For example, with Git, usually you will enter origin/master. We hope to improve these commands such that no prefix argument is required in the multi-branch case, too.
Another point of comparison is that these
commands are like C-x v O = (vc-fileset-diff-outgoing)
and C-x v O D (vc-root-diff-outgoing) except that they
include uncommitted changes in the reported diffs. Like those other
commands, you can use a prefix argument to specify a particular upstream
location.
Topic branches are sometimes called “feature branches”. It is also common for the term “feature branch” to be reserved for a particular kind of topic branch, one that another branch or other branches are repeatedly merged into.