|
15 | 15 | * VC Delete/Rename:: Deleting and renaming version-controlled files.
|
16 | 16 | * Revision Tags:: Symbolic names for revisions.
|
17 | 17 | * Merge Bases:: The most recent revision existing on both branches.
|
| 18 | +* Outgoing Base Diffs:: Diffs including all outstanding changes on a branch. |
18 | 19 | * Other Working Trees:: Multiple sets of workfiles.
|
19 | 20 | * Version Headers:: Inserting version control headers into working files.
|
20 | 21 | * Editing VC Commands:: Editing the VC shell commands that Emacs will run.
|
@@ -298,6 +299,90 @@ on the target branch if you were to merge the source branch into it, and
|
298 | 299 | @kbd{C-x v M L} shows you a log of the changes on the source branch not
|
299 | 300 | yet merged into the target branch.
|
300 | 301 |
|
| 302 | +@node Outgoing Base Diffs |
| 303 | +@subsubsection Commands for diffs including all outstanding changes |
| 304 | +@cindex outstanding changes |
| 305 | + |
| 306 | +@table @kbd |
| 307 | +@item C-x v B = |
| 308 | +Display diffs of changes to the VC fileset since the merge base of this |
| 309 | +branch and its upstream counterpart (@code{vc-diff-outgoing-base}). |
| 310 | + |
| 311 | +@item C-x v B D |
| 312 | +Display all changes since the merge base of this branch and its upstream |
| 313 | +counterpart (@code{vc-root-diff-outgoing-base}). |
| 314 | +@end table |
| 315 | + |
| 316 | +For decentralized version control systems (@pxref{VCS Repositories}), |
| 317 | +these commands provide specialized versions of @kbd{C-x v M D} (see |
| 318 | +@pxref{Merge Bases}) which also take into account the state of upstream |
| 319 | +repositories. These commands are useful both when working on a single |
| 320 | +branch and when developing features on a separate branch |
| 321 | +(@pxref{Branches}). These two cases involve using the commands |
| 322 | +differently, and so we will describe them separately. |
| 323 | + |
| 324 | +First, consider working on a single branch. @dfn{Outstanding changes} |
| 325 | +are those which you haven't yet pushed upstream. This includes both |
| 326 | +unpushed commits and uncommitted changes in your working tree. In many |
| 327 | +cases the reason these changes are not pushed yet is that they are not |
| 328 | +finished: the changes committed so far don't make sense in isolation. |
| 329 | + |
| 330 | +@kindex C-x v B = |
| 331 | +@findex vc-diff-outgoing-base |
| 332 | +@kindex C-x v B D |
| 333 | +@findex vc-root-diff-outgoing-base |
| 334 | +Type @kbd{C-x v B D} (@code{vc-root-diff-outgoing-base}) to display a |
| 335 | +summary of all these changes, committed and uncommitted. This summary |
| 336 | +is in the form of a diff of what committing and pushing (@pxref{Pulling |
| 337 | +/ Pushing}) all these changes would do to the upstream repository. You |
| 338 | +can use @kbd{C-x v B =} (@code{vc-diff-outgoing-base}) instead to limit |
| 339 | +the display of changes to the current VC fileset. (The difference |
| 340 | +between @w{@kbd{C-x v B D}} and @w{@kbd{C-x v B =}} is like the |
| 341 | +difference between @kbd{C-x v D} and @kbd{C-x v =} (@pxref{Old |
| 342 | +Revisions}).)@footnote{Another point of comparison is that these |
| 343 | +commands are like @w{@kbd{C-x v O =}} (@code{vc-fileset-diff-outgoing}) |
| 344 | +and @kbd{C-x v O D} (@code{vc-root-diff-outgoing}) except that they |
| 345 | +include uncommitted changes in the reported diffs. Like those other |
| 346 | +commands, you can use a prefix argument to specify a particular upstream |
| 347 | +location.} |
| 348 | + |
| 349 | +Second, consider developing a feature on a separate branch. Call this |
| 350 | +the @dfn{feature branch},@footnote{Many version control workflows |
| 351 | +involve developing new features on isolated branches. However, the term |
| 352 | +``feature branch'' is usually reserved for a particular kind of isolated |
| 353 | +branch, one that other branches are repeatedly merged into. |
| 354 | + |
| 355 | +That doesn't matter to this explanation, so we use ``feature branch'' to |
| 356 | +refer to the separate branch used for developing the feature even though |
| 357 | +whether it is really a feature branch depends on other aspects of the |
| 358 | +branching workflow in use.} and call the branch from which the feature |
| 359 | +branch was originally created the @dfn{trunk} or @dfn{development |
| 360 | +trunk}. |
| 361 | + |
| 362 | +In this case, outstanding changes is a more specific notion than just |
| 363 | +unpushed and uncommitted changes on the feature branch. You're not |
| 364 | +finished sharing changes with your collaborators until they have been |
| 365 | +merged into the trunk, and pushed. Therefore, in this example, |
| 366 | +outstanding changes are those which haven't yet been integrated into the |
| 367 | +upstream repository's development trunk. That means committed changes |
| 368 | +on the feature branch that haven't yet been merged into the trunk, plus |
| 369 | +uncommitted changes. |
| 370 | + |
| 371 | +@cindex outgoing base, version control |
| 372 | +The @dfn{outgoing base} is the upstream location for which the changes |
| 373 | +are destined once they are no longer outstanding. In this case, that's |
| 374 | +the upstream version of the trunk, to which you and your collaborators |
| 375 | +push finished work. |
| 376 | + |
| 377 | +To display a summary of outgoing changes in this multi-branch example, |
| 378 | +supply a prefix argument, by typing @w{@kbd{C-u C-x v B =}} or |
| 379 | +@w{@kbd{C-u C-x v B D}}. When prompted, enter the outgoing base. |
| 380 | +Exactly what you must supply here depends on the name of your |
| 381 | +development trunk and the version control system in use. For example, |
| 382 | +with Git, usually you will enter @kbd{origin/master}. We hope to |
| 383 | +improve these commands such that no prefix argument is required in the |
| 384 | +multi-branch case, too. |
| 385 | + |
301 | 386 | @node Other Working Trees
|
302 | 387 | @subsubsection Multiple Working Trees for One Repository
|
303 | 388 |
|
|
0 commit comments