git/list[1] front-page[2] threads[3] people[4] search[5] about
 

using .gitmodule as default (was: git submodule init and redundant data in .gitmodules/.git/config)

From
MKmartin f krafft <madduck@madduck.net>
Date
Aug 15, 2007, 22:29 UTC
Message-ID
<20070815222907.GA7395@piper.oerlikon.madduck.net>
In-Reply-To
<20070815163822.GC1070MdfPADPa@greensroom.kotnet.org>
also sprach Sven Verdoolaege <skimo@kotnet.org> [2007.08.15.1838 +0200]:
Show 6 quoted lines
> The (most appropriate) URL from which to get updates of a submodule
> may be different for different people and therefore has to be stored
> in .git/config.  It was then decided that the default value
> for this URL should be stored in .gitmodules.  git submodule init
> simply initializes the URL using this default value.  You are free
> to not call git submodule init and set a (more) appropriate URL manually.

Ah. I shall prepare a patch against the manpage to make this more clear then. Thanks for your explanation.

I have one open question though: why require init? It makes perfect sense to allow for a local override, but unless I need to override it, git-submodule update should really just keep using the default, which it does not as far as I can tell from my tests:

piper:/tmp/cdt.tfd29893/co/a> git submodule update piper:/tmp/cdt.tfd29893/co/a> git-submodule init Submodule 'b' (/tmp/cdt.tfd29893/repos/b.git) registered for path 'b' piper:/tmp/cdt.tfd29893/co/a> git submodule update Initialized empty Git repository in /tmp/cdt.tfd29893/co/a/b/.git/ 0 blocks Submodule path 'b': checked out '0c1403bc9e13480e70745b70f79ffb00deb25a8d'

Is there a reason for this or should I try to create a patch, which would make git-submodule consult .gitmodules in addition to config.submodules for all modules not found in config.submodules.

Now if I may go a step further, I'll claim that init is a misnomer, really. Instead, I would suggest to rename it. Here are some thoughts:

  - config
    there is already git-config, and just like git-svn reuses e.g.
    rebase, this would keep the taxonomy compact
  - cpconf
    it does copy the configuration, after all
  - override
    not sure, since it doesn't actually override anything, but sets
    it all up for the user to be able to override the config
  - instconf
    install or instantiate the configuration
  - localise
    overloaded word, but it'd be localising configuration in some
    ways
  - localconf
    hinting at making the configuration local
Comments welcome,
-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
man muss noch chaos in sich haben
um einen tanzenden stern zu gebähren.
                                                -- friedrich nietzsche
 
spamtraps: madduck.bogus@madduck.net
Previous: Sven VerdoolaegeNext: Josef Weidendorfer
Message 3 of 7 in “git submodule init and redundant data in .gitmodules/.git/config”
  1. martin f krafftAug 15, 2007
  2. Sven VerdoolaegeAug 15, 2007
  3. using .gitmodule as default (was: git submodule init and redundant data in .gitmodules/.git/config)martin f krafft, Aug 15, 2007
  4. Josef WeidendorferAug 16, 2007
  5. martin f krafftAug 16, 2007
  6. Josef WeidendorferAug 16, 2007
  7. Lars HjemliAug 17, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.