Skip to content

Conversation

@JasonGoemaat
Copy link

I see two other pull requests for the same feature (#482 and #684) that haven't been updated in 18 months, so I thought I would give it a try since I need this functionality for a project to convert from another source control system.

SubmoduleCollection.Add(url, subdir) acts like the command line 'git submodule add url subdir'.
It calls git_submodule_add_setup, then deletes the directory created by that and clones
into the same directory and calls git_submodule_add_finalize. The end result is that the
.gitmodules file and the 'file' for the submodule directory are staged and ready to commit.

SubmoduleCollection.Add(url, subdir) acts like the command line 'git submodule add url subdir'.
It calls git_submodule_add_setup, then deletes the directory created by that and clones
into the same directory and calls git_submodule_add_finalize.  The end result is that the
.gitmodules file and the 'file' for the submodule directory are staged and ready to commit.
@carlosmn
Copy link
Member

This functionality should not live in SubmoduleCollection. It'd be a good candidate for Commands.SubmoduleAdd or Commands.Submdoule.Add where it would be appropriate to emulate a high-level git command.

@bording bording closed this Apr 21, 2019
@jnnwnk
Copy link

jnnwnk commented Aug 6, 2019

Did this ever get into a release?
I'm looking exactly for something line this

SubmoduleCollection.Add(url, subdir) acts like the command line 'git submodule add url subdir'.
It calls git_submodule_add_setup, then deletes the directory created by that and clones into the same directory and calls git_submodule_add_finalize. The end result is that the .gitmodules file and the 'file' for the submodule directory are staged and ready to commit.

There is no Submodules.Add(). I can't figure out if this is placed somewhere else like mentioned in the last comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants