Re: [RFC/PATCH] grep --no-index: allow to grep without git exclusions

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [RFC/PATCH] grep --no-index: allow to grep without git exclusions

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:51:38

Bert Wesarg [off-list ref] writes:
It should be. But I think that unveils one of the shortcomings of the
(any) option parser: You wont get notified when an option was given,
regardless of its value. To handle the above I would have to use
OPTION_CALLBACK to set an addition flag exc_given (like it is done in
git-ls-files) and test against this.
Prepare a three-value variable, initialized to -1, set it to 0 on --no-foo
and set it to 1 on --foo. Use the default if the variable is still -1.

Re: [RFC/PATCH] grep --no-index: allow to grep without git exclusions

From: Bert Wesarg <hidden>
Date: 2016-06-15 22:51:38

2011/7/21 Junio C Hamano [off-list ref]:
Bert Wesarg [off-list ref] writes:
quoted
It should be. But I think that unveils one of the shortcomings of the
(any) option parser: You wont get notified when an option was given,
regardless of its value. To handle the above I would have to use
OPTION_CALLBACK to set an addition flag exc_given (like it is done in
git-ls-files) and test against this.
Prepare a three-value variable, initialized to -1, set it to 0 on --no-foo
and set it to 1 on --foo. Use the default if the variable is still -1.
Thats the 'invent an invalid value'-case I described. Which does not
necessarily exist.

Having the proposed 'given' flag available I would need only one
variable for all the options (these coming from ls-files) to check if
any of them where given, and could decide if the given options would
make sense.

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