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

Re: Fixing the p4merge launch shell script

From
David Aguilar <davvid@gmail.com>
Date
Oct 4, 2012, 06:59 UTC
Message-ID
<CAJDDKr6qqo+a545bx=ygDmzLFAT5yU=ue+Fv0QpZeBGXuOeG6A@mail.gmail.com>
In-Reply-To
<loom.20121003T103315-553@post.gmane.org>
On Wed, Oct 3, 2012 at 1:34 AM, Jeremy Morton <admin@game-point.net> wrote:
Show 23 quoted lines
> Junio C Hamano <gitster <at> pobox.com> writes:
>
>>
>> Jeremy Morton <admin <at> game-point.net> writes:
>>
>> > I've noticed that the p4merge shell script could do with some
>> > improvement when it comes to merging.  Because p4merge throws up an
>> > error when one of the files it's given to diff is "/dev/null", git
>> > needs to create a temporary empty file and pass that to p4merge when
>> > diffing a file that has been created/deleted (eg. create file, git add
>> > ., git diff --cached).
>> > ...
>> > Thoughts?  Is there an easier way to do this?
>>
>> Which version of git?  Perhaps you do not have ec245ba (mergetool:
>> Provide an empty file when needed, 2012-01-19) yet?
>>
>
> That patch fixes the mergetool part, but the part I was referring to was the
> difftool part, which still has this problem.
>
> Best regards,
> Jeremy Morton (Jez)
Thanks for the heads-up, Jez.

I should have some time to take a look this weekend. If someone beats me to it I'll be happy to review the patches before then (Jeremy? ;-)

Is `git diff` giving us /dev/null as the path here, and p4merge doesn't like that, or is something else going on?

If that's indeed happening, then I would imagine a sensible thing for git-difftool--helper to do would be to check for /dev/null and create some temporary empty file.

Does that sound like the right way to go? Another option would be for git-diff's external diff code to handle it at a much earlier point, perhaps guarded behind an option that git-difftool knows to pass (changing existing behavior is off the table).

These both sound like pretty big changes given that we're getting ready for 1.8.0.

If it's just p4merge that doesn't like this then perhaps the right decision is to paper over it in p4merge's mergetools/ scriptlet.

It's certainly the least-impactful option.  Thoughts?
-- 
David
Previous: Jeremy Morton
Message 4 of 4 in “Fixing the p4merge launch shell script”
  1. Jeremy MortonOct 2, 2012
  2. Junio C HamanoOct 3, 2012
  3. Jeremy MortonOct 3, 2012
  4. David AguilarOct 4, 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.