M-x all-things-emacs

Quick Tip: Managing ChangeLogs

May 29th, 2007 by Ryan McGeary · 1 Comment

Ever wonder how people keep such organized ChangeLog files in the root of their source trees? I’m sure some are just anal enough to manually manage them. I know I’ve done so on smaller projects, but I find it too much of a hassle for anything larger.

So, what do people use on larger projects? Believe it or not, there are actually GNU conventions for styling these files, and emacs includes an add-log package to help adhere to these conventions.

The command add-change-log-entry-other-window (C-x 4 a) automatically adds a new entry to the closest change log file found up the parent directory hierarchy. If none exists, a new change log file is created in your current directory, and the formatting is organized for you:

ChangeLog Example

The command vc-update-change-log (C-x v a) finds the change log file and add entries from the recent version control logs. Apparently, this only works with RCS or CVS. For subversion, you can try vc-comment-to-change-log (Emacs 21) or log-edit-comment-to-change-log (Emacs 22), but this might require some customization to suit you.

To change the email address listed in your change log entries, edit the user-mail-address variable. To change the default change log file name, edit the change-log-default-name variable.

(setq user-mail-address "ryan@example.com")  ;; default: user@host
(setq change-log-default-name "CHANGELOG")   ;; default: ChangeLog

Some might say that keeping a ChangeLog file is defeated by public subversion repositories. I tend to agree for most circumstances, but there are some cases where a local, easily readable ChangeLog file is a good idea. Besides, it’s the cool thing to do.

The emacs manual has more information on change logs.

Tags: quick · tips

1 response so far ↓

  • 1 Friedel // Jun 1, 2008 at 4:52 pm

    Recently I can also press C-c C-a in an svn-log window to add the last changelog entry :)