git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: Brandon Williams <bmwill@google.com>, "git\@vger.kernel.org" <git@vger.kernel.org>, Jonathan Nieder <jrnieder@gmail.com>, Philip Oakley <philipoakley@iee.org>
Subject: Re: [PATCH 2/3] builtin/fetch: parse recurse-submodules-default at default options parsing
Date: Fri, 23 Jun 2017 17:51:25 -0700
Message-ID: <xmqq1sqab436.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAGZ79ka+va5bRNQL3x3fvn+738iAfJXJfD2PKpt2hmGEg09mTQ@mail.gmail.com>

Stefan Beller <sbeller@google.com> writes:

>>>       if (recurse_submodules != RECURSE_SUBMODULES_OFF) {
>>> -             if (recurse_submodules_default) {
>>> -                     int arg = parse_fetch_recurse_submodules_arg("--recurse-submodules-default", recurse_submodules_default);
>>> -                     set_config_fetch_recurse_submodules(arg);
>>> -             }
>>> +             if (recurse_submodules_default != RECURSE_SUBMODULES_DEFAULT)
>>> +                     set_config_fetch_recurse_submodules(recurse_submodules_default);
>>
>> This is not a new thing, and it may not even be a problem, but I
>> have to wonder why this needs to be done conditionally.  "The
>> ...
>
> As far as I suspect, the original author considered
> evaluating the additional config too expensive.
>
>     gitmodules_config(); // <- this specifically?
>     git_config(submodule_config, NULL);
>
> And that is why we only react if any switch is
> given to recurse. 

I am not talking about the outer "if" condition.  

The inner 

    "if (recurse_submodules_default != RECURSE_SUBMODULES_DEFAULT)"

block, is what I am questioning, i.e. I am wondering why
set_config_fetch_recurse_submodules() need to be conditionally
called.

The two statement you quoted above will be executed either way,
regardless of the value of recurse_submodule_default.

Unless --recurse-submodules=off is given, in which case the outer
"if" condition rejects.  And I think you are explaining that part,
but that was not what I am questioning.

  reply index

Thread overview: 10+ messages in thread (expand / mbox.gz / Atom feed / [top])
2017-06-23 19:12 [PATCH 0/3] pull: optionally rebase submodules Stefan Beller
2017-06-23 19:13 ` [PATCH 1/3] builtin/fetch: factor submodule recurse parsing out to submodule config Stefan Beller
2017-06-23 22:26   ` Junio C Hamano
2017-06-23 19:13 ` [PATCH 2/3] builtin/fetch: parse recurse-submodules-default at default options parsing Stefan Beller
2017-06-23 22:36   ` Junio C Hamano
2017-06-23 22:49     ` Stefan Beller
2017-06-24  0:51       ` Junio C Hamano [this message]
2017-06-27  3:00         ` Stefan Beller
2017-06-27 21:31           ` [PATCH] builtin/fetch cleanup: always set default value for submodule recursing Stefan Beller
2017-06-23 19:13 ` [PATCH 3/3] pull: optionally rebase submodules (remote submodule changes only) Stefan Beller

Reply instructions:

You may reply publically 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqq1sqab436.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=philipoakley@iee.org \
    --cc=sbeller@google.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

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox