{"thread":{"id":"39847","subject":"[PATCH] rerere-autocommit option is added to facilitate auto-merge when rerere resolves all the conflicts automatically.","startedAt":"2015-07-14T10:28:19Z","lastAt":"2015-07-14T10:28:19Z","messageCount":1,"participants":["Sunil Kata"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"266115","messageId":"1436869699-52765-1-git-send-email-katasunil@gmail.com","threadId":"39847","inReplyTo":null,"subject":"[PATCH] rerere-autocommit option is added to facilitate auto-merge when rerere resolves all the conflicts automatically.","fromName":"Sunil Kata","fromEmail":"katasunil@gmail.com","sentAt":"2015-07-14T10:28:19Z","receivedAt":"2015-07-14T10:28:19Z","isPatch":true,"sender":{"key":"katasunil@gmail.com","avatar":null},"body":"Signed-off-by: Sunil Kata <katasunil@gmail.com>\n---\n Documentation/git-merge.txt | 8 +++++++-\n builtin/merge.c             | 8 +++++++-\n rerere.h                    | 2 ++\n 3 files changed, 16 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt\nindex 273a100..6c60286 100644\n--- a/Documentation/git-merge.txt\n+++ b/Documentation/git-merge.txt\n@@ -11,7 +11,8 @@ SYNOPSIS\n [verse]\n 'git merge' [-n] [--stat] [--no-commit] [--squash] [--[no-]edit]\n \t[-s <strategy>] [-X <strategy-option>] [-S[<key-id>]]\n-\t[--[no-]rerere-autoupdate] [-m <msg>] [<commit>...]\n+\t[--[no-]rerere-autoupdate] [--rerere-autocommit]\n+\t[-m <msg>] [<commit>...]\n 'git merge' <msg> HEAD <commit>...\n 'git merge' --abort\n \n@@ -84,6 +85,11 @@ invocations.\n \tAllow the rerere mechanism to update the index with the\n \tresult of auto-conflict resolution if possible.\n \n+--rerere-autocommit::\n+\tAllow the rerere mechanism to auto merge after updating\n+\tthe index with the result of auto-conflict resolution\n+\tif possible\n+\n --abort::\n \tAbort the current conflict resolution process, and\n \ttry to reconstruct the pre-merge state.\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 85c54dc..7142567 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -63,6 +63,7 @@ static char *branch_mergeoptions;\n static int option_renormalize;\n static int verbosity;\n static int allow_rerere_auto;\n+static int allow_rerere_commit;\n static int abort_current_merge;\n static int show_progress = -1;\n static int default_to_upstream = 1;\n@@ -209,6 +210,7 @@ static struct option builtin_merge_options[] = {\n \t\tN_(\"abort if fast-forward is not possible\"),\n \t\tPARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, FF_ONLY },\n \tOPT_RERERE_AUTOUPDATE(&allow_rerere_auto),\n+\tOPT_RERERE_AUTOCOMMIT(&allow_rerere_commit),\n \tOPT_BOOL(0, \"verify-signatures\", &verify_signatures,\n \t\tN_(\"Verify that the named commit has a valid GPG signature\")),\n \tOPT_CALLBACK('s', \"strategy\", &use_strategies, N_(\"strategy\"),\n@@ -1553,6 +1555,10 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\t\t * handle the given merge at all.\n \t\t\t */\n \t\t\tif (ret == 1) {\n+\t\t\t\tif(allow_rerere_commit) {\n+\t\t\t\t\trerere(RERERE_AUTOUPDATE);\n+\t\t\t\t\tgoto automerge;\n+\t\t\t\t}\n \t\t\t\tint cnt = evaluate_result();\n \n \t\t\t\tif (best_cnt <= 0 || cnt <= best_cnt) {\n@@ -1565,7 +1571,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\t\telse\n \t\t\t\tcontinue;\n \t\t}\n-\n+automerge:\n \t\t/* Automerge succeeded. */\n \t\twrite_tree_trivial(result_tree);\n \t\tautomerge_was_ok = 1;\ndiff --git a/rerere.h b/rerere.h\nindex 2956c2e..4b36570 100644\n--- a/rerere.h\n+++ b/rerere.h\n@@ -25,5 +25,7 @@ extern void rerere_gc(struct string_list *);\n \n #define OPT_RERERE_AUTOUPDATE(v) OPT_UYN(0, \"rerere-autoupdate\", (v), \\\n \tN_(\"update the index with reused conflict resolution if possible\"))\n+#define OPT_RERERE_AUTOCOMMIT(v) OPT_BOOL(0 , \"rerere-autocommit\", (v), \\\n+\tN_(\"autocommit with reused conflict resolution if possible\"))\n \n #endif\n-- \n2.3.2 (Apple Git-55)\n"}]}