git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Mike Crowe <mac@mcrowe.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] push: add recurseSubmodules config option
Date: Mon, 30 Nov 2015 10:31:26 -0800	[thread overview]
Message-ID: <xmqqa8pv8hkx.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1447680294-13395-1-git-send-email-mac@mcrowe.com> (Mike Crowe's message of "Mon, 16 Nov 2015 13:24:54 +0000")

Mike Crowe <mac@mcrowe.com> writes:

> 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.

> @@ -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?

  parent reply	other threads:[~2015-11-30 18:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 13:24 [PATCH] push: add recurseSubmodules config option Mike Crowe
2015-11-16 18:15 ` Stefan Beller
2015-11-16 18:31   ` Mike Crowe
2015-11-16 19:05     ` Jens Lehmann
2015-11-16 23:13 ` Eric Sunshine
2015-11-30 18:31 ` Junio C Hamano [this message]
2015-11-30 19:00   ` Mike Crowe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqa8pv8hkx.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mac@mcrowe.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).