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

Re: [PATCH] Added support for new configuration parameter push.pushOption

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 18, 2017, 01:04 UTC
Message-ID
<xmqqmv4pl117.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqqvajdl1hn.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 30 quoted lines
> base to show an incremental improvement, but here is how I would do
> the "code" part.
>
>  builtin/push.c | 22 ++++++++++++++++++----
>  1 file changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/builtin/push.c b/builtin/push.c
> index 03846e8379..89ef029c67 100644
> --- a/builtin/push.c
> +++ b/builtin/push.c
> @@ -32,6 +32,8 @@ static const char **refspec;
>  static int refspec_nr;
>  static int refspec_alloc;
>  
> +static struct string_list push_options_config = STRING_LIST_INIT_DUP;
> +
>  static void add_refspec(const char *ref)
>  {
>  	refspec_nr++;
> @@ -503,6 +505,13 @@ static int git_push_config(const char *k, const char *v, void *cb)
>  		int val = git_config_bool(k, v) ?
>  			RECURSE_SUBMODULES_ON_DEMAND : RECURSE_SUBMODULES_OFF;
>  		recurse_submodules = val;
> +	} else if (!strcmp(k, "push.pushoption")) {
> +		if (!v)
> +			return config_error_nonbool(k);
> +		else if (!*v)
> +			string_list_clear(&push_options_config, 0);
> +		else
> +			string_list_append(&push_options_config, v);
Here needs to be
		return 0;

as there is no point in falling through to call git_default_config().

>  	}
>  
>  	return git_default_config(k, v, NULL);
Previous: Junio C HamanoNext: Marius Paliga
Message 3 of 14 in “Added support for new configuration parameter push.pushOption”
  1. Added support for new configuration parameter push.pushOptionMarius Paliga, Oct 17, 2017
  2. Junio C HamanoOct 18, 2017
  3. Junio C HamanoOct 18, 2017
  4. builtin/push.c: add push.pushOption configMarius Paliga, Oct 19, 2017
  5. Stefan BellerOct 19, 2017
  6. Junio C HamanoOct 20, 2017
  7. Junio C HamanoOct 20, 2017
  8. Junio C HamanoOct 20, 2017
  9. Marius PaligaOct 20, 2017
  10. Junio C HamanoOct 21, 2017
  11. Stefan BellerOct 20, 2017
  12. Junio C HamanoOct 21, 2017
  13. builtin/push.c: add push.pushOption configMarius Paliga, Oct 23, 2017
  14. Junio C HamanoOct 24, 2017

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.