git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiko Voigt <hvoigt@hvoigt.net>
To: Marc Branchaud <marcnarc@xiplink.com>
Cc: Junio C Hamano <gitster@pobox.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: Wed, 20 Jun 2012 19:42:35 +0200	[thread overview]
Message-ID: <20120620174213.GA2500@book.hvoigt.net> (raw)
In-Reply-To: <4FE0F262.9050404@xiplink.com>

Hi,

On Tue, Jun 19, 2012 at 05:42:58PM -0400, Marc Branchaud wrote:
> On 12-06-19 03:31 PM, Heiko Voigt wrote:
> > Using the first configured remote as a fallback also sounds quite
> > arbitrary to me. Your current HEAD might have nothing to do with that
> > remote.
> 
> Sure, but if it doesn't specify a remote then why not?  (Instead of "first
> configured remote" think "remote used in the initial clone command".)

Returning the "remote used in the initial clone" sounds ok to me as
well but that does not have to be the same as "first remote git config
--list returns".

> > Before falling back to origin how about guessing the remote from the
> > first branch thats contained in HEAD?
> >
> > To me that sounds quite natural. The first branch could be ambiguous so
> > we would have to come up with some ordering. Maybe a depth search and
> > first parents first? Or a breadth first search with younger generations
> > first and then first parents first?
> 
> This sounds much harder to explain to a user than "the remote you used when
> you cloned the repo".

Well I think "it uses the remote of the branch that you based your work
on" is not hard to explain. What's harder is the implementation.

> > Would that work for your use case Marc?
> 
> Maybe, but it seems much more complicated than necessary.

Git is a tool used in very different workflows so a change needs to be
quite generic. Make it as simple as possible but *no simpler*. I think
your patch is currently not respecting the "no simpler".

Cheers Heiko

  reply	other threads:[~2012-06-20 17:42 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 [this message]
2012-06-19 20:12           ` Jeff King
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=20120620174213.GA2500@book.hvoigt.net \
    --to=hvoigt@hvoigt.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).