Subject: Re: [PATCH v2] difftool: don't overwrite modified files

From: Johannes Sixt <[email-masked]>
Date: Tue, 26 Mar 2013 10:53:48 +0100

Am 3/26/2013 10:31, schrieb John Keeping:
> On Tue, Mar 26, 2013 at 09:38:42AM +0100, Johannes Sixt wrote:
>> One question though: Do I understand correctly that the temporary
>> directories are leaked in the case of an "edit conflict"? If so, is it
>> worth a warning for the user to clean up the garbage?
> 
> Do you mean for normal users or for those running the tests?  In normal
> usage we do print a warning - it's in the existing code, triggered by
> setting "$error = 1" - you can see that if you run the tests with "-v".

I meant for normal users. I see the error now. Thanks.

> The last test does result in /tmp filling up with temporary directories
> though, it would be good if the test could clean up after itself.  The
> best I can come up with is adding something like this immediately after
> running difftool but I'm not entirely happy with the ".." in the
> argument to rm:
> 
> 	test_when_finished rm -rf "$(cat tmpdir)/.."

Wrap the test in

	(
		TMPDIR=$TRASH_DIRECTORY &&
		export TMPDIR &&
	...
	)

It works for me.

-- Hannes