From: Jens Lehmann <Jens.Lehmann@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Maarten Billemont" <lhunath@gmail.com>,
"Git Mailing List" <git@vger.kernel.org>,
"Andreas Köhler" <andi5.py@gmx.net>
Subject: Re: ''git submodule sync'' should not add uninitialized submodules to .git/config
Date: Thu, 23 Jun 2011 21:14:47 +0200 [thread overview]
Message-ID: <4E0390A7.8040505@web.de> (raw)
In-Reply-To: <7v7h8c4nv3.fsf@alter.siamese.dyndns.org>
Am 23.06.2011 16:35, schrieb Junio C Hamano:
> Maarten Billemont <lhunath@gmail.com> writes:
>
>> When I initialize 2/3 submodules of my git repository and do git
>> submodule update, all is fine: Only the 2 submodules that I need are
>> updated.
>>
>> When I run a git submodule sync to update the URLs that may have been
>> changed in .gitmodules, it ADDS the URL of the submodule that was NOT
>> initialized, thus "initializing" it.
>>
>> Now, when I run git submodule update, it starts checking out the third
>> module and my workflow is broken.
>
> See 33f072f (submodule sync: Update "submodule.<name>.url" for empty
> directories, 2010-10-08), which introduced this behaviour.
>
> cmd_update considers anything that has submodule.<name>.url defined as
> "the user is interested", so I suspect "git submodule sync" should not do
> this.
>
> The situation 33f072f cites as needing this behaviour can easily fixed by
> running 'submodule sync' after switching to the branch to which the
> submodule _matters_, no?
>
> Jens, what do you think?
I agree that 33f072f introduced a regression. One could argue if it was
a good idea to let "git submodule init" not do the clone itself but defer
it to "git submodule update" by setting the url in .git/config, but that's
the way things are done now (and maybe there was a very good reason to do
it that way I'm not aware of, because I didn't follow the list that closely
back then).
So while I think 33f072f solved a problem for a valid use case, it breaks
other use cases that worked so far. So unless we want to change init to do
the clone itself (which would be a pretty invasive change in behavior),
I'd vote for a revert.
next prev parent reply other threads:[~2011-06-23 19:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-23 11:13 ''git submodule sync'' should not add uninitialized submodules to .git/config Maarten Billemont
2011-06-23 13:39 ` Phil Hord
2011-06-23 14:35 ` Junio C Hamano
2011-06-23 19:14 ` Jens Lehmann [this message]
2011-06-23 22:28 ` Junio C Hamano
2011-06-23 23:10 ` Andreas Köhler
2011-06-24 6:17 ` Jens Lehmann
2011-06-24 4:13 ` Re* " Junio C Hamano
2011-06-24 6:20 ` Jens Lehmann
2011-06-25 23:26 ` [PATCH] submodule add: always initialize .git/config entry Jens Lehmann
2011-06-30 0:47 ` Junio C Hamano
2011-06-25 20:41 ` [PATCH v2] submodule sync: do not auto-vivify uninteresting submodule Jens Lehmann
2011-06-23 20:01 ` ''git submodule sync'' should not add uninitialized submodules to .git/config Phil Hord
2011-06-23 21:47 ` Junio C Hamano
2011-06-23 23:06 ` Phil Hord
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=4E0390A7.8040505@web.de \
--to=jens.lehmann@web.de \
--cc=andi5.py@gmx.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=lhunath@gmail.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).