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

Re: [PATCH] mergetools/p4merge: Honor $TMPDIR for the /dev/null placeholder

From
David Aguilar <davvid@gmail.com>
Date
Dec 20, 2012, 08:03 UTC
Message-ID
<CAJDDKr63Yf0-3yTppGKAW+19wHY_OOF0iiKZ_6XR+Vae-7Bx7w@mail.gmail.com>
In-Reply-To
<7v623x6xvv.fsf@alter.siamese.dyndns.org>
On Wed, Dec 19, 2012 at 10:28 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> David Aguilar <davvid@gmail.com> writes:
>
>> Use mktemp to create the /dev/null placeholder for p4merge.
>> This keeps it out of the current directory.
>>
>> Reported-by: Jeremy Morton <admin@game-point.net>
>> Signed-off-by: David Aguilar <davvid@gmail.com>
>> ---
>> I consider this a final finishing touch on a new 1.8.1 feature,
>> so hopefully we can get this in before 1.8.1.
>
> Does everybody have mktemp(1), which is not even in POSIX.1?
>
> I'm a bit hesitant to apply this to the upcoming release without
> cooking it in 'next' for sufficiently long time to give it a chance
> to be tried by wider audience.

True. I only tried Linux and Mac OS X, so I would not be surprised to find some exotic UNIX that does not have mktemp.

I meant to write "is this portable?" in the section after the double-dash; saying that it's polish for a fix is only true if it's portable.

The git-unpack thing looks interesting... is the SHA-1 in your example the special SHA-1 for an empty tree or blob?

The reason I ask is because in this code path we are comparing an unknown blob, basically a blob that does not exist in one of the trees, so I'm not sure if an 'unpack' command would help for this case because we would not have a blob SHA-1 to unpack.

As far as portability goes, the "UNIX" list for p4merge is here:

http://www.perforce.com/downloads/complete_list

I do not have AIX, Solaris, or FreeBSD to test, so I agree that this can wait.

Does msysgit have mktemp?

p4merge is available on Windows too so I would need to check there too unless someone happens to know off the top of their heads.

My other thought was to write a simple shell function that checks TMPDIR itself, and defaults to creating some file under /tmp when it is undefined. I can pursue this option if you think it's a safer choice.

-- 
David
Previous: Junio C HamanoNext: Joachim Schmitz
Message 4 of 5 in “mergetools/p4merge: Honor $TMPDIR for the /dev/null placeholder”
  1. mergetools/p4merge: Honor $TMPDIR for the /dev/null placeholderDavid Aguilar, Dec 20, 2012
  2. Junio C HamanoDec 20, 2012
  3. Junio C HamanoDec 20, 2012
  4. David AguilarDec 20, 2012
  5. Joachim SchmitzDec 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.