git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eran Tromer <git2eran@tromer.org>
To: skimo@liacs.nl
Cc: Alex Riesen <raa.lkml@gmail.com>,
	VMiklos <vmiklos@frugalware.org>,
	git@vger.kernel.org
Subject: Re: question about git-submodule
Date: Mon, 06 Aug 2007 13:23:19 -0400	[thread overview]
Message-ID: <46B75907.1070007@tromer.org> (raw)
In-Reply-To: <20070805145922.GC999MdfPADPa@greensroom.kotnet.org>

On 2007-08-05 10:59, Sven Verdoolaege wrote:
>> BTW, is there any easy way to create a submodule directly inside the
>> supermodule's working tree, instead of cloning it as in the above example?
> 
> Do you want to use the submodule porcelain or just the plumbing?
> If you simply want to add a submodule locally, "git add" will do that for
> you just fine.  It's only when you want to make it easier for people who
> clone your superproject to get updates of the submodules that you
> should set up the information required by "git submodule" in .gitmodules
> (see end of module_add in git-submodule.sh).

If you just do "git add sub" (where sub is an existing repo subdir) then
any subsequent "git submodule update" predictably complains:
  No submodule mapping found in .gitmodules for path 'sub'

And if you wire up .gitmodules manually, then "git submodule update"
chokes on the "git-fetch" in modules_update().

So I suggest extending "git submodule add" to handle existing
subdirectories by simply using them as-is instead of creating a new
clone. And "git submodule update" shouldn't try fetching when the commit
is already present locally.

Speaking of which, currently "git submodule" clones/fetches *all*
branches on the remote repository, which seems quite excessive given
that the supermodule's content references just one submodule commit. By
default, "git submodule add" should fetch only the needed head, and "git
submodule update" should fetch only the commit sha1 (if needed).

  Eran

      reply	other threads:[~2007-08-06 17:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-13 21:46 question about git-submodule VMiklos
2007-07-15  8:39 ` Sven Verdoolaege
2007-07-15 10:47   ` Alex Riesen
2007-07-15 10:54     ` VMiklos
2007-07-15 13:50       ` Alex Riesen
2007-07-15 13:54         ` VMiklos
2007-07-15 14:02           ` Sven Verdoolaege
2007-07-15 14:26             ` VMiklos
2007-07-15 14:48               ` Sven Verdoolaege
2007-07-15 15:05                 ` VMiklos
2007-07-15 15:21                   ` Sven Verdoolaege
2007-07-15 15:40                     ` VMiklos
2007-07-15 21:45                       ` Sven Verdoolaege
2007-07-15 22:29                         ` VMiklos
2007-07-16 10:39                           ` Sven Verdoolaege
2007-07-16 11:07                             ` VMiklos
2007-07-15 11:51     ` Sven Verdoolaege
2007-07-15 13:42       ` Alex Riesen
2007-07-15 13:52         ` Sven Verdoolaege
2007-08-03 23:01     ` Eran Tromer
2007-08-05 14:59       ` Sven Verdoolaege
2007-08-06 17:23         ` Eran Tromer [this message]

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=46B75907.1070007@tromer.org \
    --to=git2eran@tromer.org \
    --cc=git@vger.kernel.org \
    --cc=raa.lkml@gmail.com \
    --cc=skimo@liacs.nl \
    --cc=vmiklos@frugalware.org \
    /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).