All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "René Scharfe" <l.s.r@web.de>,
	"Sergii Shkarnikov" <sergii.shkarnikov@globallogic.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Git List" <git@vger.kernel.org>
Subject: Re: Possible bug with git restore
Date: Sat, 22 Aug 2020 12:36:09 -0700	[thread overview]
Message-ID: <xmqq364e79sm.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20200820182720.GA2537643@coredump.intra.peff.net> (Jeff King's message of "Thu, 20 Aug 2020 14:27:20 -0400")

Jeff King <peff@peff.net> writes:

> So I think this inconsistency in pathspec matching between trees and the
> index has probably existed in git-checkout for ages (and I guess people
> don't do wildcards with trees often enough for anybody to have noticed).
> But it didn't cause the index-deletion problem, because that only
> appeared more recently with the --no-overlay mode. That's the default
> for restore, but you can trigger the problem with checkout, too:
>
>   $ git reset --hard
>   $ git checkout --no-overlay HEAD^ '*.hpp'
>   Updated 0 paths from 2668463
>   $ git status
>   On branch master
>   Changes to be committed:
> 	deleted:    incl/test_file.hpp

The --no-overlay mode is an enhancement added on top of reasonably
aged codebase relatively recently.  Most of the core code in
checkout dates back to early 2008, while --no-overlay was done as a
long-overdue-afterthought in early last year.

And it is not all that surprising that this issue took a long time
to be discovered.

Thank you all for finding, analysing and fixing it promptly.



      parent reply	other threads:[~2020-08-22 19:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12 18:51 Possible bug with git restore Sergii Shkarnikov
2020-08-14 22:41 ` Eric Sunshine
2020-08-20 12:59   ` Sergii Shkarnikov
2020-08-20 13:40     ` Jeff King
2020-08-20 17:48       ` René Scharfe
2020-08-20 18:27         ` Jeff King
2020-08-22  8:57           ` [PATCH] checkout, restore: make pathspec recursive René Scharfe
2020-08-24 20:21             ` Jeff King
2020-08-22 10:29           ` Possible bug with git restore René Scharfe
2020-08-24 20:25             ` Jeff King
2020-08-22 19:36           ` Junio C Hamano [this message]

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=xmqq364e79sm.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=l.s.r@web.de \
    --cc=peff@peff.net \
    --cc=sergii.shkarnikov@globallogic.com \
    --cc=sunshine@sunshineco.com \
    /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.