From: Junio C Hamano Date: Thu, 3 May 2012 22:36:15 +0000 (-0700) Subject: Merge branch 'jc/merge-reduce-parents-early' into maint X-Git-Tag: v1.7.10.2~29 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/edf141218e4e4ecca3a8ab0c8fa9eafe381b3838 Merge branch 'jc/merge-reduce-parents-early' into maint Octopus merge strategy did not reduce heads that are recorded in the final commit correctly. By Junio C Hamano (4) and MichaƂ Kiedrowicz (1) * jc/merge-reduce-parents-early: fmt-merge-msg: discard needless merge parents builtin/merge.c: reduce parents early builtin/merge.c: collect other parents early builtin/merge.c: remove "remoteheads" global variable merge tests: octopus with redundant parents --- edf141218e4e4ecca3a8ab0c8fa9eafe381b3838 diff --cc builtin/merge.c index 08e01e8a60,20aeca0b3c..470fc57c5d --- a/builtin/merge.c +++ b/builtin/merge.c @@@ -905,14 -904,14 +906,14 @@@ static void prepare_to_commit(struct co write_merge_msg(&msg); run_hook(get_index_file(), "prepare-commit-msg", git_path("MERGE_MSG"), "merge", NULL, NULL); - if (option_edit) { + if (0 < option_edit) { if (launch_editor(git_path("MERGE_MSG"), NULL, NULL)) - abort_commit(NULL); + abort_commit(remoteheads, NULL); } read_merge_msg(&msg); - stripspace(&msg, option_edit); + stripspace(&msg, 0 < option_edit); if (!msg.len) - abort_commit(_("Empty commit message.")); + abort_commit(remoteheads, _("Empty commit message.")); strbuf_release(&merge_msg); strbuf_addbuf(&merge_msg, &msg); strbuf_release(&msg); @@@ -1330,10 -1356,13 +1356,12 @@@ int cmd_merge(int argc, const char **ar } if (option_edit < 0) - option_edit = 0; + option_edit = default_edit_option(); if (!use_strategies) { - if (!remoteheads->next) + if (!remoteheads) + ; /* already up-to-date */ + else if (!remoteheads->next) add_strategies(pull_twohead, DEFAULT_TWOHEAD); else add_strategies(pull_octopus, DEFAULT_OCTOPUS);