16 Mar 2012 mjw   » (Master)

Automagically merging ChangeLog files with mercurial or git

When a project keeps a GNU style ChangeLog file to keep track of who changed what where then those files can be automagically merged if you use mercurial or git.

gnulib contains a module git-merge-changelog, which despite the name work perfectly with several version control systems.

To install it:

git clone git://git.savannah.gnu.org/gnulib.git
cd gnulib
./gnulib-tool --create-testdir --dir=/tmp/testdir123 git-merge-changelog
cd /tmp/testdir123
./configure
make
make install

For Mercurial add the following lines to your ~/.hgrc:

[merge-patterns]
ChangeLog = git-merge-changelog

[merge-tools]
git-merge-changelog.executable = /usr/local/bin/git-merge-changelog
git-merge-changelog.args = $base $local $other

For git add the following lines to your ~/.gitconfig

[merge "merge-changelog"]
	name = GNU-style ChangeLog merge driver
	driver = /usr/local/bin/git-merge-changelog %O %A %B

And never worry again about having to manually merge ChangeLog files.

Syndicated 2012-03-16 21:45:59 from Mark J. Wielaard

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!