{"thread":{"id":"44550","subject":"[PATCH] t7610: clean up foo.* tmpdir","startedAt":"2016-11-27T06:34:51Z","lastAt":"2016-11-27T06:34:51Z","messageCount":1,"participants":["Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"306458","messageId":"20161127063444.qzuzyab55gmofhfl@sigill.intra.peff.net","threadId":"44550","inReplyTo":null,"subject":"[PATCH] t7610: clean up foo.* tmpdir","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-11-27T06:34:45Z","receivedAt":"2016-11-27T06:34:51Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"[resend; the original subject with foo.XXXXXX was bounced by vger for\nbeing too sexy]\n\n-- >8 --\nSubject: [PATCH] t7610: clean up foo.XXXXXX tmpdir\n\nThe lazy prereq for MKTEMP uses \"mktemp -t\" to see if\nmergetool's internal mktemp call will be able to run. But\nunlike the call inside mergetool, we do not ever bother to\nclean up the result, and the /tmp of git developers will\nslowly fill up with \"foo.XXXXXX\" directories as they run the\ntest suite over and over.  Let's clean up the directory\nafter we've verified its creation.\n\nNote that we don't use test_when_finished here, and instead\njust make rmdir part of the &&-chain. We should only remove\nsomething that we're confident we just created. A failure in\nthe middle of the chain either means there's nothing to\nclean up, or we are very confused and should err on the side\nof caution.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThis has been happening since c578a09bd (t7610: test for mktemp before\ntest execution, 2016-07-02). I have noticed the foo.* directories\nbuilding in /tmp, but I never bothered to track it down before.  I just\nassumed from the name it was one of my personal hacky scripts. :)\n\nIt does make me wonder if test-lib.sh ought to just set $TMPDIR inside\nthe trash directory so that any cruft we fail to cleanup is contained.\n\n t/t7610-mergetool.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh\nindex 6d9f21511..63d36fb28 100755\n--- a/t/t7610-mergetool.sh\n+++ b/t/t7610-mergetool.sh\n@@ -591,7 +591,8 @@ test_expect_success 'filenames seen by tools start with ./' '\n \n test_lazy_prereq MKTEMP '\n \ttempdir=$(mktemp -d -t foo.XXXXXX) &&\n-\ttest -d \"$tempdir\"\n+\ttest -d \"$tempdir\" &&\n+\trmdir \"$tempdir\"\n '\n \n test_expect_success MKTEMP 'temporary filenames are used with mergetool.writeToTemp' '\n-- \n2.11.0.rc3.315.gde8259a\n"}]}