-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Need support for git submodule init/update with git URLs #1009
Comments
Quite easy to fix, just run the submodule init if .gitsubmodules exists. Or is that too simple? Like you say the export may not work, but we'll have to try it to find out. Can you provide your gitflow formula so we can test with something that needs it? |
Running git submodule init && git submodule update if .gitmodules exists should work just fine, I think. I’m not sure if I’m writing this formula correctly (specifically, if the md5 line needs to be there as is), but here goes: [EDIT: Apparently one can’t embed gists in comments. Boo.] |
Obviously git-flow depends on git, as it is a git tool, but policy is that we don't explicitly depend on source control systems; should we make an exception on this? |
I don’t think we need to make an exception. It won’t install without git, so presumably the user will get what they asked for. |
I've added a branch 'git-flow' on my fork that seems to address the submodule issue. As robrix points out, checkout-index does not copy the submodule folders. Luckily, we can checkout-index for each submodule by using the 'git submodule foreach' command. git-flow now properly initializes and installs. |
Link to commit to test: http://github.com/cthachuk/homebrew/commit/643152b46cd811f935978fbee950985d44b8d380 |
I pushed the commit to fix this, but then testing with a redcar formula I get: (The git-flow formula worked.) Maybe an issue with multiple submodules? |
Quote prefix for git submodules. Closed by a4dc535 |
Sorry for the long delay on this. Indeed, this is fixed and working beautifully. Thanks! |
If submodules exists for a git repo then checkout their index as well into the appropriate path. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
If submodules exists for a git repo then checkout their index as well into the appropriate path. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
If submodules exists for a git repo then checkout their index as well into the appropriate path. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
When trying to make a formula for @nvie’s gitflow (http://github.com/nvie/gitflow), I found that using a git:// url (or head) will git checkout-index before the install step, which means that the requisite git submodule init and update commands can’t be run (since they have to have the .git repo available).
Automatic or formula-specified support for git submodules would prevent this issue while not requiring brew to stop using checkout-index or provide an intermediate step in the Caches dir. Automatic support could be done by checking for the existence of .gitmodules.
It occurs to me that checkout-index will probably not copy the submodule folders, though.
The text was updated successfully, but these errors were encountered: