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

Re: Custom merge drivers: accessing the pathnames and revisions of the files being merged

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 16, 2024, 17:51 UTC
Message-ID
<xmqqedeh1816.fsf@gitster.g>
In-Reply-To
<8bb5e41e-4db9-4527-8492-3aca6a0f40bf@delpeuch.eu>
Antonin Delpeuch <antonin@delpeuch.eu> writes:
Show 6 quoted lines
> So, I wonder: would people be open to exposing additional parameters
> to merge drivers? For instance we could add parameters "%X", "%Y" "%Z"
> to expose those "revision:pathname" strings for each part. (I think
> colons cannot be part of revision names, so this can be parsed
> unambiguously by the custom merge driver to recover the revision and
> pathname independently, if needed.)

The last time this changed was in ef45bb1f (ll-merge: pass the original path to external drivers, 2015-06-04).

I may not necessarily endorse the choice of XYZ [*], but I do not fundamentally oppose to such a new feature existing. The mechanism to define a custom merge driver is designed to be future-proof in that only the parameters it uses is given as the value of merge.*.driver variable, so it is not a problem that existing merge drivers will not know what to do with "pathname in the common ancestor", "pathname on our side", and "pathname on their side".

[Footnote]
 * Whatever letters we choose, they must have mnemonic value that
   signals two of them are the both sides of the merge that are
   equal participants, and the other one is the old-file, their
   common ancestor that plays quite a different from these two in
   the merge.  I cannot tell which one of the XYZ would be the more
   special than other two, which is the primary reason why I do not
   know if XYZ is a good idea.
Previous: Antonin DelpeuchNext: Antonin Delpeuch
Message 2 of 3 in “Custom merge drivers: accessing the pathnames and revisions of the files being merged”
  1. Antonin DelpeuchJan 16, 2024
  2. Junio C HamanoJan 16, 2024
  3. Antonin DelpeuchJan 16, 2024

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.