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

Re: [PATCH v2] grep: support the --pathspec-from-file option

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 6, 2019, 11:22 UTC
Message-ID
<nycvar.QRO.7.76.6.1912061220400.31080@tvgsbejvaqbjf.bet>
In-Reply-To
<20191204203911.237056-1-emilyshaffer@google.com>
Hi Emily,
On Wed, 4 Dec 2019, Emily Shaffer wrote:
Show 12 quoted lines
> diff --git a/builtin/grep.c b/builtin/grep.c
> index 50ce8d9461..54ba991c42 100644
> --- a/builtin/grep.c
> +++ b/builtin/grep.c
> @@ -809,6 +813,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
>  	int use_index = 1;
>  	int pattern_type_arg = GREP_PATTERN_TYPE_UNSPECIFIED;
>  	int allow_revs;
> +	char *pathspec_from_file;
> +	int pathspec_file_nul;
>
>  	struct option options[] = {

I need this on top to make it work without problems (I have not yet triggered the CI build, but I will in a moment):

-- snipsnap --
Subject: [PATCH] fixup??? grep: support the --pathspec-from-file option

We must not use those variables uninitialized, this causes CI build failures left and right (see e.g. https://dev.azure.com/gitgitgadget/git/_build/results?buildId=22821)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 builtin/grep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/grep.c b/builtin/grep.c
index 54ba991c425..c2aa1aeebd6 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -813,8 +813,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
 	int use_index = 1;
 	int pattern_type_arg = GREP_PATTERN_TYPE_UNSPECIFIED;
 	int allow_revs;
-	char *pathspec_from_file;
-	int pathspec_file_nul;
+	char *pathspec_from_file = NULL;
+	int pathspec_file_nul = 0;

 	struct option options[] = {
 		OPT_BOOL(0, "cached", &cached,
--
2.24.0.windows.2.611.ge9aced84530
Previous: Emily ShafferNext: SZEDER Gábor
Message 17 of 23 in “grep: provide pathspecs/patterns via file or stdin”
  1. grep: provide pathspecs/patterns via file or stdinEmily Shaffer, Nov 22, 2019
  2. Denton LiuNov 22, 2019
  3. Junio C HamanoNov 22, 2019
  4. Junio C HamanoNov 22, 2019
  5. Denton LiuNov 22, 2019
  6. Emily ShafferNov 22, 2019
  7. Emily ShafferNov 22, 2019
  8. Junio C HamanoNov 23, 2019
  9. Junio C HamanoNov 22, 2019
  10. grep: support the --pathspec-from-file optionEmily Shaffer, Dec 4, 2019
  11. Denton LiuDec 4, 2019
  12. Junio C HamanoDec 4, 2019
  13. Junio C HamanoDec 4, 2019
  14. Emily ShafferDec 13, 2019
  15. Alexandr MiloslavskiyDec 5, 2019
  16. Emily ShafferDec 13, 2019
  17. Johannes SchindelinDec 6, 2019
  18. SZEDER GáborDec 6, 2019
  19. grep: support the --pathspec-from-file optionEmily Shaffer, Dec 13, 2019
  20. Alexandr MiloslavskiyDec 13, 2019
  21. Junio C HamanoDec 13, 2019
  22. Alexandr MiloslavskiyDec 13, 2019
  23. Emily ShafferDec 17, 2019

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.