Re: [PATCH 7/9] difftool: teach difftool to handle directory diffs
- From
Tim Henigan <tim.henigan@gmail.com>
- Date
- Mar 17, 2012, 14:18 UTC
- Message-ID
- <CAFouetgFwaksCpggMER28i9UhEfpWhRcx5To8ck0Bsv+mbirTg@mail.gmail.com>
- In-Reply-To
- <CAJDDKr4mc7OwUzE9d51KkgMaMauVJx_T=rdmXnhEc_a0hc0LGQ@mail.gmail.com>
On Fri, Mar 16, 2012 at 11:08 PM, David Aguilar <davvid@gmail.com> wrote:
> On Fri, Mar 16, 2012 at 6:59 PM, Tim Henigan <tim.henigan@gmail.com> wrote:
Show 6 quoted lines
>> + # Setup temp directories
>> + my $tmpdir = tempdir('/tmp/git-diffall.XXXXX', CLEANUP => 1);
>
> Is it okay to hardcode /tmp here, or should we instead do something like this?:
>
> my $tmp = $ENV{TMPDIR} || '/tmp';This could be done better. Based on the documentation [1], it appears that the proper way to do this is:
my $tmpdir = tempdir('git-diffall.XXXXX', CLEANUP => 1, TMPDIR => 1);Adding 'TMPDIR => 1' is the equivalent of commanding the tmp dir to be created in 'File::Spec->tmpdir' [2].
I will try this out and send a v2 patch.
[1]: http://perldoc.perl.org/File/Temp.html [2]: http://perldoc.perl.org/File/Spec.html