git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

Previous: David AguilarNext: Jakub Narebski
Message 3 of 8 in “difftool: teach difftool to handle directory diffs”
  1. 7/9 difftool: teach difftool to handle directory diffsTim Henigan, Mar 17, 2012
  2. David AguilarMar 17, 2012
  3. Tim HeniganMar 17, 2012
  4. Jakub NarebskiMar 17, 2012
  5. Tim HeniganMar 18, 2012
  6. Tim HeniganMar 20, 2012
  7. Junio C HamanoMar 20, 2012
  8. Tim HeniganMar 20, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.