From: "D. Ben Knoble" <ben.knoble@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git <git@vger.kernel.org>
Subject: Re: Why does git-grep appear to treat exclude pathspecs differently?
Date: Sat, 2 Aug 2025 12:14:07 -0400 [thread overview]
Message-ID: <CALnO6CDgjmDd9kBCLzjb=JS6Rqg33aXesjthr_Q=HCA-ru2k6g@mail.gmail.com> (raw)
In-Reply-To: <CALnO6CDNDfx6L7CmPwE0eBZFkd_JkZf6hDwrADccAb14QhJGDg@mail.gmail.com>
On Wed, Jul 30, 2025 at 5:49 PM D. Ben Knoble <ben.knoble@gmail.com> wrote:
>
> On Sat, Jul 26, 2025 at 8:16 PM Junio C Hamano <gitster@pobox.com> wrote:
> >
> > "D. Ben Knoble" <ben.knoble@gmail.com> writes:
> >
> > > With Git 2.48.1, I observe the following behavior:
> > >
> > > - "git ls-files :^:Documentation/RelNotes | grep Rel" yields
> > > "RelNotes", as expected
> >
> > It is deliberately confusing to spell ":(exclude)" as ":^:".
>
> What makes you say that? It's documented in "git help revisions":
Er, that's "git help glossary" for the quotes below—woops!
>
> A pathspec that begins with a colon : has special meaning. In the
> short form, the leading colon : is followed by zero or more "magic
> signature" letters (which optionally is terminated by another colon
> :), and the remainder is the pattern to match against the path.
>
> and
>
> exclude
> After a path matches any non-exclude pathspec, it will be run
> through all exclude pathspecs (magic signature: ! or its synonym
> ^).
>
--
D. Ben Knoble
next prev parent reply other threads:[~2025-08-02 16:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-26 13:44 Why does git-grep appear to treat exclude pathspecs differently? D. Ben Knoble
2025-07-27 0:16 ` Junio C Hamano
2025-07-30 21:49 ` D. Ben Knoble
2025-08-02 9:46 ` Jeff King
2025-08-02 16:13 ` D. Ben Knoble
2025-08-02 18:52 ` Jeff King
2025-08-03 5:56 ` Junio C Hamano
2025-08-05 18:57 ` Jeff King
2025-08-05 20:06 ` Junio C Hamano
2025-08-02 17:12 ` Junio C Hamano
2025-08-02 16:14 ` D. Ben Knoble [this message]
2025-08-02 17:23 ` 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='CALnO6CDgjmDd9kBCLzjb=JS6Rqg33aXesjthr_Q=HCA-ru2k6g@mail.gmail.com' \
--to=ben.knoble@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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 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 NNTP newsgroup(s).