From: Junio C Hamano <gitster@pobox.com>
To: "D. Ben Knoble" <ben.knoble@gmail.com>
Cc: Git <git@vger.kernel.org>
Subject: Re: Why does git-grep appear to treat exclude pathspecs differently?
Date: Sat, 02 Aug 2025 10:23:10 -0700 [thread overview]
Message-ID: <xmqqo6sxhc3l.fsf@gitster.g> (raw)
In-Reply-To: <CALnO6CDgjmDd9kBCLzjb=JS6Rqg33aXesjthr_Q=HCA-ru2k6g@mail.gmail.com> (D. Ben Knoble's message of "Sat, 2 Aug 2025 12:14:07 -0400")
"D. Ben Knoble" <ben.knoble@gmail.com> writes:
>> > > - "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":
Because the most natural way to spell it is ":!Documentation/RelNotes"
not ":^:Documentation/RelNotes"?
And that is why I did not say "invalid way to spell". It just was
unnecessarily unfamiliar form to say the same thing.
But as you need more than one "prefix" to the real pathname to
trigger the bug in the disambiguation code, :! alone would not have
exhibited the symptom, and you would have needed something
multi-letter like :!: or :!/ in front of that path.
prev parent reply other threads:[~2025-08-02 17:23 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
2025-08-02 17:23 ` 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=xmqqo6sxhc3l.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=ben.knoble@gmail.com \
--cc=git@vger.kernel.org \
/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.