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
Junio C Hamano <gitster@pobox.com>
Date
Apr 19, 2011, 22:01 UTC
Message-ID
<7vfwpd529g.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vwriq3p0t.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> Also, the command to use when you want to get an empty file is not "touch".
> It is not likely that you would have an existing file there, but the whole
> point of the updated codepath is to have an empty file, and not a file
> with recent timestamp, it would be far more sensible to say
>
> 	: >"$BASE"
>
> i.e. redirect into the path, with a no-op command.

By the way, you may want to study what git-merge-one-file.sh script does when given a "both sides added, but differently" situation (look for a string "--no-add" in the script). It first tries to see if there are many common material that are added in both sides, and if so tries to use that common material as the "fake" base. If there isn't enough common material, it uses an empty file as the base.

Previous: Junio C HamanoNext: Ciaran
Message 3 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.