All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Anthony Sottile <asottile@umich.edu>
Cc: git@vger.kernel.org
Subject: Re: [PATCH/RFC] git-grep: correct exit code with --quiet and -L
Date: Thu, 17 Aug 2017 19:22:07 -0700	[thread overview]
Message-ID: <xmqq4lt5ehtc.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170818013851.16753-1-asottile@umich.edu> (Anthony Sottile's message of "Thu, 17 Aug 2017 18:38:51 -0700")

Anthony Sottile <asottile@umich.edu> writes:

> The handling of `status_only` no longer interferes with the handling of
> `unmatch_name_only`.  `--quiet` no longer affects the exit code when using
> `-L`/`--files-without-match`.
>
> Signed-off-by: Anthony Sottile <asottile@umich.edu>
> ---

Thanks, Will queue.

>  grep.c          | 2 +-
>  t/t7810-grep.sh | 5 +++++
>  2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/grep.c b/grep.c
> index 2efec0e..c9e7cc7 100644
> --- a/grep.c
> +++ b/grep.c
> @@ -1821,7 +1821,7 @@ static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle
>  		return 0;
>  
>  	if (opt->status_only)
> -		return 0;
> +		return opt->unmatch_name_only;
>  	if (opt->unmatch_name_only) {
>  		/* We did not see any hit, so we want to show this */
>  		show_name(opt, gs->name);
> diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
> index f106387..2a6679c 100755
> --- a/t/t7810-grep.sh
> +++ b/t/t7810-grep.sh
> @@ -374,6 +374,11 @@ test_expect_success 'grep -L -C' '
>  	test_cmp expected actual
>  '
>  
> +test_expect_success 'grep --files-without-match --quiet' '
> +	git grep --files-without-match --quiet nonexistent_string >actual &&
> +	test_cmp /dev/null actual
> +'
> +
>  cat >expected <<EOF
>  file:foo mmap bar_mmap
>  EOF

  reply	other threads:[~2017-08-18  2:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18  1:38 [PATCH/RFC] git-grep: correct exit code with --quiet and -L Anthony Sottile
2017-08-18  2:22 ` Junio C Hamano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-08-15 20:35 Anthony Sottile
2017-08-15 21:33 ` Junio C Hamano
2017-08-15 21:41   ` Anthony Sottile
2017-08-15 22:24     ` Junio C Hamano
2017-08-15 22:43       ` Anthony Sottile

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=xmqq4lt5ehtc.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=asottile@umich.edu \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.