Thread (1 message) 1 message, 1 author, 2018-10-29

Re: [PATCH] wildmatch: change behavior of "foo**bar" in WM_PATHNAME mode

From: Junio C Hamano <hidden>
Date: 2018-10-29 02:28:14

Duy Nguyen [off-list ref] writes:
quoted
Nice analyzes.
I have one question here:
If the user specifies '**' and nothing is found,
would it be better to die() with a useful message
instead of silently correcting it ?
Consider the main use case of wildmatch, .gitignore patterns, dying
would be really bad because it can affect a lot of commands....
If the user gives 'foo*' and nothing is found, we may say "no match"
and some codepaths that uses wildmatch API may die.  And in such place,
when the user gives '**' and nothing is found, we should do the same
in the same codepath.  In either case, the implementation of wildmatch
API is not the place to call a die(), I think.

And yes, treating an unanchored "**" as if there is just a "*" followed
by another '*" makes good sense.

Thanks, both.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help