{"thread":{"id":"41644","subject":"[PATCH] t7610-mergetool: add test cases for tempfile behavior","startedAt":"2016-03-09T05:36:54Z","lastAt":"2016-03-09T20:43:31Z","messageCount":2,"participants":["David Aguilar","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"280409","messageId":"1457501814-10599-1-git-send-email-davvid@gmail.com","threadId":"41644","inReplyTo":null,"subject":"[PATCH] t7610-mergetool: add test cases for tempfile behavior","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2016-03-09T05:36:54Z","receivedAt":"2016-03-09T05:36:54Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Ensure that mergetool.keepTemporaries is honored when resolving\ndelete/delete conflicts.\n\nEnsure that stderr stays empty, and that worktree directories\ncreated by mergetool to are removed.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n t/t7610-mergetool.sh | 34 ++++++++++++++++++++++++++++++++++\n 1 file changed, 34 insertions(+)\n\ndiff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\nindex f1668be..cf2eceb 100755\n--- a/t/t7610-mergetool.sh\n+++ b/t/t7610-mergetool.sh\n@@ -273,6 +273,40 @@ test_expect_success 'mergetool delete/delete conflict' '\n \tgit reset --hard HEAD\n '\n \n+test_expect_success 'mergetool honors tempfile config for deleted files' '\n+\ttest_config mergetool.keepTemporaries false &&\n+\t! git merge move-to-b &&\n+\techo d | git mergetool a/a/file.txt &&\n+\t! test -d a &&\n+\tgit reset --hard HEAD\n+'\n+\n+test_expect_success 'mergetool produces no errors when keepBackup is used' '\n+\ttest_config mergetool.keepBackup true &&\n+\t! git merge move-to-b &&\n+\t: >expect &&\n+\techo d | git mergetool a/a/file.txt 2>actual &&\n+\ttest_cmp expect actual &&\n+\t! test -d a &&\n+\tgit reset --hard HEAD\n+'\n+\n+test_expect_success 'mergetool keeps tempfiles when aborting delete/delete' '\n+\ttest_config mergetool.keepTemporaries true &&\n+\t! git merge move-to-b &&\n+\t! (echo a; echo n) | git mergetool a/a/file.txt &&\n+\ttest -d a/a &&\n+\tcat  >expect <<\\-EOF &&\n+file_BASE_.txt\n+file_LOCAL_.txt\n+file_REMOTE_.txt\n+-EOF\n+\tls -1 a/a | sed -e \"s/[0-9]*//g\" >actual &&\n+\ttest_cmp expect actual &&\n+\tgit clean -fdx &&\n+\tgit reset --hard HEAD\n+'\n+\n test_expect_success 'deleted vs modified submodule' '\n \tgit checkout -b test6 branch1 &&\n \tgit submodule update -N &&\n-- \n2.8.0.rc1.3.g475af66.dirty\n"},{"id":"280509","messageId":"xmqqh9gfgz64.fsf@gitster.mtv.corp.google.com","threadId":"41644","inReplyTo":"1457501814-10599-1-git-send-email-davvid@gmail.com","subject":"Re: [PATCH] t7610-mergetool: add test cases for tempfile behavior","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-09T20:43:31Z","receivedAt":"2016-03-09T20:43:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n> Ensure that mergetool.keepTemporaries is honored when resolving\n> delete/delete conflicts.\n>\n> Ensure that stderr stays empty, and that worktree directories\n> created by mergetool to are removed.\n>\n> Signed-off-by: David Aguilar <davvid@gmail.com>\n> ---\n>  t/t7610-mergetool.sh | 34 ++++++++++++++++++++++++++++++++++\n>  1 file changed, 34 insertions(+)\n\nThanks.\n\n> diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\n> index f1668be..cf2eceb 100755\n> --- a/t/t7610-mergetool.sh\n> +++ b/t/t7610-mergetool.sh\n> @@ -273,6 +273,40 @@ test_expect_success 'mergetool delete/delete conflict' '\n>  \tgit reset --hard HEAD\n>  '\n>  \n> +test_expect_success 'mergetool honors tempfile config for deleted files' '\n> +\ttest_config mergetool.keepTemporaries false &&\n> +\t! git merge move-to-b &&\n\nWe'd like to catch a newly built Git segfaulting, so let's change\nthis to:\n\n\ttest_must_fail git merge move-to-b &&\n\nTwo other \"! git merge\" in this patch need be changed the same way.\n\n> +\techo d | git mergetool a/a/file.txt &&\n> +\t! test -d a &&\n> +\tgit reset --hard HEAD\n> +'\n> +\n> +test_expect_success 'mergetool produces no errors when keepBackup is used' '\n> +\ttest_config mergetool.keepBackup true &&\n> +\t! git merge move-to-b &&\n> +\t: >expect &&\n> +\techo d | git mergetool a/a/file.txt 2>actual &&\n> +\ttest_cmp expect actual &&\n> +\t! test -d a &&\n> +\tgit reset --hard HEAD\n> +'\n> +\n> +test_expect_success 'mergetool keeps tempfiles when aborting delete/delete' '\n> +\ttest_config mergetool.keepTemporaries true &&\n> +\t! git merge move-to-b &&\n> +\t! (echo a; echo n) | git mergetool a/a/file.txt &&\n> +\ttest -d a/a &&\n> +\tcat  >expect <<\\-EOF &&\n> +file_BASE_.txt\n> +file_LOCAL_.txt\n> +file_REMOTE_.txt\n> +-EOF\n\nLet's use EOF not -EOF as the end marker for here document, but use\na dash in front of the marker to allow us indent the contents of the\nhere document, like this:\n\n\tcat >expect <<-\\EOF &&\n\tfile_BASE_.txt\n\tfile_LOCAL_.txt\n\tfile_REMOTE_.txt\n\tEOF\n\nWhile at it, let's lose the extra SP after \"cat\".\n\n> +\tls -1 a/a | sed -e \"s/[0-9]*//g\" >actual &&\n> +\ttest_cmp expect actual &&\n> +\tgit clean -fdx &&\n> +\tgit reset --hard HEAD\n> +'\n>  test_expect_success 'deleted vs modified submodule' '\n>  \tgit checkout -b test6 branch1 &&\n>  \tgit submodule update -N &&\n\n\nI'll queue this patch with the above-mentioned fixups squashed in,\nbut I suspect that another new test added by the previous patches\nhave the same \"! git merge\" issue we'd want to correct before we\nstart to move the topic to 'next' and to 'master', so perhaps you'd\nwant to reroll these three patches as two patches (i.e. squashing\nthis one to 1/2, correcting the test in 2/2) after 2.8 final ships?\n\nThanks.\n"}]}