Re: [RFC] remove/deprecate 'submodule init' and 'sync'
- From
W. Trevor King <wking@tremily.us>
- Date
- Dec 1, 2012, 16:54 UTC
- Message-ID
- <20121201165404.GD4823@odin.tremily.us>
- In-Reply-To
- <20121130175309.GA718@odin.tremily.us>
I'm currently stuck with adding a commit-less existing repository as a submodule (which happens in t7400-submodule-basic.sh, ../bar/a/b/c works with relative local path):
$ mkdir -p super/sub $ cd super $ git init $ (cd sub && git init) $ git submodule add ./ sub $ git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: .gitmodules #
What I'm missing is a gitlink form sub for 'Subproject commit 00000...' or some such. When the subproject has an actual commit, things work as expected:
$ mkdir -p super/sub $ cd super $ git init $ (cd sub && git init && echo line-1 > file && git add file && git commit -m file) $ git submodule add ./ sub $ git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: .gitmodules # new file: sub #
This means that module_list isn't aware of the empty submodule, when the user has just explicitly added it. Fixing this would seem to need either 'Subproject commit 00000...' as I suggested earlier, or an adjustment to module_list that also spits out submodules that are in .gitmodules but not in the index.
Cheers, Trevor
-- This email may be signed or encrypted with GnuPG (http://www.gnupg.org). For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy