git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: could not detach HEAD error didn't identify the cause of the issue

From
Jeff King <peff@peff.net>
Date
Sep 14, 2009, 22:39 UTC
Message-ID
<20090914223941.GA20036@coredump.intra.peff.net>
In-Reply-To
<4AAEAF28.2050604@catalyst.net.nz>

[Please don't top-post; the usual etiquette on this list is to reply in-line].

On Tue, Sep 15, 2009 at 09:01:28AM +1200, Ben Bradshaw wrote:
> I'm using git version 1.5.6.5 - I think I can elaborate on the issue
> some more though. I'll step through the process that got me to the point
> of failure.

Thanks for following up. I was able to reproduce your problem. The more complex setup you described is not necessary to reproduce (though thank you for providing it, as it eliminated one possible source of variation). It really is just about having an untracked file 'foo' in your working tree, and the thing you are trying to rebase on top of also has 'foo' as a tracked file.

The good news is that it has already been fixed. I bisected it down to:
  commit 324c2c3177ca5b62b12029ce8821542fc29a2733
  Author: Junio C Hamano <gitster@pobox.com>
  Date:   Mon Jul 14 14:05:35 2008 -0700
      git-rebase: report checkout failure
      When detaching the HEAD to the base commit, the "git checkout"
      command could fail if, for example, upstream contains a file that
      would overrwrite a local, untracked file.  Unconditionally
      discarding the standard error stream was done to squelch the
      progress and notices back when checkout did not have -q option,
      but there is no reason to keep doing it anymore.
      Noticed by Robert Shearman.
which sounds about right. :)

It made it into git v1.6.0, but not into any of the v1.5.x maintenance series. I would suggest upgrading if you can.

-Peff
Previous: Ben Bradshaw
Message 4 of 4 in “could not detach HEAD error didn't identify the cause of the issue”
  1. Ben BradshawSep 14, 2009
  2. Jeff KingSep 14, 2009
  3. Ben BradshawSep 14, 2009
  4. Jeff KingSep 14, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.