From: Junio C Hamano Date: Tue, 22 Sep 2009 19:25:58 GMT Subject: Re: [PATCH RESEND] git submodule add: make the parameter optional Message-ID: <7vbpl2srw9.fsf@alter.siamese.dyndns.org> In-Reply-To: <4AB8E8D4.40105@web.de> Jens Lehmann writes: > When is not given, use the "humanish" part of the source repository > instead. > > Signed-off-by: Jens Lehmann > --- > > With this patch, git submodule add behaves like git clone in this respect. > > Didn't get a response the last weeks, so here is a resend. > > > Documentation/git-submodule.txt | 8 ++++++-- > git-submodule.sh | 7 ++++++- > t/t7400-submodule-basic.sh | 16 ++++++++++++++++ > 3 files changed, 28 insertions(+), 3 deletions(-) > > diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt > index 5ccdd18..4ef70c4 100644 > --- a/Documentation/git-submodule.txt > +++ b/Documentation/git-submodule.txt > @@ -10,7 +10,7 @@ SYNOPSIS > -------- > [verse] > 'git submodule' [--quiet] add [-b branch] > - [--reference ] [--] > + [--reference ] [--] [] > 'git submodule' [--quiet] status [--cached] [--recursive] [--] [...] > 'git submodule' [--quiet] init [--] [...] > 'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--rebase] > @@ -69,7 +69,11 @@ add:: > to the changeset to be committed next to the current > project: the current project is termed the "superproject". > + > -This requires two arguments: and . > +This requires at least one argument: . The optional > +argument is the relative location for the cloned submodule > +to exist in the superproject. If is not given, the > +"humanish" part of the source repository is used ("repo" for > +"/path/to/repo.git" and "foo" for "host.xz:foo/.git"). I do not know if this is useful in practice nor even desired. Comments?