From: Bert Wesarg <bert.wesarg@googlemail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, "Nguyễn Thái Ngọc" <pclouds@gmail.com>
Subject: Re: [RFC/PATCH] grep --no-index: allow to grep without git exclusions
Date: Thu, 21 Jul 2011 19:23:25 +0200 [thread overview]
Message-ID: <CAKPyHN3dRyrpW_3emC1s8eDWTF_hSGEY9p+Ojio3NzvNP2hOsg@mail.gmail.com> (raw)
In-Reply-To: <7v62mv4n93.fsf@alter.siamese.dyndns.org>
2011/7/21 Junio C Hamano <gitster@pobox.com>:
> Bert Wesarg <bert.wesarg@googlemail.com> 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.
>
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
prev parent reply other threads:[~2011-07-21 17:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-20 12:50 [RFC/PATCH] grep --no-index: allow to grep without git exclusions Bert Wesarg
2011-07-20 20:57 ` Junio C Hamano
2011-07-21 3:47 ` Nguyen Thai Ngoc Duy
2011-07-21 7:11 ` Bert Wesarg
2011-07-21 7:25 ` Bert Wesarg
2011-07-21 16:22 ` Junio C Hamano
2011-07-21 17:23 ` Bert Wesarg [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=CAKPyHN3dRyrpW_3emC1s8eDWTF_hSGEY9p+Ojio3NzvNP2hOsg@mail.gmail.com \
--to=bert.wesarg@googlemail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
/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 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).