git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git submodule init and redundant data in .gitmodules/.git/config
@ 2007-08-15 16:20 martin f krafft
  2007-08-15 16:38 ` Sven Verdoolaege
  0 siblings, 1 reply; 20+ messages in thread
From: martin f krafft @ 2007-08-15 16:20 UTC (permalink / raw)
  To: git discussion list

[-- Attachment #1: Type: text/plain, Size: 1534 bytes --]

Hi,

I am starting to learn submodules and hit the first state of
confusion when I encountered git-submodule init:

After git-submodule add, I find in my repository a .gitmodules file
as well as the newly-cloned submodule. I can call git-submodule
status on it to get the HEAD hash. The .gitmodules file has a stanza
for each submodule, linking remote url to local path, e.g.:

  [submodule "foo"]
    path = foo
    url = ../foo.git

The manpage then talks about git-submodule init:

    init
      Initialize the submodules, i.e. register in .git/config each
      submodule name and url found in .gitmodules. The key used in
      .git/config is submodule.$name.url. This command does not
      alter existing information in .git/config.

When I run git-submodule init, the following stanza gets added to
.git/config:

  [submodule "foo"]
    url = ../foo.git

Unless I call init, I cannot use git-submodule update.

But looking at the two stanzas, it strikes me that the remote url of
the submodule is duplicated and detached, creating redundant data
which may become desynchronised.

Why is this?

What is the reason for git-submodule init and moving the data to
.git/config?

Thanks,

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
"it is only the modern that ever becomes old-fashioned." 
                                                        -- oscar wilde
 
spamtraps: madduck.bogus@madduck.net

[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2007-08-22 13:48 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-15 16:20 git submodule init and redundant data in .gitmodules/.git/config martin f krafft
2007-08-15 16:38 ` Sven Verdoolaege
2007-08-15 22:29   ` using .gitmodule as default (was: git submodule init and redundant data in .gitmodules/.git/config) martin f krafft
2007-08-16 13:53     ` Josef Weidendorfer
2007-08-16 14:21       ` martin f krafft
2007-08-16 16:39         ` Josef Weidendorfer
2007-08-16 18:10       ` [PATCH] clarify need for init in git-submodules documentation martin f. krafft
2007-08-17  9:31         ` Sven Verdoolaege
2007-08-17 10:08           ` martin f krafft
2007-08-17 10:36             ` Sven Verdoolaege
2007-08-20  7:09               ` [PATCH] Clarify role of init command " martin f. krafft
2007-08-20  7:54                 ` Sven Verdoolaege
2007-08-21 18:02                   ` martin f krafft
2007-08-21 20:25                     ` Sven Verdoolaege
2007-08-21 21:03                       ` martin f krafft
2007-08-22  8:30                         ` Sven Verdoolaege
2007-08-22 13:48                           ` martin f krafft
2007-08-20 21:14                 ` Junio C Hamano
2007-08-20  9:29           ` Not setting M-F-T, keeping people on Cc (was: [PATCH] clarify need for init in git-submodules documentation) martin f krafft
2007-08-17  7:14     ` using .gitmodule as default (was: git submodule init and redundant data in .gitmodules/.git/config) Lars Hjemli

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).