From: "Nigel Magnay" <nigel.magnay@gmail.com>
To: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Cc: "Git Mailing List" <git@vger.kernel.org>
Subject: Re: [PATCH] Teach git submodule update to use distributed repositories
Date: Thu, 17 Jul 2008 16:07:11 +0100 [thread overview]
Message-ID: <320075ff0807170807l1537e34ev510deda537e4d11e@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0807171513560.8986@racer>
On Thu, Jul 17, 2008 at 3:16 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Thu, 17 Jul 2008, Nigel Magnay wrote:
>
>> Your attitude seems to be that the status-quo is in some way desirable;
>> "It's no wonder that this tool is awkward to use in your workflow.".
>> This workflow is really common, and there's actual, real people on this
>> list complaining about it. Don't we think it could be improved to be
>> non-awkward ?
>
> I do not think that the status quo is the best possible.
>
> But I think that the way you go makes things so confusing that those who
> use it apart from you will have problems.
>
Ok
> For example, in your setup everybody would have to install _different_
> remotes in every submodule.
>
> And then some would ask themselves why the original origin was not good
> enough.
>
> And others would specify "-o origin" all the time, thinking it was
> required.
>
> There must be a better way to promote submodules to a usable state,
My attempt was to try and do some small simple things, but you could
well be right, that might make some commands bloat out with
unneccessary options just to get something done, and that would be
bad.
Stepping back - lets try to come up with a better way (please comment
and and critique)
What we'd like (to start with) is for
$ git pull fred
perhaps with --submodules (as Petr mentions), perhaps with config
settings and caveats, to produce a result that means you don't need to
be aware that there were submodules, they're automatically fetched and
updated based on commits that may only exist in fred's repository.
So currently, you can do
$ git pull origin && git submodule init && git submodule update
And it works, but
$ git pull fred
$ git submodule update
Can leave you with problems, because if a submodule wasn't pushed to
origin, you won't have it available. This is because the commands are
equivalent to
$ git pull fred
for each submodule()
cd submodule
git fetch origin
git checkout <sha1>
So somehow, you need to replace 'git fetch origin' with the "correct"
repository (on fred's computer). My patch was really just about being
able to pass parameters to 'git fetch'. The problems are that if you
did
$ git submodule update fred
Unless each submodule had a [remote] specified for "fred", you'd be
stuffed. But what you could do is either by passing the right URL, or
looking at the superproject [remote] for "fred" - i.e: If in the
superproject you have
[remote "fred"]
url = ssh://git@fred.local/pub/scm/git/workspace/thing/.git
[submodule "module"]
url = ssh://git@repo/pub/scm/git/module.git
Then the submodule "module" on fred, if it's a working-copy, can be calculated
ssh://git@fred.local/pub/scm/git/workspace/thing/module/.git
If it isn't a WC then you'd have to have a [remote "fred"] in that
submodule, but I'm thinking that'd be a rare case.
I'd assumed (possibly wrongly?) that there was resistance to putting
any of the submodule logic in things other than git-submodules.
As a starter for 10, how about
- a '--submodules' option to git fetch / pull
- using the remote name if known, calculate it if not based on the above
WDYT?
next prev parent reply other threads:[~2008-07-17 15:08 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-17 12:08 [PATCH] Teach git submodule update to use distributed repositories Nigel Magnay
2008-07-17 12:13 ` Johannes Schindelin
[not found] ` <320075ff0807170520r200e546ejbad2ed103bd65f82@mail.gmail.com>
2008-07-17 12:21 ` Nigel Magnay
2008-07-17 12:58 ` Johannes Schindelin
2008-07-17 14:03 ` Nigel Magnay
2008-07-17 14:16 ` Johannes Schindelin
2008-07-17 15:07 ` Nigel Magnay [this message]
2008-07-17 18:22 ` Petr Baudis
2008-07-18 8:11 ` Nigel Magnay
2008-07-18 8:45 ` Jakub Narebski
2008-07-18 9:00 ` Junio C Hamano
2008-07-18 9:07 ` Jakub Narebski
2008-07-18 9:18 ` Nigel Magnay
2008-07-18 9:16 ` Petr Baudis
2008-07-18 9:36 ` Nigel Magnay
2008-07-18 10:00 ` Petr Baudis
2008-07-18 11:20 ` Nigel Magnay
2008-07-18 14:43 ` Petr Baudis
2008-07-18 15:09 ` Nigel Magnay
2008-07-18 15:49 ` Petr Baudis
2008-07-18 22:38 ` Mark Levedahl
2008-07-21 10:59 ` Nigel Magnay
2008-07-17 14:38 ` Petr Baudis
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=320075ff0807170807l1537e34ev510deda537e4d11e@mail.gmail.com \
--to=nigel.magnay@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.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).