# RFC: have a config option for running submodule update after checkout <revision>

2 messages from 2016-06-03 to 2016-06-03. Participants: Stefan Beller.
Thread: https://gitlist.dev/t/42525

## Stefan Beller, 2016-06-03 22:53

Subject: RFC: have a config option for running submodule update after checkout <revision>
Message-ID: <CAGZ79kb9xHNYysb6gS9nPWvFW3cgcW-ey+5qyfTHTPGkT0fNfw@mail.gmail.com>
URL: https://gitlist.dev/e/CAGZ79kb9xHNYysb6gS9nPWvFW3cgcW-ey%2B5qyfTHTPGkT0fNfw%40mail.gmail.com

```
When checking out a new revision in a repo with submodules,
one of the first commands after checkout is `git submodule update`
to make sure the submodules are updated.

I propose to have a switch which when turned on automatically runs
`git submodule update` for you instead of implementing proper
submodule support in checkout for example.

advantages:
* users are already used to the quirks of `submodule update`
* a lot of config options exist for the behavior of `submodule update`

disadvantages:
* it's not `done right`, i.e. dealing with gitlinks in read-tree/unpack-tree
   but just another command chained after checkout, so we would do that
   for pull too eventually?

What do you think?

Thanks,
Stefan

```

## Stefan Beller, 2016-06-03 23:30

Subject: Re: RFC: have a config option for running submodule update after checkout <revision>
Message-ID: <CAGZ79kYC9Pub1RhcedLBqxK+pBunmN1DwjmWf83MUbY9pdvwhQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAGZ79kYC9Pub1RhcedLBqxK%2BpBunmN1DwjmWf83MUbY9pdvwhQ%40mail.gmail.com
In-Reply-To: <CAGZ79kb9xHNYysb6gS9nPWvFW3cgcW-ey+5qyfTHTPGkT0fNfw@mail.gmail.com>

```
On Fri, Jun 3, 2016 at 3:53 PM, Stefan Beller <sbeller@google.com> wrote:
> disadvantages:
> * it's not `done right`, i.e. dealing with gitlinks in read-tree/unpack-tree
>    but just another command chained after checkout, so we would do that
>    for pull too eventually?

Well one argument against the disadvantage is that we have `pull`
already, which is
essentially fetch and merge as a chain of commands and nobody bothers
about having
a chain of commands.

>
> What do you think?
>
> Thanks,
> Stefan

```
