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

Re: mergetool: what to do about deleting precious files?

From
Junio C Hamano <gitster@pobox.com>
Date
May 28, 2017, 13:06 UTC
Message-ID
<xmqqpoet9lms.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<D689F4F80DA24C78B5E0FB025B9548E6@PhilipOakley>
"Philip Oakley" <philipoakley@iee.org> writes:
Show 10 quoted lines
>> So I do not think this is not limited to "new file".  Anything that
>> a tree-level three-way merge would resolve cleanly without having to
>> consult the content-level three-way merge will complete without
>> consulting the merge.ours.driver; per-file content-level three-way
>> merge driver (which is what merge=<drivername> mechanism lets you
>> specify via the attributes mechanism) is not something you would
>> want to use for this kind of thing.  It is purely for resolving the
>> actual content-level conflicts.
>>
> That (that Git knows best) sounds just wrong.
Don't twist my words.  I never said Git knows best.  

The user-level merge driver is a mechanism to affect conflict level three-way merges. The interface to the content level three-way merge driver feeds three versions of blobs and the driver is expected to give a merged result. The interface as designed is incapable of passing "here is the common ancestor", "our side is missing" and "their side is this content".

So if we want a mechanism that can affect the outcome of tree-level three-way merge, we need a _new_ mechanism. The existing merge drivers that are written by end users (at least the ones written correctly to the spec, anyway) are not expecting to be called with "in our tree, there is no blob here", and trying to piggyback on it will break existing users.

Previous: Philip OakleyNext: Philip Oakley
Message 4 of 8 in “mergetool: what to do about deleting precious files?”
  1. Philip OakleyMay 27, 2017
  2. Junio C HamanoMay 28, 2017
  3. Philip OakleyMay 28, 2017
  4. Junio C HamanoMay 28, 2017
  5. Philip OakleyMay 29, 2017
  6. Junio C HamanoMay 30, 2017
  7. Philip OakleyMay 30, 2017
  8. Junio C HamanoMay 31, 2017

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.