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

Re: [PATCH 1/2] fetch: convert argv_gc_auto to struct argv_array

From
Jeff King <peff@peff.net>
Date
Aug 14, 2014, 19:53 UTC
Message-ID
<20140814195320.GA19337@peff.net>
In-Reply-To
<1408017065-17437-1-git-send-email-pclouds@gmail.com>
On Thu, Aug 14, 2014 at 06:51:04PM +0700, Nguyễn Thái Ngọc Duy wrote:
Show 14 quoted lines
> -	static const char *argv_gc_auto[] = {
> -		"gc", "--auto", NULL,
> -	};
> +	struct argv_array argv_gc_auto = ARGV_ARRAY_INIT;
>  
>  	packet_trace_identity("fetch");
>  
> @@ -1198,7 +1196,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
>  	list.strdup_strings = 1;
>  	string_list_clear(&list, 0);
>  
> -	run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
> +	argv_array_pushl(&argv_gc_auto, "gc", "--auto", NULL);
> +	run_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD);
argv_array_clear() here afterwards?

Not a huge deal since we are about to exit, but in the name of good hygiene.

-Peff
Previous: Duy NguyenNext: Nguyễn Thái Ngọc Duy
Message 5 of 7 in “fetch: convert argv_gc_auto to struct argv_array”
  1. 1/2 fetch: convert argv_gc_auto to struct argv_arrayNguyễn Thái Ngọc Duy, Aug 14, 2014
  2. 2/2 fetch: silence git-gc if --quiet is givenNguyễn Thái Ngọc Duy, Aug 14, 2014
  3. Jeff KingAug 14, 2014
  4. Duy NguyenAug 15, 2014
  5. Jeff KingAug 14, 2014
  6. 1/2 fetch: convert argv_gc_auto to struct argv_arrayNguyễn Thái Ngọc Duy, Aug 16, 2014
  7. 2/2 fetch: silence git-gc if --quiet is givenNguyễn Thái Ngọc Duy, Aug 16, 2014

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.