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

Re: [PATCH v2 1/1] git mv foo FOO ; git mv foo bar gave an assert

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 1, 2021, 19:21 UTC
Message-ID
<xmqqzgzmptmy.fsf@gitster.c.googlers.com>
In-Reply-To
<20210301170536.12265-1-tboegi@web.de>
tboegi@web.de writes:
Show 5 quoted lines
> From: Torsten Bögershausen <tboegi@web.de>
>
> The following sequence, on a case-insensitive file system,
> (strictly speeking with core.ignorecase=true)
> leads to an assertion, and leaves .git/index.lock behind.
"an assertion failure", I presume?
Show 20 quoted lines
>
> git init
> echo foo >foo
> git add foo
> git mv foo FOO
> git mv foo bar
>
> This regression was introduced in Commit 9b906af657,
> "git-mv: improve error message for conflicted file"
>
> The bugfix is to change the "file exist case-insensitive in the index"
> into the correct "file exist (case-sensitive) in the index".
> This avoids the "assert".
>
> Reported-By: Dan Moseley <Dan.Moseley@microsoft.com>
>
> This fixes
> https://github.com/git-for-windows/git/issues/2920
>
> Signed-off-by: Torsten Bögershausen <tboegi@web.de>

By breaking the list of trailers with an unrelated comment in the middle, the "Reported-by" won't be recognized as a trailer. We'd want to credit non-authorship contribution in the release notes starting in the upcoming release, and this will start mattering. Please fix it.

Show 6 quoted lines
> @@ -221,7 +221,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
>  				}
>  				argc += last - first;
>  			}
> -		} else if (!(ce = cache_file_exists(src, length, ignore_case))) {
> +		} else if (!(ce = cache_file_exists(src, length, 0))) {
Good finding.
Before the problematic patch, this used to be
               } else if (cache_name_pos(src, length) < 0)

I wonder if we should revert the change to use cache_file_exists() in the first place (and rewrite the subsequent use of ce to match), though.

Thanks.
Previous: tboegi@web.deNext: Chris Torek
Message 7 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.