git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Verdoolaege <skimo@kotnet.org>
To: Mark Levedahl <mlevedahl@gmail.com>
Cc: git@vger.kernel.org, pkufranky@gmail.com
Subject: Re: [PATCH] git-submodule - Allow adding a submodule in-place
Date: Tue, 4 Mar 2008 12:22:59 +0100	[thread overview]
Message-ID: <20080304112259.GM4703MdfPADPa@greensroom.kotnet.org> (raw)
In-Reply-To: <1204596383-4040-1-git-send-email-mlevedahl@gmail.com>

On Mon, Mar 03, 2008 at 09:06:23PM -0500, Mark Levedahl wrote:
> @@ -9,17 +9,18 @@ git-submodule - Initialize, update or inspect submodules
>  SYNOPSIS
>  --------
>  [verse]
> -'git-submodule' [--quiet] add [-b branch] [--] <repository> [<path>]
> +'git-submodule' [--quiet] add [-b branch] [-r <remote>] [--] <repository> [<path>]
>  'git-submodule' [--quiet] status [--cached] [--] [<path>...]
> -'git-submodule' [--quiet] [init|update] [--] [<path>...]
> +'git-submodule' [--quiet] [init|update] [-r <remote>] [--] [<path>...]
>  
> @@ -55,6 +56,18 @@ OPTIONS
>  -b, --branch::
>  	Branch of repository to add as submodule.
>  
> +-r remote::
> +	Name of remote to use or define when working with relative submodules
> +	(i.e., submodules whose url is given relative to the top-level
> +	project). If this value is undefined, the top-level project's
> +	branch.<name>.remote is used, and if that is undefined the default
> +	"origin" is used. The remote will be defined in each relative
> +	submodule as needed by appending the relative url to the top level
> +	project's url. This option has no effect upon submodules defined
> +	using an absolute url: such project's are cloned using the default
> +	"origin," and are updated using the submodule's branch.<name>.remote
> +	machinery and defaulting to "origin."
> +

As has been noted by others, these changes don't belong in this commit.

As to the functionality actually provided by this patch,
I'm somewhat concerned with encouraging this kind of setup,
where the main (and only) copy of your subproject repo
is stored inside the working tree.

Ideally (for some at least), switching back to a commit
of the superproject from before the subproject was added
should remove the subproject from the working tree.
This means that the GIT_DIR of the subproject should be
stored somewhere under the GIT_DIR of the superproject.
There was some talk about doing this about a year ago,
but AFAIK, it hasn't gotten implemented yet.
It's easier to handle this when adding a subproject that
does not already exist in the tree.

Of course, if this feature would ever get implemented, then
it would also have to provide an upgrade path from the
current setup and that upgrade path would also handle your
case.  So this is not really an objection, but just a concern.

skimo

  parent reply	other threads:[~2008-03-04 11:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04  2:06 [PATCH] git-submodule - Allow adding a submodule in-place Mark Levedahl
2008-03-04  5:16 ` Ping Yin
2008-03-04  7:09 ` Junio C Hamano
2008-03-04 12:39   ` Mark Levedahl
2008-03-04 11:22 ` Sven Verdoolaege [this message]
2008-03-05  1:15 ` Mark Levedahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080304112259.GM4703MdfPADPa@greensroom.kotnet.org \
    --to=skimo@kotnet.org \
    --cc=git@vger.kernel.org \
    --cc=mlevedahl@gmail.com \
    --cc=pkufranky@gmail.com \
    --cc=skimo@liacs.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).