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

Re: [PATCH/RFC] git-grep: correct exit code with --quiet and -L

From
Anthony Sottile <asottile@umich.edu>
Date
Aug 15, 2017, 22:43 UTC
Message-ID
<CA+dzEB=ggLQGaEL21TChLkeiAvCGf4LZ0QFevBZCAEMhxyJwqQ@mail.gmail.com>
In-Reply-To
<xmqqlgmkpizm.fsf@gitster.mtv.corp.google.com>
Sounds good, I'll wait.

I've also created a mailing list entry on the gnu grep mailing list as I believe the current exit status for --files-without-match is inconsistent:

http://lists.gnu.org/archive/html/bug-grep/2017-08/msg00010.html
Anthony
On Tue, Aug 15, 2017 at 3:24 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 29 quoted lines
> Anthony Sottile <asottile@umich.edu> writes:
>
>> Ah yes, I didn't intend to include the first hunk (forgot to amend it
>> out when formatting the patch).
>>
>> I think git's exit codes for -L actually make more sense than the GNU
>> exit codes (especially when comparing with `grep` vs `grep -v`) --
>> that is, produce `0` when the search is successful (producing
>> *something* on stdout) and `1` when the search fails.
>>
>> Shall I create a new mail with the adjusted patch as suggested above?
>
> I do not mind seeing an updated patch that does not change the exit
> status (as you seem to like what we have currently that contradicts
> what GNU grep does) but makes it consistent between "--quiet" and
> "--no-quiet".  But I would not be surprised if people seeing this
> exchange from the sideline are already working on fixing the exit
> status and also making sure that the fixed code would produce the
> same corrected exit status with or without "--quiet", so an updated
> patch from you will likely conflict with their effort.
>
> So if I were you, I'd wait to see what other people would say about
> the actual exit codes we give when "git grep -L" is run without the
> "--quiet" option, and if they are also happy with the current exit
> code, then send in an updated patch.
>
> Thanks.
>
>
Previous: Junio C Hamano
Message 5 of 5 in “git-grep: correct exit code with --quiet and -L”
  1. git-grep: correct exit code with --quiet and -LAnthony Sottile, Aug 15, 2017
  2. Junio C HamanoAug 15, 2017
  3. Anthony SottileAug 15, 2017
  4. Junio C HamanoAug 15, 2017
  5. Anthony SottileAug 15, 2017

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.