From: Jan Hudec <bulb@ucw.cz>
To: Junio C Hamano <junkio@cox.net>
Cc: skimo@liacs.nl, Alex Riesen <raa.lkml@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 07/16] git-read-tree: take --submodules option
Date: Sun, 20 May 2007 17:54:07 +0200 [thread overview]
Message-ID: <20070520155407.GC27087@efreet.light.src> (raw)
In-Reply-To: <7v4pm8y8tf.fsf@assigned-by-dhcp.cox.net>
[-- Attachment #1: Type: text/plain, Size: 3583 bytes --]
On Sat, May 19, 2007 at 11:20:12 -0700, Junio C Hamano wrote:
> Sven Verdoolaege <skimo@kotnet.org> writes:
>
> > Does everyone agree that we should fetch (possibly after asking
> > for confirmation from the use) _during_ the checkout ?
> > I now only fetch submodules during a fetch of the supermodule
> > (actually, in my current patch set, I only fetch a submodule
> > the first time I see it, but that's a bug), but if there is
> > a consensus on this, I can switch to fetching during checkout.
>
> I think fetching of subproject during fetch or clone of
> superproject would not make much sense. Making it part of
> superproject checkout would probably be the way we will end up
> going. The detail of "which part of the checkout" would need to
> be defined, and I tend to agree with Alex that checkout itself
> would need to be multi-phased, but I think that is a minor
> implementation detail we can discuss after how the overall flows
> should look like.
IMHO it makes more sense to fetch during fetch of superproject:
- If you don't fetch the superproject, it won't start refering to
unavailable commit of subproject. So should only need to fetch subproject
after fetching superproject.
- If you fetch from more than one location, you want to fetch subproject
from location corresponding to where you fetch superproject from.
Let's have a repository of project P with remotes PA and PB. Let it have
a subproject S with remotes SA and SB.
Whenever I pull P from PA, it might refer to commit of S, that is only
available from SA (because that's what PA owner uses). Whenever I pull
P from PB, it might refer to commit of S, that is only available from SB
(again because that's what PB owner uses).
Now checkout does not know, whether I pulled the target revision from PA
or PB, so:
- Either it has to fetch both. But say the commit I want is in SB and SA
contains a lot of new stuff, which will slow the thing down, though
I don't need it.
- Or it has to guess by looking whether any heads in remotes/PA or
remotes/PB are descendants of the commit being checked out. But that
feels rather hacky.
I see several options:
- Fetch will recurse. This should work ok and is IMHO least magic. We can
also add some way to specify refspecs for the subproject, giving user
control over what is fetched.
- Fetch will store a "pending fetch from" note in the subproject and
checkout, if it does not find the revision, will try fetching from all
sources pointed to by those notes. There is still a problem with what
exactly to fetch (user can specify in config).
- Checkout will ask all subproject repositories whether they have given
commit and pull the first one that does. This would get the needed
commit most certainly. It would be slower though, because it would need
to ask all the repositories whether they have the particular object.
It also leaves the tracking branches in subproject in somewhat random
state (maybe both repositories had the commit, so it pulled from the
other one that user would etc.).
> > As to the key to use to lookup the URL in the config, right
> > now I simply use the directory name where it is attached
> > (which seems like a useful default to me).
The extra level of indirection has the advantage, that you can describe
moving the same subproject to a different directory.
--
Jan 'Bulb' Hudec <bulb@ucw.cz>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-05-20 15:54 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-18 19:24 Second round of support for cloning submodules skimo
2007-05-18 19:24 ` [PATCH 01/16] Add dump-config skimo
2007-05-18 19:24 ` [PATCH 02/16] git-config: add --remote option for reading config from remote repo skimo
2007-05-18 19:24 ` [PATCH 03/16] http.h: make fill_active_slots a function pointer skimo
2007-05-18 19:24 ` [PATCH 04/16] git-config: read remote config files over HTTP skimo
2007-05-18 19:24 ` [PATCH 05/16] unpack-trees.c: verify_uptodate: remove dead code skimo
2007-05-18 22:33 ` Junio C Hamano
2007-05-18 19:24 ` [PATCH 06/16] unpack-trees.c: pass cache_entry * to verify_absent rather than just the name skimo
2007-05-18 19:24 ` [PATCH 07/16] git-read-tree: take --submodules option skimo
2007-05-18 21:53 ` Alex Riesen
2007-05-18 22:08 ` Sven Verdoolaege
2007-05-18 22:42 ` Alex Riesen
2007-05-19 3:59 ` Junio C Hamano
2007-05-19 4:27 ` Shawn O. Pearce
2007-05-19 9:19 ` Alex Riesen
2007-05-19 13:05 ` Sven Verdoolaege
2007-05-19 18:20 ` Junio C Hamano
2007-05-20 15:54 ` Jan Hudec [this message]
2007-05-20 18:33 ` Junio C Hamano
2007-05-20 20:22 ` Sven Verdoolaege
2007-05-21 16:59 ` Jan Hudec
2007-05-21 18:05 ` Sven Verdoolaege
2007-05-21 19:01 ` Junio C Hamano
2007-05-21 20:02 ` Jan Hudec
2007-05-21 21:11 ` Martin Waitz
2007-05-22 19:37 ` Jan Hudec
2007-05-24 15:48 ` Martin Waitz
2007-05-25 10:06 ` Jakub Narebski
2007-05-25 20:15 ` Jan Hudec
2007-05-24 18:26 ` Junio C Hamano
2007-05-24 18:45 ` Sven Verdoolaege
2007-05-24 18:58 ` Junio C Hamano
2007-05-24 19:14 ` Sven Verdoolaege
2007-05-24 20:32 ` Junio C Hamano
2007-05-24 20:55 ` Petr Baudis
2007-05-24 20:59 ` Junio C Hamano
2007-05-24 19:43 ` Junio C Hamano
2007-05-24 20:57 ` Petr Baudis
2007-05-25 20:35 ` Jan Hudec
2007-05-25 21:05 ` Junio C Hamano
2007-05-25 21:16 ` Steven Grimm
2007-05-25 22:11 ` Junio C Hamano
2007-05-19 0:34 ` Petr Baudis
2007-05-18 19:24 ` [PATCH 08/16] unpack-trees.c: assume submodules are clean skimo
2007-05-18 19:24 ` [PATCH 09/16] entry.c: optionally checkout submodules skimo
2007-05-18 21:56 ` Alex Riesen
2007-05-18 22:03 ` Sven Verdoolaege
2007-05-18 22:33 ` Alex Riesen
2007-05-18 22:00 ` Alex Riesen
2007-05-18 22:20 ` [PATCH] Add run_command_v_opt_cd: chdir into a directory before exec Alex Riesen
2007-05-18 22:48 ` [PATCH] Use run_command_v_opt_cd when checking out a submodule Alex Riesen
2007-05-18 19:24 ` [PATCH 10/16] git-checkout: pass --submodules option to git-read-tree skimo
2007-05-19 0:36 ` Petr Baudis
2007-05-18 19:25 ` [PATCH 11/16] git-fetch: skip empty arguments skimo
2007-05-18 22:33 ` Junio C Hamano
2007-05-18 19:25 ` [PATCH 12/16] builtin-fetch--tool: extend "native-store" for use in cloning skimo
2007-05-18 22:52 ` Alex Riesen
2007-05-19 12:17 ` Sven Verdoolaege
2007-05-18 19:25 ` [PATCH 13/16] git-clone: rely on git-fetch for fetching for most protocols skimo
2007-05-18 19:25 ` [PATCH 14/16] git-clone: rely on git-fetch for non-bare fetching over http skimo
2007-05-18 19:25 ` [PATCH 15/16] git-read-tree: treat null commit as empty tree skimo
2007-05-18 19:25 ` [PATCH 16/16] git-clone: add --submodules for cloning submodules skimo
2007-05-18 19:34 ` Second round of support " Sven Verdoolaege
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=20070520155407.GC27087@efreet.light.src \
--to=bulb@ucw.cz \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=raa.lkml@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.