git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: "Randall S. Becker" <rsbecker@nexbridge.com>
Cc: Ciro Santilli <ciro.santilli@gmail.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Add an option to automatically submodule update on checkout
Date: Mon, 8 May 2017 09:25:29 -0700	[thread overview]
Message-ID: <CAGZ79kaES-3ftadorYnx2wMDc-q7qsG376E1zy-C67Ldt2BO5g@mail.gmail.com> (raw)
In-Reply-To: <001b01d2c809$62ac8520$28058f60$@nexbridge.com>

On Mon, May 8, 2017 at 7:42 AM, Randall S. Becker
<rsbecker@nexbridge.com> wrote:
> On May 6, 2017 4:38 AM Ciro Santilli wrote:
>> This is a must if you are working with submodules, otherwise every git checkout requires a git submodule update,
>> and you forget it, and things break, and you understand, and you go to stack overflow questions
>> http://stackoverflow.com/questions/22328053/why-doesnt-git-checkout-automatically-do-git-submodule-update-recursive
>> http://stackoverflow.com/questions/4611512/is-there-a-way-to-make-git-pull-automatically-update-submodules
>> and you give up and create aliases :-)

The upcoming release (2.13) will have "git checkout --recurse-submodules",
which will checkout the submodules at the commit as recorded in the
superproject.

I plan to add an option "submodule.recurse" (name is subject to bikeshedding),
which would make the --recurse-submodules flag given by default for all commands
that support the flag. (Currently cooking we have reset
--recurse-submodules, already
existing there is push/pull).

> I rather like the concept of supporting --recurse-submodules. The complexity is that the branches in all submodules all have to have compatible semantics when doing the checkout, which is by no means guaranteed. In the scenario where you are including a submodule from a third-party (very common - see gnulib), the branches likely won't be there, so you have a high probability of having the command fail or produce the same results as currently exists if you allow the checkout even with problems (another option?). If you have control of everything, then this makes sense.

I am trying to give the use case of having control over everything
(or rather mixed) more thought as well,
e.g. "checkout --recurse-submodules -b <name>" may want to
create the branches in a subset of submodules as well.

Thanks,
Stefan

>
> Cheers,
> Randall
>

  reply	other threads:[~2017-05-08 16:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-06  8:37 Add an option to automatically submodule update on checkout Ciro Santilli
2017-05-08 14:42 ` Randall S. Becker
2017-05-08 16:25   ` Stefan Beller [this message]
2017-05-08 16:46     ` Randall S. Becker
2017-05-08 16:54       ` Stefan Beller
2017-05-08 17:05         ` Randall S. Becker
2017-05-08 17:08           ` Brandon Williams
2017-05-08 17:15             ` Stefan Beller
2017-05-09  2:58       ` Junio C Hamano
2017-05-09 13:00         ` Randall S. Becker
2017-05-08 16:48     ` Brandon Williams

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=CAGZ79kaES-3ftadorYnx2wMDc-q7qsG376E1zy-C67Ldt2BO5g@mail.gmail.com \
    --to=sbeller@google.com \
    --cc=ciro.santilli@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=rsbecker@nexbridge.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).