{"thread":{"id":"52100","subject":"[PATCH 0/5] apply: fix merge.conflictStyle bug in --3way","startedAt":"2019-10-23T12:03:52Z","lastAt":"2019-10-24T01:20:31Z","messageCount":16,"participants":["Denton Liu","Eric Sunshine","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"384691","messageId":"cover.1571832176.git.liu.denton@gmail.com","threadId":"52100","inReplyTo":null,"subject":"[PATCH 0/5] apply: fix merge.conflictStyle bug in --3way","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T12:03:44Z","receivedAt":"2019-10-23T12:03:52Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"This fixes a bug where even if `merge.conflictStyle = diff3`, running\n`git apply --3way` would not output the base.\n\nPatches 1-3 are general cleanup for t4108, 4 demonstrates the bug and 5\nactually fixes it.\n\nDenton Liu (5):\n  t4108: replace create_file with test_write_lines\n  t4108: remove git command upstream of pipe\n  t4108: use `test_config` instead of `git config`\n  t4108: demonstrate bug in apply\n  apply: respect merge.conflictStyle in --3way\n\n apply.c                   |  2 +-\n t/t4108-apply-threeway.sh | 96 +++++++++++++++++++++------------------\n 2 files changed, 53 insertions(+), 45 deletions(-)\n\n-- \n2.24.0.rc0.197.g0926ab8072\n\n"},{"id":"384692","messageId":"84fe1614a3c807e3604549ec012535ce6bd17228.1571832176.git.liu.denton@gmail.com","threadId":"52100","inReplyTo":"cover.1571832176.git.liu.denton@gmail.com","subject":"[PATCH 1/5] t4108: replace create_file with test_write_lines","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T12:03:48Z","receivedAt":"2019-10-23T12:03:53Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Since the locally defined create_file() duplicates the functionality of\nthe test_write_lines() helper function, remove create_file() and replace\nall instances with test_write_lines(). While we're at it, move\nredirection operators to the end of the command which is the more\nconventional place to put it.\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\n t/t4108-apply-threeway.sh | 27 ++++++++++-----------------\n 1 file changed, 10 insertions(+), 17 deletions(-)\n\ndiff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh\nindex fa5d4efb89..b109ecbd9f 100755\n--- a/t/t4108-apply-threeway.sh\n+++ b/t/t4108-apply-threeway.sh\n@@ -4,13 +4,6 @@ test_description='git apply --3way'\n \n . ./test-lib.sh\n \n-create_file () {\n-\tfor i\n-\tdo\n-\t\techo \"$i\"\n-\tdone\n-}\n-\n sanitize_conflicted_diff () {\n \tsed -e '\n \t\t/^index /d\n@@ -20,7 +13,7 @@ sanitize_conflicted_diff () {\n \n test_expect_success setup '\n \ttest_tick &&\n-\tcreate_file >one 1 2 3 4 5 6 7 &&\n+\ttest_write_lines 1 2 3 4 5 6 7 >one &&\n \tcat one >two &&\n \tgit add one two &&\n \tgit commit -m initial &&\n@@ -28,13 +21,13 @@ test_expect_success setup '\n \tgit branch side &&\n \n \ttest_tick &&\n-\tcreate_file >one 1 two 3 4 5 six 7 &&\n-\tcreate_file >two 1 two 3 4 5 6 7 &&\n+\ttest_write_lines 1 two 3 4 5 six 7 >one &&\n+\ttest_write_lines 1 two 3 4 5 6 7 >two &&\n \tgit commit -a -m master &&\n \n \tgit checkout side &&\n-\tcreate_file >one 1 2 3 4 five 6 7 &&\n-\tcreate_file >two 1 2 3 4 five 6 7 &&\n+\ttest_write_lines 1 2 3 4 five 6 7 >one &&\n+\ttest_write_lines 1 2 3 4 five 6 7 >two &&\n \tgit commit -a -m side &&\n \n \tgit checkout master\n@@ -87,7 +80,7 @@ test_expect_success 'apply with --3way with rerere enabled' '\n \ttest_must_fail git merge --no-commit side &&\n \n \t# Manually resolve and record the resolution\n-\tcreate_file 1 two 3 4 five six 7 >one &&\n+\ttest_write_lines 1 two 3 4 five six 7 >one &&\n \tgit rerere &&\n \tcat one >expect &&\n \n@@ -104,14 +97,14 @@ test_expect_success 'apply -3 with add/add conflict setup' '\n \tgit reset --hard &&\n \n \tgit checkout -b adder &&\n-\tcreate_file 1 2 3 4 5 6 7 >three &&\n-\tcreate_file 1 2 3 4 5 6 7 >four &&\n+\ttest_write_lines 1 2 3 4 5 6 7 >three &&\n+\ttest_write_lines 1 2 3 4 5 6 7 >four &&\n \tgit add three four &&\n \tgit commit -m \"add three and four\" &&\n \n \tgit checkout -b another adder^ &&\n-\tcreate_file 1 2 3 4 5 6 7 >three &&\n-\tcreate_file 1 2 3 four 5 6 7 >four &&\n+\ttest_write_lines 1 2 3 4 5 6 7 >three &&\n+\ttest_write_lines 1 2 3 four 5 6 7 >four &&\n \tgit add three four &&\n \tgit commit -m \"add three and four\" &&\n \n-- \n2.24.0.rc0.197.g0926ab8072\n\n"},{"id":"384693","messageId":"9d915748c1953cc2683fa3189c3c98b1e9a1e299.1571832176.git.liu.denton@gmail.com","threadId":"52100","inReplyTo":"cover.1571832176.git.liu.denton@gmail.com","subject":"[PATCH 2/5] t4108: remove git command upstream of pipe","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T12:03:51Z","receivedAt":"2019-10-23T12:03:55Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Before, the output of `git diff HEAD` would always be piped to\nsanitize_conflicted_diff(). However, since the Git command was upstream\nof the pipe, in case the Git command fails, the return code would be\nlost. Rewrite into separate statements so that the return code is no\nlonger lost.\n\nSince only the command `git diff HEAD` was being piped to\nsanitize_conflicted_diff(), move the command into the function and rename\nit to print_sanitized_diff().\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\n t/t4108-apply-threeway.sh | 13 +++++++------\n 1 file changed, 7 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh\nindex b109ecbd9f..49739ce8b4 100755\n--- a/t/t4108-apply-threeway.sh\n+++ b/t/t4108-apply-threeway.sh\n@@ -4,11 +4,12 @@ test_description='git apply --3way'\n \n . ./test-lib.sh\n \n-sanitize_conflicted_diff () {\n+print_sanitized_diff () {\n+\tgit diff HEAD >diff.raw &&\n \tsed -e '\n \t\t/^index /d\n \t\ts/^\\(+[<>][<>][<>][<>]*\\) .*/\\1/\n-\t'\n+\t' diff.raw\n }\n \n test_expect_success setup '\n@@ -54,14 +55,14 @@ test_expect_success 'apply with --3way' '\n \tgit checkout master^0 &&\n \ttest_must_fail git merge --no-commit side &&\n \tgit ls-files -s >expect.ls &&\n-\tgit diff HEAD | sanitize_conflicted_diff >expect.diff &&\n+\tprint_sanitized_diff >expect.diff &&\n \n \t# should fail to apply\n \tgit reset --hard &&\n \tgit checkout master^0 &&\n \ttest_must_fail git apply --index --3way P.diff &&\n \tgit ls-files -s >actual.ls &&\n-\tgit diff HEAD | sanitize_conflicted_diff >actual.diff &&\n+\tprint_sanitized_diff >actual.diff &&\n \n \t# The result should resemble the corresponding merge\n \ttest_cmp expect.ls actual.ls &&\n@@ -114,7 +115,7 @@ test_expect_success 'apply -3 with add/add conflict setup' '\n \tgit checkout adder^0 &&\n \ttest_must_fail git merge --no-commit another &&\n \tgit ls-files -s >expect.ls &&\n-\tgit diff HEAD | sanitize_conflicted_diff >expect.diff\n+\tprint_sanitized_diff >expect.diff\n '\n \n test_expect_success 'apply -3 with add/add conflict' '\n@@ -124,7 +125,7 @@ test_expect_success 'apply -3 with add/add conflict' '\n \ttest_must_fail git apply --index --3way P.diff &&\n \t# ... and leave conflicts in the index and in the working tree\n \tgit ls-files -s >actual.ls &&\n-\tgit diff HEAD | sanitize_conflicted_diff >actual.diff &&\n+\tprint_sanitized_diff >actual.diff &&\n \n \t# The result should resemble the corresponding merge\n \ttest_cmp expect.ls actual.ls &&\n-- \n2.24.0.rc0.197.g0926ab8072\n\n"},{"id":"384694","messageId":"d77c5f4199562947cabc89c63b55faee345fd8fd.1571832176.git.liu.denton@gmail.com","threadId":"52100","inReplyTo":"cover.1571832176.git.liu.denton@gmail.com","subject":"[PATCH 3/5] t4108: use `test_config` instead of `git config`","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T12:03:53Z","receivedAt":"2019-10-23T12:04:01Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Since `git config` leaves the configurations set even after the test\ncase completes, use `test_config` instead so that the configurations are\nreset once the test case finishes.\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\n t/t4108-apply-threeway.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh\nindex 49739ce8b4..3615256492 100755\n--- a/t/t4108-apply-threeway.sh\n+++ b/t/t4108-apply-threeway.sh\n@@ -70,7 +70,7 @@ test_expect_success 'apply with --3way' '\n '\n \n test_expect_success 'apply with --3way with rerere enabled' '\n-\tgit config rerere.enabled true &&\n+\ttest_config rerere.enabled true &&\n \n \t# Merging side should be similar to applying this patch\n \tgit diff ...side >P.diff &&\n-- \n2.24.0.rc0.197.g0926ab8072\n\n"},{"id":"384695","messageId":"5feddf15978e77b19d8b3e2e5761e394e0bda3e7.1571832177.git.liu.denton@gmail.com","threadId":"52100","inReplyTo":"cover.1571832176.git.liu.denton@gmail.com","subject":"[PATCH 4/5] t4108: demonstrate bug in apply","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T12:03:56Z","receivedAt":"2019-10-23T12:04:02Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Currently, apply does not respect the merge.conflictStyle setting.\nDemonstrate this by making the 'apply with --3way' test case generic and\nextending it to show that the configuration of\nmerge.conflictStyle = diff3 causes a breakage.\n\nChange print_sanitized_diff() to also sanitize `|||||||` conflict markers.\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\n t/t4108-apply-threeway.sh | 58 ++++++++++++++++++++++++---------------\n 1 file changed, 36 insertions(+), 22 deletions(-)\n\ndiff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh\nindex 3615256492..84347fc178 100755\n--- a/t/t4108-apply-threeway.sh\n+++ b/t/t4108-apply-threeway.sh\n@@ -8,7 +8,7 @@ print_sanitized_diff () {\n \tgit diff HEAD >diff.raw &&\n \tsed -e '\n \t\t/^index /d\n-\t\ts/^\\(+[<>][<>][<>][<>]*\\) .*/\\1/\n+\t\ts/^\\(+[<>|][<>|][<>|][<>|]*\\) .*/\\1/\n \t' diff.raw\n }\n \n@@ -46,28 +46,42 @@ test_expect_success 'apply without --3way' '\n \tgit diff-index --exit-code --cached HEAD\n '\n \n-test_expect_success 'apply with --3way' '\n-\t# Merging side should be similar to applying this patch\n-\tgit diff ...side >P.diff &&\n-\n-\t# The corresponding conflicted merge\n-\tgit reset --hard &&\n-\tgit checkout master^0 &&\n-\ttest_must_fail git merge --no-commit side &&\n-\tgit ls-files -s >expect.ls &&\n-\tprint_sanitized_diff >expect.diff &&\n-\n-\t# should fail to apply\n-\tgit reset --hard &&\n-\tgit checkout master^0 &&\n-\ttest_must_fail git apply --index --3way P.diff &&\n-\tgit ls-files -s >actual.ls &&\n-\tprint_sanitized_diff >actual.diff &&\n+test_apply_with_3way () {\n+\tstatus=\"$1\" &&\n+\tshift &&\n+\tdescription=\"$1\" &&\n+\tshift &&\n+\tpreamble=\"$1\" &&\n+\tshift &&\n+\n+\ttest_expect_$status \"apply with --3way ($description)\" \"\n+\t\t$preamble &&\n+\n+\t\t# Merging side should be similar to applying this patch\n+\t\tgit diff ...side >P.diff &&\n+\n+\t\t# The corresponding conflicted merge\n+\t\tgit reset --hard &&\n+\t\tgit checkout master^0 &&\n+\t\ttest_must_fail git merge --no-commit side &&\n+\t\tgit ls-files -s >expect.ls &&\n+\t\tprint_sanitized_diff >expect.diff &&\n+\n+\t\t# should fail to apply\n+\t\tgit reset --hard &&\n+\t\tgit checkout master^0 &&\n+\t\ttest_must_fail git apply --index --3way P.diff &&\n+\t\tgit ls-files -s >actual.ls &&\n+\t\tprint_sanitized_diff >actual.diff &&\n+\n+\t\t# The result should resemble the corresponding merge\n+\t\ttest_cmp expect.ls actual.ls &&\n+\t\ttest_cmp expect.diff actual.diff\n+\t\"\n+}\n \n-\t# The result should resemble the corresponding merge\n-\ttest_cmp expect.ls actual.ls &&\n-\ttest_cmp expect.diff actual.diff\n-'\n+test_apply_with_3way success default true\n+test_apply_with_3way failure 'merge.conflictStyle = diff3' 'test_config merge.conflictStyle diff3'\n \n test_expect_success 'apply with --3way with rerere enabled' '\n \ttest_config rerere.enabled true &&\n-- \n2.24.0.rc0.197.g0926ab8072\n\n"},{"id":"384696","messageId":"56c31310db9358673af9905910e3332893d798de.1571832177.git.liu.denton@gmail.com","threadId":"52100","inReplyTo":"cover.1571832176.git.liu.denton@gmail.com","subject":"[PATCH 5/5] apply: respect merge.conflictStyle in --3way","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T12:03:58Z","receivedAt":"2019-10-23T12:04:03Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Before, when doing a 3-way merge, the merge.conflictStyle option was not\nrespected and the \"merge\" style was always used, even if \"diff3\" was\nspecified.\n\nCall git_xmerge_config() at the end of git_apply_config() so that the\nmerge.conflictStyle config is read.\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\n apply.c                   | 2 +-\n t/t4108-apply-threeway.sh | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/apply.c b/apply.c\nindex f8a046a6a5..b9291f5f7b 100644\n--- a/apply.c\n+++ b/apply.c\n@@ -32,7 +32,7 @@ static void git_apply_config(void)\n {\n \tgit_config_get_string_const(\"apply.whitespace\", &apply_default_whitespace);\n \tgit_config_get_string_const(\"apply.ignorewhitespace\", &apply_default_ignorewhitespace);\n-\tgit_config(git_default_config, NULL);\n+\tgit_config(git_xmerge_config, NULL);\n }\n \n static int parse_whitespace_option(struct apply_state *state, const char *option)\ndiff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh\nindex 84347fc178..0e4eeac083 100755\n--- a/t/t4108-apply-threeway.sh\n+++ b/t/t4108-apply-threeway.sh\n@@ -81,7 +81,7 @@ test_apply_with_3way () {\n }\n \n test_apply_with_3way success default true\n-test_apply_with_3way failure 'merge.conflictStyle = diff3' 'test_config merge.conflictStyle diff3'\n+test_apply_with_3way success 'merge.conflictStyle = diff3' 'test_config merge.conflictStyle diff3'\n \n test_expect_success 'apply with --3way with rerere enabled' '\n \ttest_config rerere.enabled true &&\n-- \n2.24.0.rc0.197.g0926ab8072\n\n"},{"id":"384702","messageId":"CAPig+cQ6RCMOaf4ZtOKNtiDdKu1JED=zMKZ8afwSr0cvE2zMgw@mail.gmail.com","threadId":"52100","inReplyTo":"9d915748c1953cc2683fa3189c3c98b1e9a1e299.1571832176.git.liu.denton@gmail.com","subject":"Re: [PATCH 2/5] t4108: remove git command upstream of pipe","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2019-10-23T13:32:26Z","receivedAt":"2019-10-23T13:32:40Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Oct 23, 2019 at 8:04 AM Denton Liu <liu.denton@gmail.com> wrote:\n> Before, the output of `git diff HEAD` would always be piped to\n> sanitize_conflicted_diff(). However, since the Git command was upstream\n> of the pipe, in case the Git command fails, the return code would be\n> lost. Rewrite into separate statements so that the return code is no\n> longer lost.\n>\n> Since only the command `git diff HEAD` was being piped to\n> sanitize_conflicted_diff(), move the command into the function and rename\n> it to print_sanitized_diff().\n>\n> Signed-off-by: Denton Liu <liu.denton@gmail.com>\n> ---\n> diff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh\n> @@ -4,11 +4,12 @@ test_description='git apply --3way'\n> -sanitize_conflicted_diff () {\n> +print_sanitized_diff () {\n> +       git diff HEAD >diff.raw &&\n>         sed -e '\n>                 /^index /d\n>                 s/^\\(+[<>][<>][<>][<>]*\\) .*/\\1/\n> -       '\n> +       ' diff.raw\n>  }\n\nNit: By hard-coding \"HEAD\" in this function, you lose the flexibility\nof the original. An alternative would have been to accept the ref\nagainst which to diff as an argument to this function:\n\n    print_sanitized_diff () {\n        git diff \"$@\" >diff.raw &&\n        ...\n\nOr, better yet, keep the original design and pass the diff in as the\nshell function's input, so a caller would say:\n\n    git diff HEAD >diff.raw &&\n    sanitize_conflicted_diff <diff.raw >expect.diff &&\n\nHowever, not necessarily worth a re-roll if we never expect anyone to\npass anything other than \"HEAD\".\n"},{"id":"384703","messageId":"CAPig+cQF+0mTLgva0YRAJ81Aj2Z_oJ+q4kzezREEyCZuv=2XKQ@mail.gmail.com","threadId":"52100","inReplyTo":"5feddf15978e77b19d8b3e2e5761e394e0bda3e7.1571832177.git.liu.denton@gmail.com","subject":"Re: [PATCH 4/5] t4108: demonstrate bug in apply","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2019-10-23T13:40:56Z","receivedAt":"2019-10-23T13:41:10Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Oct 23, 2019 at 8:04 AM Denton Liu <liu.denton@gmail.com> wrote:\n> Currently, apply does not respect the merge.conflictStyle setting.\n> Demonstrate this by making the 'apply with --3way' test case generic and\n> extending it to show that the configuration of\n> merge.conflictStyle = diff3 causes a breakage.\n>\n> Change print_sanitized_diff() to also sanitize `|||||||` conflict markers.\n>\n> Signed-off-by: Denton Liu <liu.denton@gmail.com>\n> ---\n> diff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh\n> @@ -46,28 +46,42 @@ test_expect_success 'apply without --3way' '\n> +test_apply_with_3way () {\n> +       status=\"$1\" &&\n> +       shift &&\n> +       description=\"$1\" &&\n> +       shift &&\n> +       preamble=\"$1\" &&\n> +       shift &&\n> +\n> +       test_expect_$status \"apply with --3way ($description)\" \"\n> +               $preamble &&\n> +\n> +               # Merging side should be similar to applying this patch\n> +               git diff ...side >P.diff &&\n> +               [...]\n> +       \"\n> +}\n>\n> +test_apply_with_3way success default true\n> +test_apply_with_3way failure 'merge.conflictStyle = diff3' 'test_config merge.conflictStyle diff3'\n\nThis isn't the prettiest way to achieve this; the \"success\"/\"failure\"\narguments, especially, are somewhat ugly. A perhaps more palatable\nalternative which gives you the same benefit of re-using the common\ncode but avoids the ugliness while still allowing customization (now\nand in the future):\n\n    test_apply_with_3way () {\n        # Merging side should be similar to applying this patch\n        git diff ...side >P.diff &&\n        [...]\n    }\n\n    test_expect_success 'apply with --3way (default)' '\n        test_apply_with_3way\n    '\n\n    test_expect_failure 'apply with --3way (merge.conflictStyle = diff3)' '\n        test_config merge.conflictStyle diff3 &&\n        test_apply_with_3way\n    '\n"},{"id":"384714","messageId":"20191023171120.GA87013@generichostname","threadId":"52100","inReplyTo":"CAPig+cQ6RCMOaf4ZtOKNtiDdKu1JED=zMKZ8afwSr0cvE2zMgw@mail.gmail.com","subject":"Re: [PATCH 2/5] t4108: remove git command upstream of pipe","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T17:11:20Z","receivedAt":"2019-10-23T17:11:28Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"On Wed, Oct 23, 2019 at 09:32:26AM -0400, Eric Sunshine wrote:\n> On Wed, Oct 23, 2019 at 8:04 AM Denton Liu <liu.denton@gmail.com> wrote:\n> > Before, the output of `git diff HEAD` would always be piped to\n> > sanitize_conflicted_diff(). However, since the Git command was upstream\n> > of the pipe, in case the Git command fails, the return code would be\n> > lost. Rewrite into separate statements so that the return code is no\n> > longer lost.\n> >\n> > Since only the command `git diff HEAD` was being piped to\n> > sanitize_conflicted_diff(), move the command into the function and rename\n> > it to print_sanitized_diff().\n> >\n> > Signed-off-by: Denton Liu <liu.denton@gmail.com>\n> > ---\n> > diff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh\n> > @@ -4,11 +4,12 @@ test_description='git apply --3way'\n> > -sanitize_conflicted_diff () {\n> > +print_sanitized_diff () {\n> > +       git diff HEAD >diff.raw &&\n> >         sed -e '\n> >                 /^index /d\n> >                 s/^\\(+[<>][<>][<>][<>]*\\) .*/\\1/\n> > -       '\n> > +       ' diff.raw\n> >  }\n> \n> Nit: By hard-coding \"HEAD\" in this function, you lose the flexibility\n> of the original. An alternative would have been to accept the ref\n> against which to diff as an argument to this function:\n> \n>     print_sanitized_diff () {\n>         git diff \"$@\" >diff.raw &&\n>         ...\n> \n> Or, better yet, keep the original design and pass the diff in as the\n> shell function's input, so a caller would say:\n> \n>     git diff HEAD >diff.raw &&\n>     sanitize_conflicted_diff <diff.raw >expect.diff &&\n> \n> However, not necessarily worth a re-roll if we never expect anyone to\n> pass anything other than \"HEAD\".\n\nSince it doesn't really make sense to commmit conflicts, I decided to\nhardcode it to be a diff against HEAD and the worktree since that's the\nonly sensible place where the conflict should live.\n\nSpeaking of conflicts, I dropped the \"conflicted\" part of the old\nfunction name. I think that removes a lot of clarity so I'll reroll\nrenaming the function to print_sanitized_conflicted_diff() or something\nlike that.\n"},{"id":"384729","messageId":"cover.1571873435.git.liu.denton@gmail.com","threadId":"52100","inReplyTo":"cover.1571832176.git.liu.denton@gmail.com","subject":"[PATCH v2 0/5] This fixes a bug where even if `merge.conflictStyle = diff3`, running `git apply --3way` would not output the base.","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T23:32:25Z","receivedAt":"2019-10-23T23:32:31Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Patches 1-3 are general cleanup for t4108, 4 demonstrates the bug and 5\nactually fixes it.\n\nChanges since v1:\n\n* Pretty up 4/5 using Eric's suggestion\n\n* Rename print_sanitized_diff() to print_santized_conflicted_diff()\n\nDenton Liu (5):\n  t4108: replace create_file with test_write_lines\n  t4108: remove git command upstream of pipe\n  t4108: use `test_config` instead of `git config`\n  t4108: demonstrate bug in apply\n  apply: respect merge.conflictStyle in --3way\n\n apply.c                   |  2 +-\n t/t4108-apply-threeway.sh | 55 +++++++++++++++++++++------------------\n 2 files changed, 30 insertions(+), 27 deletions(-)\n\nRange-diff against v1:\n1:  9d915748c1 ! 1:  fd1b770c0c t4108: remove git command upstream of pipe\n    @@ Commit message\n     \n         Since only the command `git diff HEAD` was being piped to\n         sanitize_conflicted_diff(), move the command into the function and rename\n    -    it to print_sanitized_diff().\n    +    it to print_sanitized_conflicted_diff().\n     \n      ## t/t4108-apply-threeway.sh ##\n     @@ t/t4108-apply-threeway.sh: test_description='git apply --3way'\n    @@ t/t4108-apply-threeway.sh: test_description='git apply --3way'\n      . ./test-lib.sh\n      \n     -sanitize_conflicted_diff () {\n    -+print_sanitized_diff () {\n    ++print_sanitized_conflicted_diff () {\n     +\tgit diff HEAD >diff.raw &&\n      \tsed -e '\n      \t\t/^index /d\n    @@ t/t4108-apply-threeway.sh: test_expect_success 'apply with --3way' '\n      \ttest_must_fail git merge --no-commit side &&\n      \tgit ls-files -s >expect.ls &&\n     -\tgit diff HEAD | sanitize_conflicted_diff >expect.diff &&\n    -+\tprint_sanitized_diff >expect.diff &&\n    ++\tprint_sanitized_conflicted_diff >expect.diff &&\n      \n      \t# should fail to apply\n      \tgit reset --hard &&\n    @@ t/t4108-apply-threeway.sh: test_expect_success 'apply with --3way' '\n      \ttest_must_fail git apply --index --3way P.diff &&\n      \tgit ls-files -s >actual.ls &&\n     -\tgit diff HEAD | sanitize_conflicted_diff >actual.diff &&\n    -+\tprint_sanitized_diff >actual.diff &&\n    ++\tprint_sanitized_conflicted_diff >actual.diff &&\n      \n      \t# The result should resemble the corresponding merge\n      \ttest_cmp expect.ls actual.ls &&\n    @@ t/t4108-apply-threeway.sh: test_expect_success 'apply -3 with add/add conflict s\n      \ttest_must_fail git merge --no-commit another &&\n      \tgit ls-files -s >expect.ls &&\n     -\tgit diff HEAD | sanitize_conflicted_diff >expect.diff\n    -+\tprint_sanitized_diff >expect.diff\n    ++\tprint_sanitized_conflicted_diff >expect.diff\n      '\n      \n      test_expect_success 'apply -3 with add/add conflict' '\n    @@ t/t4108-apply-threeway.sh: test_expect_success 'apply -3 with add/add conflict'\n      \t# ... and leave conflicts in the index and in the working tree\n      \tgit ls-files -s >actual.ls &&\n     -\tgit diff HEAD | sanitize_conflicted_diff >actual.diff &&\n    -+\tprint_sanitized_diff >actual.diff &&\n    ++\tprint_sanitized_conflicted_diff >actual.diff &&\n      \n      \t# The result should resemble the corresponding merge\n      \ttest_cmp expect.ls actual.ls &&\n2:  d77c5f4199 = 2:  43c42b299e t4108: use `test_config` instead of `git config`\n3:  5feddf1597 < -:  ---------- t4108: demonstrate bug in apply\n-:  ---------- > 3:  58d32e2618 t4108: demonstrate bug in apply\n4:  56c31310db ! 4:  5412dc9153 apply: respect merge.conflictStyle in --3way\n    @@ apply.c: static void git_apply_config(void)\n      static int parse_whitespace_option(struct apply_state *state, const char *option)\n     \n      ## t/t4108-apply-threeway.sh ##\n    -@@ t/t4108-apply-threeway.sh: test_apply_with_3way () {\n    - }\n    +@@ t/t4108-apply-threeway.sh: test_expect_success 'apply with --3way' '\n    + \ttest_apply_with_3way\n    + '\n      \n    - test_apply_with_3way success default true\n    --test_apply_with_3way failure 'merge.conflictStyle = diff3' 'test_config merge.conflictStyle diff3'\n    -+test_apply_with_3way success 'merge.conflictStyle = diff3' 'test_config merge.conflictStyle diff3'\n    - \n    - test_expect_success 'apply with --3way with rerere enabled' '\n    - \ttest_config rerere.enabled true &&\n    +-test_expect_failure 'apply with --3way with merge.conflictStyle = diff3' '\n    ++test_expect_success 'apply with --3way with merge.conflictStyle = diff3' '\n    + \ttest_config merge.conflictStyle diff3 &&\n    + \ttest_apply_with_3way\n    + '\n-- \n2.24.0.rc0.197.g0926ab8072\n\n"},{"id":"384730","messageId":"84fe1614a3c807e3604549ec012535ce6bd17228.1571873435.git.liu.denton@gmail.com","threadId":"52100","inReplyTo":"cover.1571873435.git.liu.denton@gmail.com","subject":"[PATCH v2 1/5] t4108: replace create_file with test_write_lines","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T23:32:28Z","receivedAt":"2019-10-23T23:32:33Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Since the locally defined create_file() duplicates the functionality of\nthe test_write_lines() helper function, remove create_file() and replace\nall instances with test_write_lines(). While we're at it, move\nredirection operators to the end of the command which is the more\nconventional place to put it.\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\n t/t4108-apply-threeway.sh | 27 ++++++++++-----------------\n 1 file changed, 10 insertions(+), 17 deletions(-)\n\ndiff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh\nindex fa5d4efb89..b109ecbd9f 100755\n--- a/t/t4108-apply-threeway.sh\n+++ b/t/t4108-apply-threeway.sh\n@@ -4,13 +4,6 @@ test_description='git apply --3way'\n \n . ./test-lib.sh\n \n-create_file () {\n-\tfor i\n-\tdo\n-\t\techo \"$i\"\n-\tdone\n-}\n-\n sanitize_conflicted_diff () {\n \tsed -e '\n \t\t/^index /d\n@@ -20,7 +13,7 @@ sanitize_conflicted_diff () {\n \n test_expect_success setup '\n \ttest_tick &&\n-\tcreate_file >one 1 2 3 4 5 6 7 &&\n+\ttest_write_lines 1 2 3 4 5 6 7 >one &&\n \tcat one >two &&\n \tgit add one two &&\n \tgit commit -m initial &&\n@@ -28,13 +21,13 @@ test_expect_success setup '\n \tgit branch side &&\n \n \ttest_tick &&\n-\tcreate_file >one 1 two 3 4 5 six 7 &&\n-\tcreate_file >two 1 two 3 4 5 6 7 &&\n+\ttest_write_lines 1 two 3 4 5 six 7 >one &&\n+\ttest_write_lines 1 two 3 4 5 6 7 >two &&\n \tgit commit -a -m master &&\n \n \tgit checkout side &&\n-\tcreate_file >one 1 2 3 4 five 6 7 &&\n-\tcreate_file >two 1 2 3 4 five 6 7 &&\n+\ttest_write_lines 1 2 3 4 five 6 7 >one &&\n+\ttest_write_lines 1 2 3 4 five 6 7 >two &&\n \tgit commit -a -m side &&\n \n \tgit checkout master\n@@ -87,7 +80,7 @@ test_expect_success 'apply with --3way with rerere enabled' '\n \ttest_must_fail git merge --no-commit side &&\n \n \t# Manually resolve and record the resolution\n-\tcreate_file 1 two 3 4 five six 7 >one &&\n+\ttest_write_lines 1 two 3 4 five six 7 >one &&\n \tgit rerere &&\n \tcat one >expect &&\n \n@@ -104,14 +97,14 @@ test_expect_success 'apply -3 with add/add conflict setup' '\n \tgit reset --hard &&\n \n \tgit checkout -b adder &&\n-\tcreate_file 1 2 3 4 5 6 7 >three &&\n-\tcreate_file 1 2 3 4 5 6 7 >four &&\n+\ttest_write_lines 1 2 3 4 5 6 7 >three &&\n+\ttest_write_lines 1 2 3 4 5 6 7 >four &&\n \tgit add three four &&\n \tgit commit -m \"add three and four\" &&\n \n \tgit checkout -b another adder^ &&\n-\tcreate_file 1 2 3 4 5 6 7 >three &&\n-\tcreate_file 1 2 3 four 5 6 7 >four &&\n+\ttest_write_lines 1 2 3 4 5 6 7 >three &&\n+\ttest_write_lines 1 2 3 four 5 6 7 >four &&\n \tgit add three four &&\n \tgit commit -m \"add three and four\" &&\n \n-- \n2.24.0.rc0.197.g0926ab8072\n\n"},{"id":"384731","messageId":"fd1b770c0cd466acec8bfd2b0f202cfef758a0e1.1571873435.git.liu.denton@gmail.com","threadId":"52100","inReplyTo":"cover.1571873435.git.liu.denton@gmail.com","subject":"[PATCH v2 2/5] t4108: remove git command upstream of pipe","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T23:32:31Z","receivedAt":"2019-10-23T23:32:37Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Before, the output of `git diff HEAD` would always be piped to\nsanitize_conflicted_diff(). However, since the Git command was upstream\nof the pipe, in case the Git command fails, the return code would be\nlost. Rewrite into separate statements so that the return code is no\nlonger lost.\n\nSince only the command `git diff HEAD` was being piped to\nsanitize_conflicted_diff(), move the command into the function and rename\nit to print_sanitized_conflicted_diff().\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\n t/t4108-apply-threeway.sh | 13 +++++++------\n 1 file changed, 7 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh\nindex b109ecbd9f..3c0ddacddf 100755\n--- a/t/t4108-apply-threeway.sh\n+++ b/t/t4108-apply-threeway.sh\n@@ -4,11 +4,12 @@ test_description='git apply --3way'\n \n . ./test-lib.sh\n \n-sanitize_conflicted_diff () {\n+print_sanitized_conflicted_diff () {\n+\tgit diff HEAD >diff.raw &&\n \tsed -e '\n \t\t/^index /d\n \t\ts/^\\(+[<>][<>][<>][<>]*\\) .*/\\1/\n-\t'\n+\t' diff.raw\n }\n \n test_expect_success setup '\n@@ -54,14 +55,14 @@ test_expect_success 'apply with --3way' '\n \tgit checkout master^0 &&\n \ttest_must_fail git merge --no-commit side &&\n \tgit ls-files -s >expect.ls &&\n-\tgit diff HEAD | sanitize_conflicted_diff >expect.diff &&\n+\tprint_sanitized_conflicted_diff >expect.diff &&\n \n \t# should fail to apply\n \tgit reset --hard &&\n \tgit checkout master^0 &&\n \ttest_must_fail git apply --index --3way P.diff &&\n \tgit ls-files -s >actual.ls &&\n-\tgit diff HEAD | sanitize_conflicted_diff >actual.diff &&\n+\tprint_sanitized_conflicted_diff >actual.diff &&\n \n \t# The result should resemble the corresponding merge\n \ttest_cmp expect.ls actual.ls &&\n@@ -114,7 +115,7 @@ test_expect_success 'apply -3 with add/add conflict setup' '\n \tgit checkout adder^0 &&\n \ttest_must_fail git merge --no-commit another &&\n \tgit ls-files -s >expect.ls &&\n-\tgit diff HEAD | sanitize_conflicted_diff >expect.diff\n+\tprint_sanitized_conflicted_diff >expect.diff\n '\n \n test_expect_success 'apply -3 with add/add conflict' '\n@@ -124,7 +125,7 @@ test_expect_success 'apply -3 with add/add conflict' '\n \ttest_must_fail git apply --index --3way P.diff &&\n \t# ... and leave conflicts in the index and in the working tree\n \tgit ls-files -s >actual.ls &&\n-\tgit diff HEAD | sanitize_conflicted_diff >actual.diff &&\n+\tprint_sanitized_conflicted_diff >actual.diff &&\n \n \t# The result should resemble the corresponding merge\n \ttest_cmp expect.ls actual.ls &&\n-- \n2.24.0.rc0.197.g0926ab8072\n\n"},{"id":"384732","messageId":"43c42b299eb8a4e3a1cc529f1b799ed0edb3e720.1571873435.git.liu.denton@gmail.com","threadId":"52100","inReplyTo":"cover.1571873435.git.liu.denton@gmail.com","subject":"[PATCH v2 3/5] t4108: use `test_config` instead of `git config`","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T23:32:33Z","receivedAt":"2019-10-23T23:32:38Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Since `git config` leaves the configurations set even after the test\ncase completes, use `test_config` instead so that the configurations are\nreset once the test case finishes.\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\n t/t4108-apply-threeway.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh\nindex 3c0ddacddf..7f96ae9101 100755\n--- a/t/t4108-apply-threeway.sh\n+++ b/t/t4108-apply-threeway.sh\n@@ -70,7 +70,7 @@ test_expect_success 'apply with --3way' '\n '\n \n test_expect_success 'apply with --3way with rerere enabled' '\n-\tgit config rerere.enabled true &&\n+\ttest_config rerere.enabled true &&\n \n \t# Merging side should be similar to applying this patch\n \tgit diff ...side >P.diff &&\n-- \n2.24.0.rc0.197.g0926ab8072\n\n"},{"id":"384733","messageId":"58d32e2618420e22a5418f87cd474a9347386098.1571873435.git.liu.denton@gmail.com","threadId":"52100","inReplyTo":"cover.1571873435.git.liu.denton@gmail.com","subject":"[PATCH v2 4/5] t4108: demonstrate bug in apply","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T23:32:36Z","receivedAt":"2019-10-23T23:32:41Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Currently, apply does not respect the merge.conflictStyle setting.\nDemonstrate this by making the 'apply with --3way' test case generic and\nextending it to show that the configuration of\nmerge.conflictStyle = diff3 causes a breakage.\n\nChange print_sanitized_conflicted_diff() to also sanitize `|||||||`\nconflict markers.\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\n t/t4108-apply-threeway.sh | 13 +++++++++++--\n 1 file changed, 11 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh\nindex 7f96ae9101..bffe37f1ba 100755\n--- a/t/t4108-apply-threeway.sh\n+++ b/t/t4108-apply-threeway.sh\n@@ -8,7 +8,7 @@ print_sanitized_conflicted_diff () {\n \tgit diff HEAD >diff.raw &&\n \tsed -e '\n \t\t/^index /d\n-\t\ts/^\\(+[<>][<>][<>][<>]*\\) .*/\\1/\n+\t\ts/^\\(+[<>|][<>|][<>|][<>|]*\\) .*/\\1/\n \t' diff.raw\n }\n \n@@ -46,7 +46,7 @@ test_expect_success 'apply without --3way' '\n \tgit diff-index --exit-code --cached HEAD\n '\n \n-test_expect_success 'apply with --3way' '\n+test_apply_with_3way () {\n \t# Merging side should be similar to applying this patch\n \tgit diff ...side >P.diff &&\n \n@@ -67,6 +67,15 @@ test_expect_success 'apply with --3way' '\n \t# The result should resemble the corresponding merge\n \ttest_cmp expect.ls actual.ls &&\n \ttest_cmp expect.diff actual.diff\n+}\n+\n+test_expect_success 'apply with --3way' '\n+\ttest_apply_with_3way\n+'\n+\n+test_expect_failure 'apply with --3way with merge.conflictStyle = diff3' '\n+\ttest_config merge.conflictStyle diff3 &&\n+\ttest_apply_with_3way\n '\n \n test_expect_success 'apply with --3way with rerere enabled' '\n-- \n2.24.0.rc0.197.g0926ab8072\n\n"},{"id":"384734","messageId":"5412dc9153d10c4f7769b24433b05c6809904655.1571873435.git.liu.denton@gmail.com","threadId":"52100","inReplyTo":"cover.1571873435.git.liu.denton@gmail.com","subject":"[PATCH v2 5/5] apply: respect merge.conflictStyle in --3way","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-10-23T23:32:38Z","receivedAt":"2019-10-23T23:32:43Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Before, when doing a 3-way merge, the merge.conflictStyle option was not\nrespected and the \"merge\" style was always used, even if \"diff3\" was\nspecified.\n\nCall git_xmerge_config() at the end of git_apply_config() so that the\nmerge.conflictStyle config is read.\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\n apply.c                   | 2 +-\n t/t4108-apply-threeway.sh | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/apply.c b/apply.c\nindex f8a046a6a5..b9291f5f7b 100644\n--- a/apply.c\n+++ b/apply.c\n@@ -32,7 +32,7 @@ static void git_apply_config(void)\n {\n \tgit_config_get_string_const(\"apply.whitespace\", &apply_default_whitespace);\n \tgit_config_get_string_const(\"apply.ignorewhitespace\", &apply_default_ignorewhitespace);\n-\tgit_config(git_default_config, NULL);\n+\tgit_config(git_xmerge_config, NULL);\n }\n \n static int parse_whitespace_option(struct apply_state *state, const char *option)\ndiff --git a/t/t4108-apply-threeway.sh b/t/t4108-apply-threeway.sh\nindex bffe37f1ba..d7349ced6b 100755\n--- a/t/t4108-apply-threeway.sh\n+++ b/t/t4108-apply-threeway.sh\n@@ -73,7 +73,7 @@ test_expect_success 'apply with --3way' '\n \ttest_apply_with_3way\n '\n \n-test_expect_failure 'apply with --3way with merge.conflictStyle = diff3' '\n+test_expect_success 'apply with --3way with merge.conflictStyle = diff3' '\n \ttest_config merge.conflictStyle diff3 &&\n \ttest_apply_with_3way\n '\n-- \n2.24.0.rc0.197.g0926ab8072\n\n"},{"id":"384738","messageId":"xmqqo8y7gcrq.fsf@gitster-ct.c.googlers.com","threadId":"52100","inReplyTo":"56c31310db9358673af9905910e3332893d798de.1571832177.git.liu.denton@gmail.com","subject":"Re: [PATCH 5/5] apply: respect merge.conflictStyle in --3way","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-10-24T01:20:25Z","receivedAt":"2019-10-24T01:20:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Denton Liu <liu.denton@gmail.com> writes:\n\n> Before, when doing a 3-way merge, the merge.conflictStyle option was not\n> respected and the \"merge\" style was always used, even if \"diff3\" was\n> specified.\n>\n> Call git_xmerge_config() at the end of git_apply_config() so that the\n> merge.conflictStyle config is read.\n>\n> Signed-off-by: Denton Liu <liu.denton@gmail.com>\n> ---\n>  apply.c                   | 2 +-\n>  t/t4108-apply-threeway.sh | 2 +-\n>  2 files changed, 2 insertions(+), 2 deletions(-)\n\nInteresting.\n\nI do not recall why I did not add this when I introduced the \"diff3\"\nstyle.  If it were because I knew other parts of \"git apply\" were\nnot prepared to see the common ancestor hunk and using the \"diff3\"\nstyle would have triggered breakage in them, I would remember, so\nhopefully there is no subtle and hidden gotchas like it.\n\nThe implementation to trigger the \"diff3\" style conflict\npresentation obviously is correct ;-)\n\nThanks.\n\n>  test_apply_with_3way success default true\n> -test_apply_with_3way failure 'merge.conflictStyle = diff3' 'test_config merge.conflictStyle diff3'\n> +test_apply_with_3way success 'merge.conflictStyle = diff3' 'test_config merge.conflictStyle diff3'\n>  \n>  test_expect_success 'apply with --3way with rerere enabled' '\n>  \ttest_config rerere.enabled true &&\n"}]}