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 24, 2017, 20:29 UTC
Message-ID
<CABPp-BG+WCrPY3XNHCGK3fLGAO11wMtf1_kn1tuKojRAHSDvDg@mail.gmail.com>
In-Reply-To
<CAPig+cTtT2xLHy6gE9fW9G_KdzGTNEfgwz7NUOUwHxGKOkiKtA@mail.gmail.com>
On Fri, Nov 24, 2017 at 12:04 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 27 quoted lines
> On Fri, Nov 24, 2017 at 2:59 PM, Elijah Newren <newren@gmail.com> wrote:
>> In commit ae352c7f3 (merge-recursive.c: fix case-changing merge bug,
>> 2014-05-01), it was observed that removing files could be problematic on
>> case insensitive file systems, because we could end up removing files
>> that differed in case only rather than deleting the intended file --
>> something that happened when files were renamed on one branch in a way
>> that differed only in case.  To avoid that problem, that commit added
>> logic to avoid removing files other than the one intended, rejecting the
>> removal if the files differed only in case.
>>
>> Unfortunately, the logic it used didn't fully implement that condition as
>> stated above; instead it merely checked that a case-insensitive lookup of
>> the file that was requested resulted in finding a file in the index at
>> stage 0, not that the file found in the index actually differed in case.
>> Alternatively, one could view the implementation as making an implicit
>> assumption that the file we actually wanted to remove would never appear
>> in the index with a stage of 0, and thus that if we found a file with our
>> lookup, that it had to be a different file (but different in case only).
>>
>> The net result of this implementation is that it can ignore more requests
>> than it should, leaving a file around in the working copy that should
>> have been removed.  Make sure that the file found in the index actually
>> differs in case before silently ignoring the request to remove the file.
>>
>> ---
>
> Missing sign-off.
Whoops!
Signed-off-by: Elijah Newren <newren@gmail.com>
Previous: Eric SunshineNext: Junio C Hamano
Message 3 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.