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

Re: [PATCH v2] grep: add configuration variables for --heading

From
Simon Ser <contact@emersion.fr>
Date
Jun 8, 2020, 10:22 UTC
Message-ID
<2lg0C_0k4SnWqhB0oW3wGE6eixtc_ZT5GgZJFzH8XC6g5dJXmSGGnrV9uZVT4QIOG9Sjc7yuLOR_v5kwGIV1hnMSojXinNG16G3tOOMg-Fc=@emersion.fr>
In-Reply-To
<xmqqeer5mina.fsf@gitster.c.googlers.com>
On Wednesday, May 27, 2020 6:45 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
> Naturally it follows that a command-line option
>
> $ git config grep.heading yes
> $ git grep --no-heading -e pattern
>
> is a way to countermand the configured default per invocation
> basis.

Is see where you're getting at, but this is missing for a handful of options, like grep.lineNumber and grep.column. I'd rather not create an inconsistency here.

Show 16 quoted lines
> When writing new tests, we often get too excited and stop at showing
> off how well the shiny new feature works, but we should make sure
> that we test the "negative" case, too, i.e. that the "feature" can
> be disabled when the user does not want to trigger it, and that the
> "feature" notices incorrect invocations and fails appropriately.
>
> E.g.
>
> git -c grep.heading=yes grep --no-heading ...
>
> should not leave the opt->heading true, and
>
> git -c grep.heading=nonsense grep ...
>
> should fail, saying "grep.heading must be a bool" (or something
> along that line).

Note, these new tests are only required if --no-heading is added to the patch.

Previous: Junio C HamanoNext: Phillip Wood
Message 5 of 6 in “grep: add configuration variables for --heading”
  1. grep: add configuration variables for --headingSimon Ser, May 26, 2020
  2. Eric SunshineMay 26, 2020
  3. grep: add configuration variables for --headingSimon Ser, May 27, 2020
  4. Junio C HamanoMay 27, 2020
  5. Simon SerJun 8, 2020
  6. Phillip WoodJun 8, 2020

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.