git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: Tom Preston-Werner <tom@github.com>, git@vger.kernel.org
Subject: Re: Local clone checks out wrong branch based on remote HEAD
Date: Thu, 19 Mar 2009 00:02:29 -0400	[thread overview]
Message-ID: <20090319040229.GA32435@coredump.intra.peff.net> (raw)
In-Reply-To: <49C0C769.8020401@drmicha.warpmail.net>

On Wed, Mar 18, 2009 at 11:05:29AM +0100, Michael J Gruber wrote:

> One might even argue that in case of ambiguities, checking out a
> detached head would be most appropriate. Really, why impose creation of
> certain local branches on a user at all, unless asked for? Detached
> heads are natural in git! But I don't really expect positive consensus
> on that one...

I'm not sure that detached HEADs are all that natural. It means that:

  git clone repo-with-ambiguous-HEAD foo
  cd foo
  hack hack hack
  git commit -a -m msg

is putting your commits "nowhere" (i.e., not on any ref). They are not
accessible for pushing, and when you checkout another branch, they will
be lost (except to the reflog).

So it clearly requires that the user be aware of what is going on, and
that they understand the subtleties of detached HEADs (something that
has caused new user confusion before, I think).

-Peff

      parent reply	other threads:[~2009-03-19  4:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17 19:19 Local clone checks out wrong branch based on remote HEAD Tom Preston-Werner
2009-03-17 19:39 ` Daniel Barkalow
2009-03-17 23:40   ` Junio C Hamano
2009-03-18  1:51     ` Jeff King
2009-03-17 21:31 ` Nanako Shiraishi
2009-03-18  0:54 ` Jeff King
2009-03-18 10:05   ` Michael J Gruber
2009-03-18 21:11     ` Jay Soffian
2009-03-19  4:04       ` Jeff King
2009-03-19  4:02     ` Jeff King [this message]

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=20090319040229.GA32435@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=tom@github.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).