From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Marc Branchaud <marcnarc@xiplink.com>,
git@vger.kernel.org, Jens Lehmann <Jens.Lehmann@web.de>
Subject: Re: [PATCH] Try harder to find a remote when on a detached HEAD or non-tracking branch.
Date: Tue, 19 Jun 2012 16:12:59 -0400 [thread overview]
Message-ID: <20120619201259.GB14692@sigill.intra.peff.net> (raw)
In-Reply-To: <7vipen191a.fsf@alter.siamese.dyndns.org>
On Tue, Jun 19, 2012 at 10:55:13AM -0700, Junio C Hamano wrote:
> Marc Branchaud <marcnarc@xiplink.com> writes:
>
> > On 12-06-18 06:12 PM, Junio C Hamano wrote:
> > ...
> >> That reliance of "origin" is what made me think that "not guessing
> >> and blindly assuming" a wrong thing to do.
> >
> > I think git can do better than erroring out, though.
> >
> >> It is OK that your build usesdetached HEAD, but if that is the case
> >> shoudln't it be the one deciding which specific remote it wants to
> >> take the updated sources from, and telling Git to do so?
> >
> > Sure, but I feel it did that already when it cloned. It seems reasonable for
> > the submodules to default to using the remote specified when the super-repo
> > was cloned.
>
> I do not have a strong opinion either way, other than that I would
> prefer predictable behaviour over "works most of the time provided
> if the user does X, otherwise does this random thing". And coming
> from that standpoint, erroring out when there needs a guess involved
> is certainly more predictable---it is a cop-out option for me in
> areas of the system I do not have strong preferences.
One thing that makes me nervous about this patch is that it is not just a
change to git-submodule, but rather to git-parse-remote. So it could
affect other parts of the system, too, where a guess might not be as
desirable.
The number of affected code paths is fortunately quite small, since this
is updating the shell library, and most of the remote-handling code is
written in C these days. But it raises a few questions:
1. git-pull can call into get_default_remote via get_remote_merge_branch.
Is it impacted by this change?
2. We install git-parse-remote as part of the plumbing API. Do we know
of any other 3rd-party scripts that use this interface and might be
affected?
3. The C code sets up remote.c:default_remote_name, which defaults to
"origin". Should this be consistent with what git-parse-remote
does?
Should this be a submodule-only thing?
-Peff
next prev parent reply other threads:[~2012-06-19 20:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-18 17:01 [PATCH] Try harder to find a remote when on a detached HEAD or non-tracking branch marcnarc
2012-06-18 17:33 ` Junio C Hamano
2012-06-18 21:40 ` Marc Branchaud
2012-06-18 22:12 ` Junio C Hamano
2012-06-19 14:07 ` Marc Branchaud
2012-06-19 17:55 ` Junio C Hamano
2012-06-19 19:31 ` Heiko Voigt
2012-06-19 21:42 ` Marc Branchaud
2012-06-20 17:42 ` Heiko Voigt
2012-06-19 20:12 ` Jeff King [this message]
2012-06-19 20:31 ` Junio C Hamano
2012-06-19 21:43 ` Marc Branchaud
2012-06-19 21:46 ` Jeff King
2012-06-19 21:58 ` Junio C Hamano
2012-06-19 22:00 ` Jeff King
2012-06-19 22:26 ` Junio C Hamano
2012-06-19 19:41 ` Jens Lehmann
2012-06-19 21:43 ` Marc Branchaud
2012-06-20 2:49 ` Phil Hord
2012-06-18 17:53 ` Arnaud Lacombe
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=20120619201259.GB14692@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=marcnarc@xiplink.com \
/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).