{"thread":{"id":"41627","subject":"[PATCH v2 1/2] mergetool: honor tempfile configuration when resolving delete conflicts","startedAt":"2016-03-05T22:56:26Z","lastAt":"2016-03-07T02:34:16Z","messageCount":2,"participants":["David Aguilar","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"280270","messageId":"1457218586-18654-1-git-send-email-davvid@gmail.com","threadId":"41627","inReplyTo":null,"subject":"[PATCH v2 1/2] mergetool: honor tempfile configuration when resolving delete conflicts","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2016-03-05T22:56:26Z","receivedAt":"2016-03-05T22:56:26Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Teach resolve_deleted_merge() to honor the mergetool.keepBackup and\nmergetool.keepTemporaries configuration knobs.\n\nThis ensures that the worktree is kept pristine when resolving deletion\nconflicts with the variables both set to false.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\nv2 uses test.  2/2 is the same as before, and was not sent this round.\n\n git-mergetool.sh | 11 ++++++++++-\n 1 file changed, 10 insertions(+), 1 deletion(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 9f77e3a..4a9e9ca 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -126,7 +126,12 @@ resolve_deleted_merge () {\n \t\tcase \"$ans\" in\n \t\t[mMcC]*)\n \t\t\tgit add -- \"$MERGED\"\n-\t\t\tcleanup_temp_files --save-backup\n+\t\t\tif test \"$merge_keep_backup\" = \"true\"\n+\t\t\tthen\n+\t\t\t\tcleanup_temp_files --save-backup\n+\t\t\telse\n+\t\t\t\tcleanup_temp_files\n+\t\t\tfi\n \t\t\treturn 0\n \t\t\t;;\n \t\t[dD]*)\n@@ -135,6 +140,10 @@ resolve_deleted_merge () {\n \t\t\treturn 0\n \t\t\t;;\n \t\t[aA]*)\n+\t\t\tif test \"$merge_keep_temporaries\" = \"false\"\n+\t\t\tthen\n+\t\t\t\tcleanup_temp_files\n+\t\t\tfi\n \t\t\treturn 1\n \t\t\t;;\n \t\tesac\n-- \n2.8.0.rc1.2.g28ba210\n"},{"id":"280314","messageId":"xmqqbn6rrp7b.fsf@gitster.mtv.corp.google.com","threadId":"41627","inReplyTo":"1457218586-18654-1-git-send-email-davvid@gmail.com","subject":"Re: [PATCH v2 1/2] mergetool: honor tempfile configuration when resolving delete conflicts","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-07T02:34:16Z","receivedAt":"2016-03-07T02:34:16Z","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> Teach resolve_deleted_merge() to honor the mergetool.keepBackup and\n> mergetool.keepTemporaries configuration knobs.\n>\n> This ensures that the worktree is kept pristine when resolving deletion\n> conflicts with the variables both set to false.\n>\n> Signed-off-by: David Aguilar <davvid@gmail.com>\n> ---\n> v2 uses test.  2/2 is the same as before, and was not sent this round.\n\nThanks, will queue.\n\nBy the way, the fact that 2/2 did not make you realize that your\n\"if\" statement was broken in the v1 1/2 patch indicates that the\ncodepath is not covered by the added test, doesn't it?  I was sort\nof expecting an updated patch for 2/2 for this reason...\n\n>  git-mergetool.sh | 11 ++++++++++-\n>  1 file changed, 10 insertions(+), 1 deletion(-)\n>\n> diff --git a/git-mergetool.sh b/git-mergetool.sh\n> index 9f77e3a..4a9e9ca 100755\n> --- a/git-mergetool.sh\n> +++ b/git-mergetool.sh\n> @@ -126,7 +126,12 @@ resolve_deleted_merge () {\n>  \t\tcase \"$ans\" in\n>  \t\t[mMcC]*)\n>  \t\t\tgit add -- \"$MERGED\"\n> -\t\t\tcleanup_temp_files --save-backup\n> +\t\t\tif test \"$merge_keep_backup\" = \"true\"\n> +\t\t\tthen\n> +\t\t\t\tcleanup_temp_files --save-backup\n> +\t\t\telse\n> +\t\t\t\tcleanup_temp_files\n> +\t\t\tfi\n>  \t\t\treturn 0\n>  \t\t\t;;\n>  \t\t[dD]*)\n> @@ -135,6 +140,10 @@ resolve_deleted_merge () {\n>  \t\t\treturn 0\n>  \t\t\t;;\n>  \t\t[aA]*)\n> +\t\t\tif test \"$merge_keep_temporaries\" = \"false\"\n> +\t\t\tthen\n> +\t\t\t\tcleanup_temp_files\n> +\t\t\tfi\n>  \t\t\treturn 1\n>  \t\t\t;;\n>  \t\tesac\n"}]}