aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Whitton2025-08-20 11:26:39 +0100
committerSean Whitton2025-08-30 11:44:53 +0100
commit14d20bff06a8832fb2ea465931e49caac5f4bc5c (patch)
tree8821b8cab7fea7ff8502b6b1c1604c1028170d4d
parent53f5a07bebbf9fc880de88c8624ce3ed974b48ab (diff)
downloademacs-14d20bff06a8832fb2ea465931e49caac5f4bc5c.tar.gz
emacs-14d20bff06a8832fb2ea465931e49caac5f4bc5c.zip
Document C-x v M D and C-x v M L in the manual
* doc/emacs/emacs.texi (Merge Bases): * doc/emacs/vc1-xtra.texi (Merge Bases): New node.
-rw-r--r--doc/emacs/emacs.texi1
-rw-r--r--doc/emacs/maintaining.texi2
-rw-r--r--doc/emacs/vc1-xtra.texi71
3 files changed, 73 insertions, 1 deletions
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index b373dc092f8..4b625f99f52 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -868,6 +868,7 @@ Miscellaneous Commands and Features of VC
868* Change Logs and VC:: Generating a change log file from log entries. 868* Change Logs and VC:: Generating a change log file from log entries.
869* VC Delete/Rename:: Deleting and renaming version-controlled files. 869* VC Delete/Rename:: Deleting and renaming version-controlled files.
870* Revision Tags:: Symbolic names for revisions. 870* Revision Tags:: Symbolic names for revisions.
871* Merge Bases:: The most recent revision existing on both branches.
871* Other Working Trees:: Multiple sets of workfiles. 872* Other Working Trees:: Multiple sets of workfiles.
872* Version Headers:: Inserting version control headers into working files. 873* Version Headers:: Inserting version control headers into working files.
873* Editing VC Commands:: Editing the VC shell commands that Emacs will run. 874* Editing VC Commands:: Editing the VC shell commands that Emacs will run.
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 3de00fe8684..5801604204c 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -1815,7 +1815,7 @@ and so on, depending on the number of existing branches at that point.
1815@kindex C-x v b c 1815@kindex C-x v b c
1816@findex vc-create-branch 1816@findex vc-create-branch
1817 This procedure will not work for distributed version control systems 1817 This procedure will not work for distributed version control systems
1818like git or Mercurial. For those systems you should use the command 1818like Git or Mercurial. For those systems you should use the command
1819@code{vc-create-branch} (@w{@kbd{C-x v b c @var{branch-name} @key{RET}}}) 1819@code{vc-create-branch} (@w{@kbd{C-x v b c @var{branch-name} @key{RET}}})
1820instead. 1820instead.
1821 1821
diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi
index 72e660a2def..8830b93c91a 100644
--- a/doc/emacs/vc1-xtra.texi
+++ b/doc/emacs/vc1-xtra.texi
@@ -14,6 +14,7 @@
14* Change Logs and VC:: Generating a change log file from log entries. 14* Change Logs and VC:: Generating a change log file from log entries.
15* VC Delete/Rename:: Deleting and renaming version-controlled files. 15* VC Delete/Rename:: Deleting and renaming version-controlled files.
16* Revision Tags:: Symbolic names for revisions. 16* Revision Tags:: Symbolic names for revisions.
17* Merge Bases:: The most recent revision existing on both branches.
17* Other Working Trees:: Multiple sets of workfiles. 18* Other Working Trees:: Multiple sets of workfiles.
18* Version Headers:: Inserting version control headers into working files. 19* Version Headers:: Inserting version control headers into working files.
19* Editing VC Commands:: Editing the VC shell commands that Emacs will run. 20* Editing VC Commands:: Editing the VC shell commands that Emacs will run.
@@ -227,6 +228,76 @@ an old tag, the renamed file is retrieved under its new name, which is
227not the name that the makefile expects. So the program won't really 228not the name that the makefile expects. So the program won't really
228work as retrieved. 229work as retrieved.
229 230
231@node Merge Bases
232@subsubsection Merge Bases
233@cindex merge bases
234
235@table @kbd
236@item C-x v M D
237Report diffs of changes on a branch since it diverged from another
238(@code{vc-diff-mergebase}).
239
240@item C-x v M L
241Display log messages for revisions on a branch since it diverged from
242another (@code{vc-log-mergebase}).
243@end table
244
245@c This definition is possibly dVCS-specific -- can revisions exist on
246@c more than one branch for older VCS? This needs thinking through if
247@c any of our centalized VCS gain support for these commands.
248The @dfn{merge base} of two branches is the most recent revision that
249exists on both branches. If neither of the branches were ever merged
250into the other (@pxref{Merging}), then the merge base is the revision
251that the older of the two branches was at when the newer branch was
252created from it (@pxref{Creating Branches}). If one of the branches was
253ever merged into the other, then the merge base is the most recent merge
254point.
255
256With this understood, we can generalize the concept of a merge base from
257branches to any two revisions. The merge base of two revisions is the
258most recent revision that can be found in the revision history of both
259of the two revisions.@footnote{In fact the concept generalizes to any
260number of revisions, but Emacs's commands for merge bases work with only
261two, so we limit ourselves to that.}
262
263The commands described in this section are currently implemented only
264for decentralized version control systems (@pxref{VCS Repositories}).
265
266@kindex C-x v M D
267@findex vc-diff-mergebase
268@kindex C-x v M L
269@findex vc-log-mergebase
270Merge bases are useful to make certain comparisons between branches, and
271Emacs provides two commands for doing so. Each of @kbd{C-x v M D}
272(@code{vc-diff-mergebase}) and @kbd{C-x v M L} (@code{vc-log-mergebase})
273prompts for two branches, finds their merge base, and then compares that
274merge base with the second of the two branches. The commands report
275diffs and display change history, respectively.
276
277The typical use case for these commands is when one of the branches was
278originally created from the other and you or a collaborator have made
279merges of one of the branches into the other at least once. Then you
280can use these commands to see what changes on one branch have not yet
281been merged into the other.
282
283Call the branch which has the changes you are interested in the ``source
284branch'' and the branch into which these changes have not yet been
285merged the ``target branch''. Specify the target branch when prompted
286for the ``older revision'' and the source branch when prompted for the
287``newer revision''.@footnote{The concept of merge bases generalizes from
288branches to any two revisions. The merge base of two revisions is the
289most recent revision that can be found in the revision history of both
290of the two revisions. @kbd{C-x v M D} and @kbd{C-x v M L} accept any
291two revisions, not just branches. Comparing two branches is the same as
292comparing the revisions at the ends of the branches.
293
294(In fact the concept generalizes to any number of revisions, but Emacs's
295commands for merge bases work with only two, so we limit ourselves to
296that.)} Then @kbd{C-x v M D} shows you a preview of what would change
297on the target branch if you were to merge the source branch into it, and
298@kbd{C-x v M L} shows you a log of the changes on the source branch not
299yet merged into the target branch.
300
230@node Other Working Trees 301@node Other Working Trees
231@subsubsection Multiple Working Trees for One Repository 302@subsubsection Multiple Working Trees for One Repository
232 303