git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 21, 2011, 16:22 UTC
Message-ID
<7v62mv4n93.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAKPyHN2TMu2yO4sZDAqCce9P-5==Z2jKQVoU=zUsmUQJhHoeQg@mail.gmail.com>
Bert Wesarg <bert.wesarg@googlemail.com> writes:
Show 5 quoted lines
> 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.

Previous: Bert WesargNext: Bert Wesarg
Message 6 of 7 in “grep --no-index: allow to grep without git exclusions”
  1. grep --no-index: allow to grep without git exclusionsBert Wesarg, Jul 20, 2011
  2. Junio C HamanoJul 20, 2011
  3. Nguyen Thai Ngoc DuyJul 21, 2011
  4. Bert WesargJul 21, 2011
  5. Bert WesargJul 21, 2011
  6. Junio C HamanoJul 21, 2011
  7. Bert WesargJul 21, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.