git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Aneesh Kumar <aneesh.kumar@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	madduck@debian.org, git@vger.kernel.org
Subject: Re: [topgit] tg update error
Date: Thu, 12 Feb 2009 07:56:21 -0500	[thread overview]
Message-ID: <20090212125621.GB5397@sigill.intra.peff.net> (raw)
In-Reply-To: <20090212092558.GB21074@skywalker>

On Thu, Feb 12, 2009 at 02:55:58PM +0530, Aneesh Kumar K.V wrote:

> On Thu, Feb 12, 2009 at 09:48:11AM +0100, martin f krafft wrote:
> > also sprach Aneesh Kumar <aneesh.kumar@gmail.com> [2009.02.12.0909 +0100]:
> > > doing a tg update with latest git gives the below error
> > >
> > > [extent_validate@linux-2.6]$ tg update
> > > fatal: Refusing to point HEAD outside of refs/heads/
> > > [extent_validate@linux-2.6]$
> >
> > Which version? And could you please provide (a lot) more information
> > about your repository or make it available?
> >
>
> Latest git and topgit. Moving to git version v1.6.1.3 fixed the issue.
> I can reproduce the problem on any test repo. Just do a tg update after
> committing something in the dependent branch.

This error message and safety valve are not in any released version of
git yet. So by moving back to 1.6.1.3, you are just predating the
addition of that message. :)

I think I know what is going on. A safety valve was added in afe5d3d to
disallow setting HEAD to anything that would violate git's "is this a
git directory" detector:

    symbolic ref: refuse non-ref targets in HEAD

    When calling "git symbolic-ref" it is easy to forget that
    the target must be a fully qualified ref. E.g., you might
    accidentally do:

      $ git symbolic-ref HEAD master

    Unfortunately, this is very difficult to recover from,
    because the bogus contents of HEAD make git believe we are
    no longer in a git repository (as is_git_dir explicitly
    checks for "^refs/heads/" in the HEAD target). So
    immediately trying to fix the situation doesn't work:

      $ git symbolic-ref HEAD refs/heads/master
      fatal: Not a git repository

    and one is left editing the .git/HEAD file manually.

Released versions of git just check "refs/" in HEAD. _But_ as part of
this patch series, b229d18 also tightened the "refs/" check to
"refs/heads/".

So what I suspect is happening is that topgit is trying to set HEAD to
"refs/top-bases/whatever". Aneesh, can you confirm by running your test
with GIT_TRACE=1?  I suspect you will see a call like "git symbolic-ref
HEAD refs/top-bases/foo".

Junio, I think we should probably revert b229d18 (and loosen
symbolic-ref's check to just "refs/"). Even if you want to argue that
topgit should be changed to handle this differently, we are still
breaking existing topgit installations, and who knows what other scripts
which might have relied on doing something like this.

-Peff

  parent reply	other threads:[~2009-02-12 12:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-12  8:09 [topgit] tg update error Aneesh Kumar
2009-02-12  8:48 ` martin f krafft
2009-02-12  9:25   ` Aneesh Kumar K.V
2009-02-12  9:32     ` martin f krafft
2009-02-12 10:12       ` Aneesh Kumar K.V
2009-02-12 11:29       ` Bert Wesarg
2009-02-12 12:56     ` Jeff King [this message]
2009-02-12 12:59       ` Jeff King
2009-02-12 21:01         ` martin f krafft
2009-02-12 21:01       ` Junio C Hamano
2009-02-12 21:41         ` martin f krafft
2009-02-12 23:14           ` Junio C Hamano
2009-02-13  6:28             ` martin f krafft
2009-02-13  7:32               ` Junio C Hamano
2009-02-13  9:04                 ` Junio C Hamano
2009-02-13 18:26         ` Jeff King
2009-02-14  2:02           ` Junio C Hamano
2009-02-14  2:08             ` Jeff King
2009-02-14  2:16               ` Junio C Hamano
2009-02-14  2:24                 ` Jeff King

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=20090212125621.GB5397@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=aneesh.kumar@gmail.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=madduck@debian.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).