5.6 Committing changes

Committing changes basically works as follows:

  1. After having selected the files you want to commit, you type either c or C which brings up a special buffer *cvs-commit*.
  2. You type in the log message describing the changes you’re about to commit (see Editing a Log Message).
  3. When you’re happy with it, you type C-c C-c to do the actual commit.

There’s no hidden state, so you can abort the process or pick it up again at any time.

The set of files actually committed is really decided only during the very last step, which is a mixed blessing. It allows you to go back and change your mind about which files to commit, but it also means that you might inadvertently change the set of selected files. To reduce the risk of error, C-c C-c will ask for confirmation if the set of selected files has changed between the first step and the last. You can change this last detail with log-edit-confirm.

As for the difference between c (i.e., cvs-mode-commit) and C (i.e., cvs-mode-commit-setup) is that the first gets you straight to *cvs-commit* without erasing it or changing anything to its content, while the second first erases *cvs-commit* and tries to initialize it with a sane default (it does that by either using a template provided by the CVS administrator or by extracting a relevant log message from a ChangeLog file).

If you are editing the files in your Emacs, an automatic ‘revert-buffer’ will be performed. (If the file contains ‘$Id: Committing-changes.html,v 1.21 2024/01/18 13:15:47 eliz Exp $’ keywords, ‘cvs commit’ will write a new file with the new values substituted. The auto-revert makes sure that you get them into your buffer.) The revert will not occur if you have modified your buffer, or if ‘cvs-auto-revert’ is set to ‘nil’.