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

Re: [PATCHv6 2/4] receive-pack: implement advertising and receiving push options

From
Jeff King <peff@peff.net>
Date
Jul 14, 2016, 21:35 UTC
Message-ID
<20160714213534.GB20645@sigill.intra.peff.net>
In-Reply-To
<20160714212454.16643-1-sbeller@google.com>
On Thu, Jul 14, 2016 at 02:24:54PM -0700, Stefan Beller wrote:
> # interdiff to v5:
> [...giant deletion...]
Much nicer. :)
> +static struct string_list *read_push_options(void)
> +{
> +	struct string_list *ret = xmalloc(sizeof(*ret));

This struck me as a little non-idiomatic for our code base. The usual technique is to take a pointer to a stack-allocated struct, and write into that.

I guess that here:
Show 7 quoted lines
> @@ -1774,6 +1806,9 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix)
>  		const char *unpack_status = NULL;
>  		struct string_list *push_options = NULL;
>  
> +		if (use_push_options)
> +			push_options = read_push_options();
> +

You will want to later check whether push_options is NULL. But you can also just check push_options.nr.

-Peff
Previous: Stefan BellerNext: Stefan Beller
Message 2 of 3 in “[PATCHv6 2/4] receive-pack: implement advertising and receiving push options”
  1. Stefan BellerJul 14, 2016
  2. Jeff KingJul 14, 2016
  3. Stefan BellerJul 14, 2016

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.