★ wanayoo — archive 1999 https://github.com/libgit2/libgit2sharp/pull/1232Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SubmoduleCollection.Add() using clone #1232

Closed
wants to merge 4 commits into from

Conversation

@JasonGoemaat
Copy link

@JasonGoemaat JasonGoemaat commented Nov 12, 2015

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.
@JasonGoemaat JasonGoemaat force-pushed the JasonGoemaat:feature/AddSubmodule branch from 8429efd to 7b64825 Nov 21, 2015
@carlosmn
Copy link
Member

@carlosmn carlosmn commented Apr 20, 2016

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 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.