From 58a1ece478c6038a7eb0b6e494d563bd5e6d5978 Mon Sep 17 00:00:00 2001 From: Justin Frankel Date: Thu, 26 Aug 2010 00:50:45 -0500 Subject: merge-recursive --patience Teach the merge-recursive strategy a --patience option to use the "patience diff" algorithm, which tends to improve results when cherry-picking a patch that reorders functions at the same time as refactoring them. To support this, struct merge_options and ll_merge_options gain an xdl_opts member, so programs can use arbitrary xdiff flags (think "XDF_IGNORE_WHITESPACE") in a git-aware merge. git merge and git rebase can be passed the -Xpatience option to use this. [jn: split from --ignore-space patch; with documentation] Signed-off-by: Justin Frankel Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- merge-recursive.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'merge-recursive.c') diff --git a/merge-recursive.c b/merge-recursive.c index 0e9a29d32..3e67f8145 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -613,6 +613,7 @@ static int merge_3way(struct merge_options *o, int merge_status; ll_opts.renormalize = o->renormalize; + ll_opts.xdl_opts = o->xdl_opts; if (o->call_depth) { ll_opts.virtual_ancestor = 1; @@ -1512,6 +1513,8 @@ int parse_merge_opt(struct merge_options *o, const char *s) o->subtree_shift = ""; else if (!prefixcmp(s, "subtree=")) o->subtree_shift = s + strlen("subtree="); + else if (!strcmp(s, "patience")) + o->xdl_opts |= XDF_PATIENCE_DIFF; else if (!strcmp(s, "renormalize")) o->renormalize = 1; else if (!strcmp(s, "no-renormalize")) -- cgit v1.2.1