All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: tboegi@web.de
Cc: git@vger.kernel.org, johannes.schindelin@gmx.de,
	Dan.Moseley@microsoft.com
Subject: Re: [PATCH/RFC v1 1/1] git mv foo FOO ; git mv foo bar gave an assert
Date: Wed, 06 Jan 2021 15:51:50 -0800	[thread overview]
Message-ID: <xmqqpn2hoc89.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20210106105302.16878-1-tboegi@web.de> (tboegi@web.de's message of "Wed, 6 Jan 2021 11:53:02 +0100")

tboegi@web.de writes:

> 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" you mean.

>
> 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"
>
> Don't check if the case-insensitive version is in the index.
> In the sense of 9b906af657 supply the user with a more helpful message.
>
> This fixes
> https://github.com/git-for-windows/git/issues/2920
>
> Reported-By: Dan Moseley <Dan.Moseley@microsoft.com>
> Signed-off-by: Torsten Bögershausen <tboegi@web.de>
> ---
>
> Note:
> There is an ongoing effort to replace cache_file_exists() with
> index_file_exists().  So this patch may need to be re-done.

Thanks for a heads-up.

>
> Note2: @Dan Moseley: Do you want to continue with this work ?
>
> builtin/mv.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/mv.c b/builtin/mv.c
> index 7dac714af9..8572a5dae0 100644
> --- a/builtin/mv.c
> +++ b/builtin/mv.c
> @@ -221,8 +221,11 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
>  				}
>  				argc += last - first;
>  			}
> -		} else if (!(ce = cache_file_exists(src, length, ignore_case))) {
> -			bad = _("not under version control");
> +		} else if (!(ce = cache_file_exists(src, length, 0))) {
> +			if (cache_file_exists(src, length, ignore_case))
> +				bad = _("not under version control (upper/lower mixup)");
> +			else
> +				bad = _("not under version control");
>  		} else if (ce_stage(ce)) {
>  			bad = _("conflicted");
>  		} else if (lstat(dst, &st) == 0 &&
> --
> 2.28.0.97.gdc04167d37

  reply	other threads:[~2021-01-06 23:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BYAPR21MB1158F64E1141453F7D00B46CE0D89@BYAPR21MB1158.namprd21.prod.outlook.com>
     [not found] ` <BYAPR21MB11585FFD46DEE7AD4EEEFEABE0D89@BYAPR21MB1158.namprd21.prod.outlook.com>
2020-12-29  2:06   ` [PATCH] git-mv: fix git mv bug with case insensitive fs Dan Moseley
2020-12-31  7:13     ` Torsten Bögershausen
2021-01-06  4:05       ` Junio C Hamano
2021-01-06 10:53         ` [PATCH/RFC v1 1/1] git mv foo FOO ; git mv foo bar gave an assert tboegi
2021-01-06 23:51           ` Junio C Hamano [this message]
2021-03-01 17:05         ` [PATCH v2 " tboegi
2021-03-01 19:21           ` Junio C Hamano
2021-03-01 19:36             ` Chris Torek
2021-03-01 21:53               ` Junio C Hamano
     [not found]         ` <20210301170425.12154-1-tboegi@web.de>
2021-03-01 20:23           ` [EXTERNAL] " Dan Moseley
2021-03-01 21:47             ` Junio C Hamano
2021-03-01 21:41         ` [PATCH v3 " tboegi
2021-03-01 23:59           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqpn2hoc89.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=Dan.Moseley@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.