Re: [PATCH v3] revision: allow selection of commits that do not match a pattern
- From
- Sven Verdoolaege <skimo@kotnet.org>
- Date
- Jul 8, 2007, 14:57 UTC
- Message-ID
- <20070708145746.GJ1528MdfPADPa@greensroom.kotnet.org>
- In-Reply-To
- <Pine.LNX.4.64.0707081519230.4248@racer.site>
On Sun, Jul 08, 2007 at 03:22:06PM +0100, Johannes Schindelin wrote:
Show 18 quoted lines
> @@ -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?
Show 8 quoted lines
> @@ -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