From: Sergii Shkarnikov <sergii.shkarnikov@globallogic.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: Possible bug with git restore
Date: Thu, 20 Aug 2020 15:59:00 +0300 [thread overview]
Message-ID: <CAFvH=vuFg+kM2GkBaE7jRqHWWcTcZMrs36KLS+-VTy8tgNZXJw@mail.gmail.com> (raw)
In-Reply-To: <CAPig+cSCd_8YB90sypTe1bHMQhPgo+Tr2PHNucdqfCpEe+Dosg@mail.gmail.com>
Here is a script to reproduce the issue that works for me in Git Bash:
=============================================
#!/bin/bash
#create repo with corresponding structure
mkdir restore_bug_test
cd restore_bug_test
mkdir incl
mkdir src
touch incl/test_file.hpp
touch src/test_file.cpp
git init
git add .
git commit -m"initial"
#add a couple of commits
echo "1" >> incl/test_file.hpp
echo "1" >> src/test_file.cpp
git commit -am"1"
echo "2" >> incl/test_file.hpp
echo "2" >> src/test_file.cpp
git commit -am"2"
#reproduce bug
git restore -s HEAD~ -- *test_file.*
git status
===============================================
Haven't checked filenames explicitly, but they haven't been changed manually.
And there are no explicit case changes in the attached script.
On Sat, Aug 15, 2020 at 1:42 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
>
> On Wed, Aug 12, 2020 at 2:51 PM Sergii Shkarnikov
> <sergii.shkarnikov@globallogic.com> wrote:
> > I tried to restore a couple of files from an earlier commit
> > running the restore command with a wildcard:
> >
> > git restore -s HEAD~ -- */filename.*
> >
> > In my work tree those are .cpp and .hpp files stored in different folders.
> > Both files were deleted (and got (delete) status).
> > Running this command without wildcards for each file separately
> > works as expected.
>
> Thanks for the report. Can you provide a complete recipe in the form
> of shell command to make this happen so others can reproduce the
> behavior? Doing so will help track down the issue. Also, since this is
> Windows, do the cases of the filenames in the referenced commit match
> the cases actually on the filesystem (and have the cases changed
> between commits)?
next prev parent reply other threads:[~2020-08-20 12:59 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 [this message]
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
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFvH=vuFg+kM2GkBaE7jRqHWWcTcZMrs36KLS+-VTy8tgNZXJw@mail.gmail.com' \
--to=sergii.shkarnikov@globallogic.com \
--cc=git@vger.kernel.org \
--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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).