/* git-merge-changelog - git "merge" driver for GNU style ChangeLog files.
- Copyright (C) 2008-2009 Bruno Haible <bruno@clisp.org>
+ Copyright (C) 2008-2010 Bruno Haible <bruno@clisp.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
/* Installation:
+
$ gnulib-tool --create-testdir --dir=/tmp/testdir123 git-merge-changelog
$ cd /tmp/testdir123
$ ./configure
$ make
$ make install
- - Add to .git/config of the checkout (or to your $HOME/.gitconfig) the lines
- [merge "merge-changelog"]
- name = GNU-style ChangeLog merge driver
- driver = /usr/local/bin/git-merge-changelog %O %A %B
+ Additionally, for git users:
+ - Add to .git/config of the checkout (or to your $HOME/.gitconfig) the
+ lines
+
+ [merge "merge-changelog"]
+ name = GNU-style ChangeLog merge driver
+ driver = /usr/local/bin/git-merge-changelog %O %A %B
+
+ - In every directory that contains a ChangeLog file, add a file
+ '.gitattributes' with this line:
+
+ ChangeLog merge=merge-changelog
+
+ (See "man 5 gitattributes" for more info.)
+
+ Additionally, for bzr users:
+ - Install the 'extmerge' bzr plug-in listed at
+ <http://doc.bazaar.canonical.com/plugins/en/index.html>
+ <http://wiki.bazaar.canonical.com/BzrPlugins>
+ - Add to your $HOME/.bazaar/bazaar.conf the line
- - In every directory that contains a ChangeLog file, add a file
- '.gitattributes' with this line:
+ external_merge = git-merge-changelog %b %T %o
- ChangeLog merge=merge-changelog
+ - Then, to merge a conflict in a ChangeLog file, use
+
+ $ bzr extmerge ChangeLog
+
+ Additionally, for hg users:
+ - Add to your $HOME/.hgrc the lines
+
+ [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
+
+ See <http://www.selenic.com/mercurial/hgrc.5.html> section merge-tools
+ for reference.
+ */
- (See "man 5 gitattributes" for more info.)
+/* Use as an alternative to 'diff3':
+ git-merge-changelog performs the same role as "diff3 -m", just with
+ reordered arguments:
+ $ git-merge-changelog %O %A %B
+ is comparable to
+ $ diff3 -m %A %O %B
*/
/* Calling convention:
{ NULL, 0, NULL, 0 }
};
-/* Print a usage mesage and exit. */
+/* Print a usage message and exit. */
static void
usage (int status)
{
if (status != EXIT_SUCCESS)
- fprintf (stderr, "Try `%s --help' for more information.\n",
+ fprintf (stderr, "Try '%s --help' for more information.\n",
program_name);
else
{
printf ("B-FILE-NAME names the user-modified file.\n");
printf ("Writes the merged file into A-FILE-NAME.\n");
printf ("\n");
+ #if 0 /* --split-merged-entry is now on by default. */
printf ("Operation modifiers:\n");
printf ("\
--split-merged-entry Possibly split a merged entry between paragraphs.\n\
newline, just because they happened on the same\n\
date.\n");
printf ("\n");
+ #endif
printf ("Informative output:\n");
printf (" -h, --help display this help and exit\n");
printf (" -V, --version output version information and exit\n");
printf ("\n");
- fputs ("Report bugs to <bug-gnu-gettext@gnu.org>.\n",
+ fputs ("Report bugs to <bug-gnulib@gnu.org>.\n",
stdout);
}
/* Set default values for variables. */
do_help = false;
do_version = false;
- split_merged_entry = false;
+ split_merged_entry = true;
/* Parse command line options. */
while ((optchar = getopt_long (argc, argv, "hV", long_options, NULL)) != EOF)
do_version = true;
break;
case CHAR_MAX + 1: /* --split-merged-entry */
- split_merged_entry = true;
break;
default:
usage (EXIT_FAILURE);