From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, Jeff King <peff@peff.net>,
Thomas Gummerer <t.gummerer@gmail.com>
Subject: Re: [PATCH 2/2] built-in stash: handle :(glob) pathspecs again
Date: Mon, 11 Mar 2019 17:27:11 +0100 (STD) [thread overview]
Message-ID: <nycvar.QRO.7.76.6.1903111726050.41@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <xmqqh8c9kgy6.fsf@gitster-ct.c.googlers.com>
Hi Junio,
On Mon, 11 Mar 2019, Junio C Hamano wrote:
> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
>
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > When passing a list of pathspecs to, say, `git add`, we need to be
> > careful to use the original form, not the parsed form of the pathspecs.
> >
> > This makes a difference e.g. when calling
> >
> > git stash -- ':(glob)**/*.txt'
> >
> > where the original form includes the `:(glob)` prefix while the parsed
> > form does not.
> >
> > However, in the built-in `git stash`, we passed the parsed (i.e.
> > incorrect) form, and `git add` would fail with the error message:
> >
> > fatal: pathspec '**/*.txt' did not match any files
> >
> > at the stage where `git stash` drops the changes from the worktree, even
> > if `refs/stash` has been actually updated successfully.
> >
> > This fixes https://github.com/git-for-windows/git/issues/2037
> >
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > ---
> > builtin/stash.c | 5 +++--
> > t/t3905-stash-include-untracked.sh | 6 ++++++
> > 2 files changed, 9 insertions(+), 2 deletions(-)
> >
> > diff --git a/builtin/stash.c b/builtin/stash.c
> > index 1bfa24030c..2f29d037c8 100644
> > --- a/builtin/stash.c
> > +++ b/builtin/stash.c
> > @@ -830,7 +830,7 @@ static void add_pathspecs(struct argv_array *args,
> > int i;
> >
> > for (i = 0; i < ps.nr; i++)
> > - argv_array_push(args, ps.items[i].match);
> > + argv_array_push(args, ps.items[i].original);
> > }
>
> Yup. I think Thomas and Peff were also looking at the vicinity of
> this code wrt the pass-by-value-ness of ps parameter. Their fix
> need to also come on top of this (or combined together).
I agree. How can I help?
Ciao,
Dscho
next prev parent reply other threads:[~2019-03-11 16:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-07 15:29 [PATCH 0/2] stash: handle pathspec magic again Johannes Schindelin via GitGitGadget
2019-03-07 15:29 ` [PATCH 1/2] legacy stash: fix "rudimentary backport of -q" Johannes Schindelin via GitGitGadget
2019-03-11 7:27 ` Junio C Hamano
2019-03-07 15:29 ` [PATCH 2/2] built-in stash: handle :(glob) pathspecs again Johannes Schindelin via GitGitGadget
2019-03-11 7:28 ` Junio C Hamano
2019-03-11 16:27 ` Johannes Schindelin [this message]
2019-03-11 22:19 ` Thomas Gummerer
2019-03-08 1:37 ` [PATCH 0/2] stash: handle pathspec magic again Junio C Hamano
2019-03-08 16:12 ` Johannes Schindelin
2019-03-10 0:56 ` Junio C Hamano
2019-03-11 16:25 ` Johannes Schindelin
2019-03-18 4:39 ` Junio C Hamano
2019-03-18 7:02 ` 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=nycvar.QRO.7.76.6.1903111726050.41@tvgsbejvaqbjf.bet \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=t.gummerer@gmail.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).