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

Re: [PATCH] git-mv: fix git mv bug with case insensitive fs

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 6, 2021, 04:05 UTC
Message-ID
<xmqq7doqwvzx.fsf@gitster.c.googlers.com>
In-Reply-To
<20201231071357.mtcxmoxbg6jrq3gn@tb-raspi4>
Torsten Bögershausen <tboegi@web.de> writes:
Show 35 quoted lines
> On Tue, Dec 29, 2020 at 02:06:37AM +0000, Dan Moseley wrote:
>
> First of all, thanks for submitting this to git.git.
> I take the freedom to add some comments here.
>
>> Fix git mv to not assert when src is already in the index under a
>> different casing, core.caseInsensitive=true, and the file system
>> is case insensitive.
> The config variable is named core.ignorecase
>
> Does it make sense to illustrate the use case here, like this:
>
>  git init
>  echo foo >foo
>  git add foo
>  git mv foo FOO
>  git mv foo bar
>
>>
>> Since 9b906af657 the check that git mv does to ensure the src is in the
>> cache respects caseInsensitive. As a result git mv allows a move from a
>> file that has a different case in the index than it does on disk.
>> After the rename on disk, git mv fails to find the file in the cache
>> in order to rename it in the index, and asserts.
>> Assertion failed: pos >= 0, file builtin/mv.c, line 295
>>
>> This is the simplest possible fix, suggested by @tboegi. It does leave
>> the file renamed on disk, but that is easy to reverse after the error.
>
> We can expand the short-ish "@tboegi" into a "Helped-by" line, please see below.
> And refrase the paragraf like this:
>
> This is the simplest possible fix, it avoids to leaving a .git/index.lock
> behind.  It does leave the file renamed on disk,
> but that is easy to reverse after the error.

Sorry but I feel lost here. So this is not a fix with which the end user does not have to do anything after kicking in? The only thing it "fixes" is to avoid hitting a BUG() or something that can leave the .lock file behind (so that the user does not have to run "rm .git/index.lock" after the operation)?

Previous: Torsten BögershausenNext: tboegi@web.de
Message 3 of 13 in “git-mv: fix git mv bug with case insensitive fs”
  1. git-mv: fix git mv bug with case insensitive fsDan Moseley, Dec 29, 2020
  2. Torsten BögershausenDec 31, 2020
  3. Junio C HamanoJan 6, 2021
  4. 1/1 git mv foo FOO ; git mv foo bar gave an asserttboegi@web.de, Jan 6, 2021
  5. Junio C HamanoJan 6, 2021
  6. 1/1 git mv foo FOO ; git mv foo bar gave an asserttboegi@web.de, Mar 1, 2021
  7. Junio C HamanoMar 1, 2021
  8. Chris TorekMar 1, 2021
  9. Junio C HamanoMar 1, 2021
  10. 1/1 git mv foo FOO ; git mv foo bar gave an asserttboegi@web.de, Mar 1, 2021
  11. Junio C HamanoMar 1, 2021
  12. Dan MoseleyMar 1, 2021
  13. Junio C HamanoMar 1, 2021

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.