diff options
| author | Sean Whitton | 2025-08-20 11:26:39 +0100 |
|---|---|---|
| committer | Sean Whitton | 2025-08-30 11:44:53 +0100 |
| commit | 14d20bff06a8832fb2ea465931e49caac5f4bc5c (patch) | |
| tree | 8821b8cab7fea7ff8502b6b1c1604c1028170d4d | |
| parent | 53f5a07bebbf9fc880de88c8624ce3ed974b48ab (diff) | |
| download | emacs-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.texi | 1 | ||||
| -rw-r--r-- | doc/emacs/maintaining.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/vc1-xtra.texi | 71 |
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 |
| 1818 | like git or Mercurial. For those systems you should use the command | 1818 | like 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}}}) |
| 1820 | instead. | 1820 | instead. |
| 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 | |||
| 227 | not the name that the makefile expects. So the program won't really | 228 | not the name that the makefile expects. So the program won't really |
| 228 | work as retrieved. | 229 | work 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 | ||
| 237 | Report diffs of changes on a branch since it diverged from another | ||
| 238 | (@code{vc-diff-mergebase}). | ||
| 239 | |||
| 240 | @item C-x v M L | ||
| 241 | Display log messages for revisions on a branch since it diverged from | ||
| 242 | another (@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. | ||
| 248 | The @dfn{merge base} of two branches is the most recent revision that | ||
| 249 | exists on both branches. If neither of the branches were ever merged | ||
| 250 | into the other (@pxref{Merging}), then the merge base is the revision | ||
| 251 | that the older of the two branches was at when the newer branch was | ||
| 252 | created from it (@pxref{Creating Branches}). If one of the branches was | ||
| 253 | ever merged into the other, then the merge base is the most recent merge | ||
| 254 | point. | ||
| 255 | |||
| 256 | With this understood, we can generalize the concept of a merge base from | ||
| 257 | branches to any two revisions. The merge base of two revisions is the | ||
| 258 | most recent revision that can be found in the revision history of both | ||
| 259 | of the two revisions.@footnote{In fact the concept generalizes to any | ||
| 260 | number of revisions, but Emacs's commands for merge bases work with only | ||
| 261 | two, so we limit ourselves to that.} | ||
| 262 | |||
| 263 | The commands described in this section are currently implemented only | ||
| 264 | for 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 | ||
| 270 | Merge bases are useful to make certain comparisons between branches, and | ||
| 271 | Emacs 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}) | ||
| 273 | prompts for two branches, finds their merge base, and then compares that | ||
| 274 | merge base with the second of the two branches. The commands report | ||
| 275 | diffs and display change history, respectively. | ||
| 276 | |||
| 277 | The typical use case for these commands is when one of the branches was | ||
| 278 | originally created from the other and you or a collaborator have made | ||
| 279 | merges of one of the branches into the other at least once. Then you | ||
| 280 | can use these commands to see what changes on one branch have not yet | ||
| 281 | been merged into the other. | ||
| 282 | |||
| 283 | Call the branch which has the changes you are interested in the ``source | ||
| 284 | branch'' and the branch into which these changes have not yet been | ||
| 285 | merged the ``target branch''. Specify the target branch when prompted | ||
| 286 | for the ``older revision'' and the source branch when prompted for the | ||
| 287 | ``newer revision''.@footnote{The concept of merge bases generalizes from | ||
| 288 | branches to any two revisions. The merge base of two revisions is the | ||
| 289 | most recent revision that can be found in the revision history of both | ||
| 290 | of the two revisions. @kbd{C-x v M D} and @kbd{C-x v M L} accept any | ||
| 291 | two revisions, not just branches. Comparing two branches is the same as | ||
| 292 | comparing the revisions at the ends of the branches. | ||
| 293 | |||
| 294 | (In fact the concept generalizes to any number of revisions, but Emacs's | ||
| 295 | commands for merge bases work with only two, so we limit ourselves to | ||
| 296 | that.)} Then @kbd{C-x v M D} shows you a preview of what would change | ||
| 297 | on 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 | ||
| 299 | yet 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 | ||