Re: [PATCH v3] revision: allow selection of commits that do not match a pattern

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux