git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Lars Hjemli" <hjemli@gmail.com>
To: "Junio C Hamano" <junkio@cox.net>
Cc: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	git@vger.kernel.org,
	"Linus Torvalds" <torvalds@linux-foundation.org>
Subject: Re: [PATCH] Add git-submodule command
Date: Sat, 26 May 2007 00:01:50 +0200	[thread overview]
Message-ID: <8c5c35580705251501u6346c27by1d133efc3d157bf2@mail.gmail.com> (raw)
In-Reply-To: <7v4pm0r5ga.fsf@assigned-by-dhcp.cox.net>

[This thread is starting to get long, sorry for even more noise about
the submodule stuff]

On 5/25/07, Junio C Hamano <junkio@cox.net> wrote:
> "Lars Hjemli" <hjemli@gmail.com> writes:
>
> > On 5/25/07, Junio C Hamano <junkio@cox.net> wrote:
> > ...
> >> I really do not want that (mis)conception that .gitmodules
> >> specify the default and .git/config the override.  I really
> >> think we should use the .git/config as _the_ only authority to
> >> get URL, but keyed with the three-level scheme, with URL in
> >> .gitmodules used _solely_ as a hint when setting up the URL in
> >> the .git/config file.
> >>
> >>         cf. $gmane/47502, 47548, 47621
> >>
> >
> > I've read these articles, but I think much of the concerns about
> > trusting the url supplied by upstream goes away when the submodule
> > clone/checkout isn't an integrated part of the superproject
> > clone/checkout. Besides, if you trust your upstream enough to clone
> > their repository (the superproject), why wouldn't you trust the data
> > (.gitmodules) in that very repository?
>
> It's not about trusting.  You would need to support the mapping
> for network connectivity reasons, and you would also need to
> notice and reconfirm when the suggested URL in .gitmodules
> changes (perhaps because the upstream relocated from sf.net to
> repo.or.cz ;-), you would need something like what I described
> in order to keep track of user preference for each submodule in
> .git/config anyway.  If that "mapping" ends up to be ident
> mapping for most people, that is fine.  At least by always doing
> the three-level mapping we would not have any special case in
> the code, and this is not the performance critical part of the
> system.
>
> I think the response to the case when upstream repository
> relocates from the ".gitmodule for default, .git/config for
> override" camp would be "you asked to override in .git/config,
> so it is your job to notice the change in .gitmodules and adjust
> your override URL".  That is a serious mistake in usability
> point of view.  Repository relocation would (hopefully) seldom
> happen, but when it does happen, things either would break
> (which is easier to diagnose and manually fix up), or things
> clone fine but we reach a wrong repository (which is harder to
> notice, as "fetch" may succeed -- it just would not fetch the
> right commit).  Being able to notice when upstream repository
> relocates and to ask for confirmation when that happens would
> eliminate a lot of confusion from that.

Basically, I'd say that as long as the superproject names the sha1 of
the submodule commit, nothing else matters.

If you track a submodule, you would easily notice it if the submodule
has the 'wrong' commit checked out (git diff, git status, git
submodule status). And 'git submodule update' would synchronize the
submodules you have decided to track, or error out with a message like
"Unable to checkout '$sha1' in submodule '$path'".

This is when the ugly sides of submodules raises its head (the
'official' repo has moved, my local repo is out of date, whatever). I
just don't see the need for solving those problems now. The 'git
submodule' command would make the common cases easier. Hopefully(?)
that would encourage more people to test/use submodules, and the
problems that actually _needs_ solving will then show up in due time.

> > Another possibility is simply doing the submodule clone/checkout by
> > hand (i.e. do 'git clone preferred-url path', don't do 'git submodule
> > init path').
>
> But that is what this patch is trying to help the users, isn't
> it?  It reduces the attractiveness of this new tool greatly if
> you give up there.

Well, I happen to think that the average user of submodules wouldn't
care the slightest bit where the submodule was cloned from, as long as
the sha1 matches. So no, the patch was more about the lack of
submodule porcelain and less about completeness.


> >>When the name of the commit object in the
> >> superproject tree and/or index is 0{40}, it would be a good
> >> extension to use "whatever commit that happens to be at the tip
> >> of this branch" taken from the .gitmodules file.
> >
> > I really can't imagine what kind of superproject would have such a
> > setup. Why would this be needed?
>
> "We would work with any working version of Linux 2.6 kernel"
> would be a sensible thing to say, I would think.

Maybe. I wouldn't want to automatically track the tip of _any_ branch,
since I would have no way of knowing if what works today will also
work tomorrow (or even compile).

> It's purely optional, and as you seem to agree always detaching
> HEAD is easier to explain, you do not need "module.$path.branch"
> at all.  I just mentioned 0{40} as a possible use case for that
> configuration variable.

Ok.

I'll redo the patch, removing the branch-specific things, and try to shut up :)

-- 
larsh

  reply	other threads:[~2007-05-25 22:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-25  9:51 [PATCH] Add git-submodule command Lars Hjemli
2007-05-25 10:57 ` Johannes Schindelin
2007-05-25 12:24 ` Johannes Schindelin
2007-05-25 13:46   ` Lars Hjemli
2007-05-25 13:58     ` Johannes Schindelin
2007-05-25 14:16       ` Lars Hjemli
2007-05-25 14:47         ` Johannes Schindelin
2007-05-25 14:52           ` Lars Hjemli
2007-05-25 18:09             ` Lars Hjemli
2007-05-25 18:41               ` Johannes Schindelin
2007-05-25 19:31                 ` Junio C Hamano
2007-05-25 20:29                   ` Lars Hjemli
2007-05-25 20:52                     ` Junio C Hamano
2007-05-25 22:01                       ` Lars Hjemli [this message]
2007-05-26  0:17                         ` Lars Hjemli
2007-05-26  0:48                           ` Johannes Schindelin
2007-05-26  1:23                           ` Junio C Hamano
2007-05-26  9:39                             ` Lars Hjemli
2007-05-26 10:42                             ` Johannes Schindelin
2007-05-26 13:56                             ` Lars Hjemli
2007-05-26 14:37                               ` Simon Hausmann
2007-05-26 14:48                                 ` Lars Hjemli
2007-05-25 20:30                   ` Johannes Schindelin
2007-05-25 19:57                 ` Linus Torvalds
2007-05-25 20:28                   ` Johannes Schindelin
2007-05-25 22:33                 ` Lars Hjemli

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=8c5c35580705251501u6346c27by1d133efc3d157bf2@mail.gmail.com \
    --to=hjemli@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=torvalds@linux-foundation.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).