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

Re: [PATCH] merge-recursive: ignore_case shouldn't reject intentional removals

From
Elijah Newren <newren@gmail.com>
Date
Nov 25, 2017, 22:35 UTC
Message-ID
<CABPp-BGcfFOvv+-uW2_EaftLiU-xs_D4g8hsYOZqjk1XwK_8Fw@mail.gmail.com>
In-Reply-To
<xmqqd147kpdm.fsf@gitster.mtv.corp.google.com>
On Fri, Nov 24, 2017 at 7:29 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 28 quoted lines
> Elijah Newren <newren@gmail.com> writes:
>
>>     But what it really is forced to do is more of a 4-way merge; a good
>>     chunk of its annoying complexity is based around this (undocumented
>>     and unfortunate) reality.  It derives from what I consider a simple
>>     design flaw.
>
> Yes, and it does not help that it wants to write into the filesystem
> while it performs the outermost merges.
>
> In the ideal world, we should
>
>  - ask unpack_trees() to do "read-tree -m" without "-u";
>
>  - do all the merge-recursive computations in-core and prepare the
>    resulting index, while keeping the current index intact;
>
>  - compare the current in-core index and the resulting in-core
>    index, and notice the paths that need to be added, updated or
>    removed in the working tree, and ensure that there is no loss of
>    information when the change is reflected to the working tree,
>    e.g. the result wants to create a file where the working tree
>    currently has a directory with non-expendable contents in it, the
>    result wants to remove a file where the working tree file has
>    local modification, etc.; and then finally
>
>  - carry out the working tree update to make it match what the
>    resulting in-core index says it should look like.

I had another email I had been composing to try to argue for changing merge-recursive.c's design to the above, assuming I could get the time to work on it. Nice to see that I'm not crazy, and that I apparently don't need to do much convincing. :-)

Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 10 in “merge-recursive: ignore_case shouldn't reject intentional removals”
  1. merge-recursive: ignore_case shouldn't reject intentional removalsElijah Newren, Nov 24, 2017
  2. Eric SunshineNov 24, 2017
  3. Elijah NewrenNov 24, 2017
  4. Junio C HamanoNov 25, 2017
  5. Elijah NewrenNov 25, 2017
  6. Junio C HamanoNov 26, 2017
  7. Junio C HamanoNov 27, 2017
  8. Elijah NewrenNov 27, 2017
  9. Junio C HamanoNov 27, 2017
  10. Elijah NewrenNov 28, 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.