Merge branch 'jn/merge-renormalize'
* jn/merge-renormalize: merge-recursive --renormalize rerere: never renormalize rerere: migrate to parse-options API t4200 (rerere): modernize style ll-merge: let caller decide whether to renormalize ll-merge: make flag easier to populate Documentation/technical: document ll_merge merge-trees: let caller decide whether to renormalize merge-trees: push choice to renormalize away from low level t6038 (merge.renormalize): check that it can be turned off t6038 (merge.renormalize): try checkout -m and cherry-pick t6038 (merge.renormalize): style nitpicks Don't expand CRLFs when normalizing text during merge Try normalizing files to avoid delete/modify conflicts when merging Avoid conflicts when merging branches with mixed normalization Conflicts: builtin/rerere.c t/t4200-rerere.sh
This commit is contained in:
@ -54,6 +54,7 @@ static size_t use_strategies_nr, use_strategies_alloc;
|
||||
static const char **xopts;
|
||||
static size_t xopts_nr, xopts_alloc;
|
||||
static const char *branch;
|
||||
static int option_renormalize;
|
||||
static int verbosity;
|
||||
static int allow_rerere_auto;
|
||||
|
||||
@ -504,6 +505,8 @@ static int git_merge_config(const char *k, const char *v, void *cb)
|
||||
return git_config_string(&pull_octopus, k, v);
|
||||
else if (!strcmp(k, "merge.log") || !strcmp(k, "merge.summary"))
|
||||
option_log = git_config_bool(k, v);
|
||||
else if (!strcmp(k, "merge.renormalize"))
|
||||
option_renormalize = git_config_bool(k, v);
|
||||
return git_diff_ui_config(k, v, cb);
|
||||
}
|
||||
|
||||
@ -625,6 +628,11 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
|
||||
if (!strcmp(strategy, "subtree"))
|
||||
o.subtree_shift = "";
|
||||
|
||||
o.renormalize = option_renormalize;
|
||||
|
||||
/*
|
||||
* NEEDSWORK: merge with table in builtin/merge-recursive
|
||||
*/
|
||||
for (x = 0; x < xopts_nr; x++) {
|
||||
if (!strcmp(xopts[x], "ours"))
|
||||
o.recursive_variant = MERGE_RECURSIVE_OURS;
|
||||
@ -634,6 +642,10 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
|
||||
o.subtree_shift = "";
|
||||
else if (!prefixcmp(xopts[x], "subtree="))
|
||||
o.subtree_shift = xopts[x]+8;
|
||||
else if (!strcmp(xopts[x], "renormalize"))
|
||||
o.renormalize = 1;
|
||||
else if (!strcmp(xopts[x], "no-renormalize"))
|
||||
o.renormalize = 0;
|
||||
else
|
||||
die("Unknown option for merge-recursive: -X%s", xopts[x]);
|
||||
}
|
||||
@ -818,7 +830,7 @@ static int finish_automerge(struct commit_list *common,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int suggest_conflicts(void)
|
||||
static int suggest_conflicts(int renormalizing)
|
||||
{
|
||||
FILE *fp;
|
||||
int pos;
|
||||
@ -1303,5 +1315,5 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
||||
"stopped before committing as requested\n");
|
||||
return 0;
|
||||
} else
|
||||
return suggest_conflicts();
|
||||
return suggest_conflicts(option_renormalize);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user