From: Jens Lehmann <Jens.Lehmann@web.de>
To: Phil Hord <hordp@cisco.com>
Cc: Miles Bader <miles@gnu.org>,
Marc Branchaud <marcnarc@xiplink.com>,
Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org
Subject: Re: [1.8.0] Recursively checkout, merge and reset populated submodules
Date: Tue, 22 Feb 2011 09:11:24 +0100 [thread overview]
Message-ID: <4D636FAC.3000105@web.de> (raw)
In-Reply-To: <4D632029.7040501@cisco.com>
Am 22.02.2011 03:32, schrieb Phil Hord:
> On 02/21/2011 07:51 PM, Miles Bader wrote:
>> Jens Lehmann <Jens.Lehmann@web.de> writes:
>>>>>> So, .gitmodules initially controls recursion. When a submodule gets
>>>>>> populated, it gets an entry in .git/config which then determines the
>>>>>> recursion behavior from then on. Changing branches might change .gitmodules,
>>>>>> but anything in .git/config will persist so any customizations the user makes
>>>>>> will also persist.
>>>>
>>>> Yes. Upstream can give sane defaults but the user has the last word.
>> If .git/config entries are created _automatically_ based on the initial
>> .gitmodules, doesn't that means it will cease to respect the upstream
>> defaults in the case where .gitmodules changes, even if the user didn't
>> actually change anything himself...?
Yes, unfortunately that is the current behavior of the git-submodule
command, it copies the "update" entry into .git/config on init (but
not on sync, so it is not updated then if it changed). The other
submodule flags ("ignore" & "fetchRecurseSubmodules" don't show that
behavior, the user has to copy them herself to override upstream
settings). I'm in favor of removing that copy and using the setting
from .gitmodules when "update" is not found in .git/config, but this
changes behavior. But maybe that is a worthwhile change for 1.8.0
preparing for the things to come?
> Also consider that the .gitmodules' "upstream defaults" may have many
> changes
> within the existing repository. So, $(git checkout foo) will load some
> "defaults" and
> $(git checkout bar) may load different "defaults".
Yes, and that is a feature. E.g. when you have a "working on foo"
branch you can set the "fetchRecurseSubmodules" to "yes" there because
you want to get all commits in the submodule to be able to commit some
new ones in the superproject. But in every other branch setting that to
"on-demand" will suffice.
> I guess the defaults
> can be migrated
> into .git/config using $(git submodule init)...?
Not with "git submodule init", as they then would be set in stone from
the beginning. But I can imagine a "git submodule config <setting>"
helper program, which copies the setting into .git/config or updates
it there when wanted.
prev parent reply other threads:[~2011-02-22 8:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-18 1:02 [1.8.0] Summary of the discussions Junio C Hamano
2011-02-18 2:08 ` Martin von Zweigbergk
2011-02-19 16:40 ` [1.7.5] Let fetch and pull recurse into submodules when new commits are recorded Jens Lehmann
2011-02-21 15:12 ` Marc Branchaud
2011-02-21 17:38 ` Jens Lehmann
2011-02-19 16:59 ` [1.8.0] Recursively checkout, merge and reset populated submodules Jens Lehmann
2011-02-20 6:49 ` Junio C Hamano
2011-02-21 16:13 ` Marc Branchaud
2011-02-21 18:30 ` Jens Lehmann
2011-02-21 19:56 ` Marc Branchaud
2011-02-21 22:54 ` Jens Lehmann
2011-02-22 0:51 ` Miles Bader
2011-02-22 2:32 ` Phil Hord
2011-02-22 8:11 ` Jens Lehmann [this message]
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=4D636FAC.3000105@web.de \
--to=jens.lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hordp@cisco.com \
--cc=marcnarc@xiplink.com \
--cc=miles@gnu.org \
/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).