git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Verdoolaege <skimo@kotnet.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH v3] revision: allow selection of commits that do not match a pattern
Date: Sun, 08 Jul 2007 16:57:46 +0200	[thread overview]
Message-ID: <20070708145746.GJ1528MdfPADPa@greensroom.kotnet.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0707081519230.4248@racer.site>

On Sun, Jul 08, 2007 at 03:22:06PM +0100, Johannes Schindelin wrote:
> @@ -382,6 +391,8 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,
>  	unsigned count = 0;
>  	enum grep_context ctx = GREP_CONTEXT_HEAD;
>  
> +	opt->not_at_all = 0;
> +
>  	if (buffer_is_binary(buf, size)) {
>  		switch (opt->binary) {
>  		case GREP_BINARY_DEFAULT:
> @@ -500,7 +511,7 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,
>  		return 0;
>  
>  	if (opt->status_only)
> -		return 0;
> +		return !opt->not_at_all;
>  	if (opt->unmatch_name_only) {
>  		/* We did not see any hit, so we want to show this */
>  		printf("%s\n", name);

I don't understand this part.
Aren't you changing the return value from 0 to 1 here if there is no NOT_AT_ALL node?

> @@ -68,6 +70,7 @@ struct grep_opt {
>  	unsigned extended:1;
>  	unsigned relative:1;
>  	unsigned pathname:1;
> +	unsigned not_at_all:1; /* is set if the pattern was seen */
>  	int regflags;
>  	unsigned pre_context;
>  	unsigned post_context;

The name for this field is also a bit confusing.
Wouldn't "matched_some_line" or some such by more appropriate?

skimo

  reply	other threads:[~2007-07-08 14:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-07 15:30 [PATCH] revision: allow selection of commits that do not match a pattern Sven Verdoolaege
2007-07-07 16:27 ` Johannes Schindelin
2007-07-07 16:52   ` Sven Verdoolaege
2007-07-07 17:33     ` Johannes Schindelin
2007-07-07 18:42       ` Sven Verdoolaege
2007-07-07 19:35         ` Johannes Schindelin
2007-07-07 20:22           ` Sven Verdoolaege
2007-07-08 10:57           ` [PATCH v3] " Sven Verdoolaege
2007-07-08 14:22             ` Johannes Schindelin
2007-07-08 14:57               ` Sven Verdoolaege [this message]
2007-07-11 17:42             ` Jeff King

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=20070708145746.GJ1528MdfPADPa@greensroom.kotnet.org \
    --to=skimo@kotnet.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=skimo@liacs.nl \
    /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).