git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why does git-grep appear to treat exclude pathspecs differently?
@ 2025-07-26 13:44 D. Ben Knoble
  2025-07-27  0:16 ` Junio C Hamano
  0 siblings, 1 reply; 12+ messages in thread
From: D. Ben Knoble @ 2025-07-26 13:44 UTC (permalink / raw)
  To: Git

With Git 2.48.1, I observe the following behavior:

- "git ls-files :^:Documentation/RelNotes | grep Rel" yields
"RelNotes", as expected
- "git grep squash :^:Documentation/RelNotes" yields the error

fatal: ambiguous argument ':^:Documentation/RelNotes': unknown
revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

- "git grep squash :^Documentation/RelNotes", "git grep squash
:^:Documentation/RelNotes/\*", and "git grep squash --
:^:Documentation/RelNotes" all work as expected

So I suppose, upon re-reading, that my question is really: what about
":^:Documentation/RelNotes" is ambiguous when handed to git-grep here?
There are a few revision syntaxes that start with colon, but none that
are followed directly by a caret, I think—and :^… can't be "revision
:'s parent…"

-- 
D. Ben Knoble

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-08-05 20:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).