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

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

From
SVSven 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
Previous: Johannes SchindelinNext: Jeff King
Message 10 of 11 in “revision: allow selection of commits that do not match a pattern”
  1. revision: allow selection of commits that do not match a patternSven Verdoolaege, Jul 7, 2007
  2. Johannes SchindelinJul 7, 2007
  3. Sven VerdoolaegeJul 7, 2007
  4. Johannes SchindelinJul 7, 2007
  5. revision: allow selection of commits that do not match a patternSven Verdoolaege, Jul 7, 2007
  6. Johannes SchindelinJul 7, 2007
  7. Sven VerdoolaegeJul 7, 2007
  8. revision: allow selection of commits that do not match a patternSven Verdoolaege, Jul 8, 2007
  9. Johannes SchindelinJul 8, 2007
  10. Sven VerdoolaegeJul 8, 2007
  11. Jeff KingJul 11, 2007

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.