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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 21, 2012, 16:08 UTC
Message-ID
<7v4njf2xrk.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1356073023-15376-1-git-send-email-davvid@gmail.com>
David Aguilar <davvid@gmail.com> writes:
> Use $TMPDIR when creating the /dev/null placeholder for p4merge.
> This keeps it out of the current directory.

The usual $REMOTE "this is theirs" and $LOCAL "this is ours" are still created in the current directory, no? It is unclear why this "this side does not exist" case wants to be outside of the current directory in the first place.

In other words, "This keeps it out of the current directory" only explains what this patch changes, without explaining why it is a good thing to do in the first place.

Show 6 quoted lines
> +create_empty_file () {
> +	empty_file="${TMPDIR:-/tmp}/git-difftool-p4merge-empty-file.$$"
> +	>"$empty_file"
> +
> +	printf "$empty_file"
> +}

Assuming that it makes sense to create only the "this side doe not exist, and here is a placeholder empty file" in $TMPDIR, I think this is probably sufficient.

By the way, who is going to remove this temporary file once the command is done?

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