Thread (9 messages) 9 messages, 4 authors, 2023-10-20

Re: [PATCH] grep: die gracefully when outside repository

From: Kristoffer Haugsbakk <hidden>
Date: 2023-10-15 08:00:46

On Sun, Oct 15, 2023, at 05:26, Jeff King wrote:
Is it even reasonable for "grep --no-index" to care about leaving the
tree in the first place? That is, is there a reason we should not allow:

  git grep --no-index foo ../bar

?
On second thought yeah, it doesn't make sense. We are outside of any
repository already so what does it matter where the file is relative to
the current working directory?

It seems that `pathspec.c:init_pathspec_item` should let you through in
this case.

-- 
Kristoffer Haugsbakk
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help