summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f3ef6b6)
raw | patch | inline | side by side (parent: f3ef6b6)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 18 Apr 2007 08:47:21 +0000 (01:47 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 18 Apr 2007 08:50:00 +0000 (01:50 -0700) |
When no 'merge' attribute is given to a path, merge-recursive
uses the built-in xdl-merge as the low-level merge driver.
A new configuration item 'merge.default' can name a low-level
merge driver of user's choice to be used instead.
Signed-off-by: Junio C Hamano <junkio@cox.net>
uses the built-in xdl-merge as the low-level merge driver.
A new configuration item 'merge.default' can name a low-level
merge driver of user's choice to be used instead.
Signed-off-by: Junio C Hamano <junkio@cox.net>
merge-recursive.c | patch | blob | history |
diff --git a/merge-recursive.c b/merge-recursive.c
index 8ec18ad5779c5c1de254411167533eb6ac55089f..5983000971dbe5f71156f941beceb1a9911bf864 100644 (file)
--- a/merge-recursive.c
+++ b/merge-recursive.c
char *cmdline;
char b_[1];
} *ll_user_merge_fns, **ll_user_merge_fns_tail;
+static const char *default_ll_merge;
static int read_merge_config(const char *var, const char *value)
{
struct user_merge_fn *fn;
int blen, nlen;
+ if (!strcmp(var, "merge.default")) {
+ default_ll_merge = strdup(value);
+ return 0;
+ }
+
if (strcmp(var, "merge.driver"))
return 0;
if (!value)
return ll_xdl_merge;
else if (ATTR_FALSE(merge_attr))
return ll_binary_merge;
- else if (ATTR_UNSET(merge_attr))
- return ll_xdl_merge;
+ else if (ATTR_UNSET(merge_attr)) {
+ if (!default_ll_merge)
+ return ll_xdl_merge;
+ else
+ name = default_ll_merge;
+ }
else
name = merge_attr;