From: Christopher Wilson <cwilson@cdwilson.us>
To: git@vger.kernel.org
Cc: Jens Lehmann <Jens.Lehmann@web.de>, git@vger.kernel.org
Subject: Re: Why does adding an existing repo as a submodule modify .git/config?
Date: Tue, 24 May 2011 00:06:01 -0700 [thread overview]
Message-ID: <4DDB58D9.2090701@cdwilson.us> (raw)
In-Reply-To: <4DDB0786.5020006@gmail.com>
On 5/23/11 6:19 PM, Mark Levedahl wrote:
> On 05/23/2011 02:43 PM, Jens Lehmann wrote:
>> Am 22.05.2011 22:02, schrieb Christopher Wilson:
>>
>> Hmm, this looks like an inconsistency to me too. It would be great
>> to hear about the background, so I added Mark to the CC, maybe he
>> can shed some light.
>>
> I think the comment in c2f939170c651 describes the reasoning well
> enough. (You may disagree with the reasoning, but that is a different
> matter :^).
>
> Mark
Mark, thanks for the reply. Maybe I'm a bit daft, but I'm still a
little confused by your comment in the commit :)
I've included your commit message below with my questions interlaced.
C: "When adding a new submodule in place, meaning the user created the
submodule as a git repo in the superproject's tree first, we don't go
through "git submodule init" to register the module."
Q: Why don't we go through "git submodule init" to register the
submodule? Isn't that the whole point of having a separate "submodule
init" command, to register the module in .git/config?
C: "Thus, the submodule's origin repository URL is not stored in
.git/config, and no subsequent submodule operation will ever do so."
I'm not sure this is true. For example:
$ mkdir testing
$ cd testing
$ git init
$ git clone git@git.server:submodule.git
$ git submodule add git@git.server:submodule.git
$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[submodule "submodule"]
url = git@git.server:submodule.git
# At this point, I opened up .git/config in an editor and removed the
entire submodule section.
$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
$ git submodule init
$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[submodule "submodule"]
url = git@git.server:submodule.git
Q: As far as I can tell, a subsequent submodule operation (git submodule
init) has stored the submodule's origin repository URL in .git/config.
Can you elaborate on what you meant by the statement "no subsequent
submodule operation will ever do so"?
C: "In this case, assume the URL the user supplies to "submodule add" is
the one that should be registered, and do so."
Q: Can you elaborate on why a 2 step "git submodule add" + "git
submodule init" wasn't sufficient? What is the reason for adding this
functionality into the "git submodule add" command, when "git submodule
init" does the same job?
Again, sorry if I'm asking dumb questions... :) Just want to understand
the context for your commit.
next prev parent reply other threads:[~2011-05-24 7:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-22 20:02 Why does adding an existing repo as a submodule modify .git/config? Christopher Wilson
2011-05-23 18:43 ` Jens Lehmann
2011-05-24 1:19 ` Mark Levedahl
2011-05-24 7:06 ` Christopher Wilson [this message]
2011-05-25 1:06 ` Mark Levedahl
2011-05-25 3:11 ` Christopher Wilson
2011-05-26 21:35 ` Jens Lehmann
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=4DDB58D9.2090701@cdwilson.us \
--to=cwilson@cdwilson.us \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.