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

Re: [PATCH] push: add recurseSubmodules config option

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 30, 2015, 18:31 UTC
Message-ID
<xmqqa8pv8hkx.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1447680294-13395-1-git-send-email-mac@mcrowe.com>
Mike Crowe <mac@mcrowe.com> writes:
Show 18 quoted lines
> diff --git a/builtin/push.c b/builtin/push.c
> index 3bda430..dfced74 100644
> --- a/builtin/push.c
> +++ b/builtin/push.c
> @@ -9,6 +9,7 @@
>  #include "transport.h"
>  #include "parse-options.h"
>  #include "submodule.h"
> +#include "submodule-config.h"
>  #include "send-pack.h"
>  
>  static const char * const push_usage[] = {
> @@ -20,7 +21,7 @@ static int thin = 1;
>  static int deleterefs;
>  static const char *receivepack;
>  static int verbosity;
> -static int progress = -1;
> +static int progress = -1, recurse_submodules = RECURSE_SUBMODULES_DEFAULT;

One variable per line, please. Especially when the two variables do not have anything to do with each other, and do not have any logical similarity between them.

Show 11 quoted lines
> @@ -452,22 +453,15 @@ static int do_push(const char *repo, int flags)
>  static int option_parse_recurse_submodules(const struct option *opt,
>  				   const char *arg, int unset)
>  {
> -	int *flags = opt->value;
> +	int *recurse_submodules = opt->value;
>  
> -	if (*flags & (TRANSPORT_RECURSE_SUBMODULES_CHECK |
> -		      TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND))
> +	if (*recurse_submodules != RECURSE_SUBMODULES_DEFAULT)
>  		die("%s can only be used once.", opt->long_name);

The usual convention thoughout Git user experience is "the last one wins" (both in the configuration and in the command line options). Is there a good reason to deviate from that here?

Previous: Eric SunshineNext: Mike Crowe
Message 6 of 7 in “push: add recurseSubmodules config option”
  1. push: add recurseSubmodules config optionMike Crowe, Nov 16, 2015
  2. Stefan BellerNov 16, 2015
  3. Mike CroweNov 16, 2015
  4. Jens LehmannNov 16, 2015
  5. Eric SunshineNov 16, 2015
  6. Junio C HamanoNov 30, 2015
  7. Mike CroweNov 30, 2015

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.