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

Re: [RFC PATCH] Pass empty file to p4merge where no base is suitable.

From
Ciaran <ciaranj@gmail.com>
Date
May 1, 2011, 22:08 UTC
Message-ID
<BANLkTikv0YmB-u74sOrQUQZGQvYJNmBx_w@mail.gmail.com>
In-Reply-To
<7v7haarsrd.fsf@alter.siamese.dyndns.org>
On Sun, May 1, 2011 at 10:54 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 23 quoted lines
> Ciaran <ciaranj@gmail.com> writes:
>
>>> I suspect that you may be able to simply use "$BASE" for that, no?  It
>>> will be cleaned up when cleanup_temp_files() is run anyway (warning: I do
>>> not use mergetool, and I am writing this only from my cursory looking of
>>> the script, so take this with a large grain of salt).
>> I don't think so, the BASE file isn't created at-all in this scenario afaict.
>
> Hmm, just like $BASE, your .no-base is not created at all in this scenario
> either, but you create it yourself in your patch, and because you picked a
> new filename for that temporary file, you also need to worry about
> cleaning it up.
>
> Why can't that temporary file be "$BASE"?  That is what I was asking.
> Then you would still create an empty file (but see *1*), and can rely on
> existing codepaths to clean it up.
>
> IOW, wouldn't it be far simpler to turn the part you are patching into
> these three lines?
>
>        $base_present || >"$BASE"
>        "$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
>        check_unchanged

Yes, that is a *much* better solution that solves my issue perfectly ;) Patch to follow.

<!-- Snip -->
Show 6 quoted lines
> [Footnote]
>
> *1* It also may be worth considering to employ the "use either an empty
>    file or use the common parts of merged files, whichever makes the
>    merge simpler, as a phony base" technique found in git-merge-one-file.
>

I did consider your earlier post on this, but it seems that that perforce's merge client is sufficiently smart enough to do this alignment/matching itself, so the effort isn't required (imho) for this client (which is the client that I'm experiencing 'pain' with atm !

Thanks,
- Cj.
Previous: Junio C HamanoNext: Ciaran
Message 6 of 9 in “Pass empty file to p4merge where no base is suitable.”
  1. Pass empty file to p4merge where no base is suitable.Ciaran, Apr 19, 2011
  2. Junio C HamanoApr 19, 2011
  3. Junio C HamanoApr 19, 2011
  4. CiaranMay 1, 2011
  5. Junio C HamanoMay 1, 2011
  6. CiaranMay 1, 2011
  7. CiaranMay 1, 2011
  8. Junio C HamanoMay 1, 2011
  9. CiaranMay 2, 2011

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.