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

Re: [PATCH] mergetools/p4merge: Handle "/dev/null"

From
David Aguilar <davvid@gmail.com>
Date
Dec 20, 2012, 04:41 UTC
Message-ID
<CAJDDKr5rxUPzqkiNAhPpEkK4ajyPNkNsGdPYWca3oggBrWybmg@mail.gmail.com>
In-Reply-To
<508B9F89.7050909@game-point.net>
On Sat, Oct 27, 2012 at 1:47 AM, Jeremy Morton <admin@game-point.net> wrote:
Show 15 quoted lines
> Sorry to be replying to this so late; I hadn't noticed the post until now!
>
> I've tried putting that code in my p4merge script and yes it does indeed
> work fine.  However, it puts a temporary file in the working directory which
> I'm not sure is a good idea?  If we look at this patch which actually solved
> pretty much the same problem, but when merging and, during a merge conflict,
> a file was created in both branches:
> https://github.com/git/git/commit/ec245ba
>
> ... it is creating a temp file in a proper temp dir, rather than in the
> working dir.  I think that would be the proper solution here.  However, I
> really want to get this fixed so I'd be happy for this band-aid fix of the
> p4merge script to be checked in until we could get a patch more like the
> aforementioned one, at a later date, to create empty files in a proper temp
> dir and pass them as $LOCAL and $REMOTE.  :-)

I had the same thoughts when I wrote it, but I figured that following the existing pattern used by mergetool for $REMOTE and $LOCAL when they do exist was simpler as the first step.

I have a patch that fixes this by using mktemp that I will send shortly. It only does it for the /dev/null file since the existing behavior for files that do exist is fine.

-- 
David
Previous: Jeremy Morton
Message 3 of 3 in “mergetools/p4merge: Handle "/dev/null"”
  1. mergetools/p4merge: Handle "/dev/null"David Aguilar, Oct 11, 2012
  2. Jeremy MortonOct 27, 2012
  3. David AguilarDec 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.