All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Robert Dailey <rcdailey.lists@gmail.com>
Cc: Git <git@vger.kernel.org>
Subject: Re: Excluding paths with wildcard not working with add -p
Date: Sun, 29 May 2022 11:25:37 -0700	[thread overview]
Message-ID: <xmqqh758yz4u.fsf@gitster.g> (raw)
In-Reply-To: <CAHd499D81VN=aGsM6kaNLF2ZMg-Zg10U=qU-j7gQ7uXnqqfdqg@mail.gmail.com> (Robert Dailey's message of "Sun, 29 May 2022 12:27:33 -0500")

Robert Dailey <rcdailey.lists@gmail.com> writes:

> If I run the command:
>
>     git add -p -- ':^*.cs'
>
> I get an error:
>
> fatal: empty string is not a valid pathspec. please use . instead if
> you meant to match all paths
> Cannot close git diff-index --cached --numstat --summary HEAD --
> :(exclude,prefix:0)*.cs  () at C:/Program
> Files/Git/mingw64/libexec/git-core\git-add--interactive line 242.
>
> However, it works if I remove `-p`. Also observed this works too:
>
>     git add -p -- ':*.cs'
>
> So it looks like we have a corner case where I can't do a patch add
> while excluding files. Is this intentional?

I do not think so.

Does this command

    git add -p -- . ':^*.cs'

work as you expect?

  reply	other threads:[~2022-05-29 18:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-29 17:27 Excluding paths with wildcard not working with add -p Robert Dailey
2022-05-29 18:25 ` Junio C Hamano [this message]
2022-05-29 18:42   ` Junio C Hamano
2022-05-29 22:39     ` [PATCH] pathspec: correct an empty string used as a pathspec element Junio C Hamano
2022-05-29 23:01       ` rsbecker
2022-05-29 21:15   ` Excluding paths with wildcard not working with add -p Robert Dailey
2022-05-30 17:20     ` 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=xmqqh758yz4u.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rcdailey.lists@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.
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.