diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index f1090d4b43f..aebe31b478e 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1712,6 +1712,9 @@ Do an incremental regular expression search on the fileset Apart from acting on multiple files, these commands behave much like their single-buffer counterparts (@pxref{Search}). +@c Outstanding changes commands under 'T' are not mentioned because +@c these are an advanced feature documented only in vc1-xtra.texi. + The VC Directory buffer additionally defines some branch-related commands starting with the prefix @kbd{b}: diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi index 8ffd6506dbe..655402b61ba 100644 --- a/doc/emacs/vc1-xtra.texi +++ b/doc/emacs/vc1-xtra.texi @@ -298,11 +298,11 @@ yet merged into the target branch. @cindex outstanding changes @table @kbd -@item C-x v o = +@item C-x v T = Display diffs of changes to the VC fileset since the merge base of this branch and its upstream counterpart (@code{vc-diff-outgoing-base}). -@item C-x v o D +@item C-x v T D Display all changes since the merge base of this branch and its upstream counterpart (@code{vc-root-diff-outgoing-base}). @end table @@ -321,17 +321,17 @@ 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. -@kindex C-x v o = +@kindex C-x v T = @findex vc-diff-outgoing-base -@kindex C-x v o D +@kindex C-x v T D @findex vc-root-diff-outgoing-base -Type @kbd{C-x v o D} (@code{vc-root-diff-outgoing-base}) to display a +Type @kbd{C-x v T D} (@code{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 (@pxref{Pulling / Pushing}) all these changes would do to the upstream repository. You -can use @kbd{C-x v o =} (@code{vc-diff-outgoing-base}) instead to limit +can use @kbd{C-x v T =} (@code{vc-diff-outgoing-base}) instead to limit the display of changes to the current VC fileset. (The difference -between @w{@kbd{C-x v o D}} and @w{@kbd{C-x v o =}} is like the +between @w{@kbd{C-x v T D}} and @w{@kbd{C-x v T =}} is like the difference between @kbd{C-x v D} and @kbd{C-x v =} (@pxref{Old Revisions}).)@footnote{Another point of comparison is that these commands are like @w{@kbd{C-x v O =}} (@code{vc-fileset-diff-outgoing}) @@ -359,12 +359,12 @@ 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. -When the current branch is a topic branch and you type @kbd{C-x v o D}, +When the current branch is a topic branch and you type @kbd{C-x v T D}, Emacs displays a summary of all the changes that are outstanding against the trunk to which the current branch will be merged. This summary is in the form of a diff of what committing and pushing all the changes, @emph{and} subsequently merging the topic branch, would do to the trunk. -As above, you can use @kbd{C-x v o =} instead to limit the display of +As above, you can use @kbd{C-x v T =} instead to limit the display of changes to the current VC fileset. This functionality relies on Emacs correctly detecting whether the @@ -379,7 +379,7 @@ The variables @code{vc-trunk-branch-regexps} and @code{vc-topic-branch-regexps} contain lists of regular expressions matching the names of branches that should always be considered trunk and topic branches, respectively. You can also specify prefix arguments -to @kbd{C-x v o D} and @kbd{C-x v o =}. Here is a summary of how to use +to @kbd{C-x v T D} and @kbd{C-x v T =}. Here is a summary of how to use these controls: @enumerate @@ -425,7 +425,7 @@ described. E.g., if the value of @code{vc-trunk-branch-regexps} is branch. @item -Supply a double prefix argument, i.e. @w{@kbd{C-u C-u C-x v o @dots{}}}, +Supply a double prefix argument, i.e. @w{@kbd{C-u C-u C-x v T @dots{}}}, and Emacs will treat the current branch as a trunk, no matter what. This is useful when you simply want to obtain a diff of all outgoing changes (@pxref{VC Change Log}) plus uncommitted changes. @@ -433,7 +433,7 @@ changes (@pxref{VC Change Log}) plus uncommitted changes. @item @cindex outgoing base, version control Finally, you can take full manual control by supplying a single prefix -argument, i.e. @w{@kbd{C-u C-x v o @dots{}}}. Emacs will prompt you for +argument, i.e. @w{@kbd{C-u C-x v T @dots{}}}. Emacs will prompt you for the @dfn{outgoing base}, which is the upstream location for which the changes are destined once they are no longer outstanding. diff --git a/etc/NEWS b/etc/NEWS index 9d36f6c3d96..65c8c62dec5 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2746,11 +2746,12 @@ current VC fileset. +++ *** New commands to report diffs of outstanding changes. -'C-x v o =' ('vc-diff-outgoing-base') and 'C-x v o D' +'C-x v T =' ('vc-diff-outgoing-base') and 'C-x v T D' ('vc-root-diff-outgoing-base') report diffs of changes since the merge base with the remote branch, including uncommitted changes. They are useful to view all outstanding (unmerged, unpushed) changes on the current branch. +They are also available as 'T =' and 'T D' in VC-Dir buffers. +++ *** New user option 'vc-use-incoming-outgoing-prefixes'. diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 303cfd93ba2..b9176d8a2f6 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -397,6 +397,8 @@ That is, refreshing the VC-Dir buffer also hides `up-to-date' and (define-key map (kbd "M-s a M-C-s") #'vc-dir-isearch-regexp) (define-key map "G" #'vc-dir-ignore) (define-key map "@" #'vc-revert) + (define-key map "T=" #'vc-diff-outgoing-base) + (define-key map "TD" #'vc-root-diff-outgoing-base) (let ((branch-map (make-sparse-keymap))) (define-key map "b" branch-map) diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index e867654409c..a6e07e02de9 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -1018,8 +1018,8 @@ In the latter case, VC mode is deactivated for this buffer." "O" #'vc-root-log-outgoing "M L" #'vc-log-mergebase "M D" #'vc-diff-mergebase - "o =" #'vc-diff-outgoing-base - "o D" #'vc-root-diff-outgoing-base + "T =" #'vc-diff-outgoing-base + "T D" #'vc-root-diff-outgoing-base "m" #'vc-merge "r" #'vc-retrieve-tag "s" #'vc-create-tag