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

Re: [PATCH v9 1/2] grep: refactor next_match() and match_one_pattern() for external use

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 29, 2021, 05:34 UTC
Message-ID
<xmqqfstoeyia.fsf@gitster.g>
In-Reply-To
<20210929011952.611792-1-someguy@effective-light.com>
Needs a magic comment to squelch a compiler warning.
grep.c:1187:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
 grep.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/grep.c b/grep.c
index 6f8bc95703..fe847a0111 100644
--- a/grep.c
+++ b/grep.c
@@ -1187,6 +1187,7 @@ int grep_next_match(struct grep_opt *opt,
 				if ((field != GREP_HEADER_FIELD_MAX) &&
 				    (p->field != field))
 					continue;
+				/* fall thru */
 			case GREP_PATTERN: /* atom */
 			case GREP_PATTERN_BODY:
 				hit |= match_next_pattern(p, bol, eol, ctx,
-- 
2.33.0-839-gdb857d08e8
Previous: Hamza Mahfooz
Message 3 of 3 in “grep: refactor next_match() and match_one_pattern() for external use”
  1. 1/2 grep: refactor next_match() and match_one_pattern() for external useHamza Mahfooz, Sep 29, 2021
  2. 2/2 pretty: colorize pattern matches in commit messagesHamza Mahfooz, Sep 29, 2021
  3. Junio C HamanoSep 29, 2021

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.