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

Re: cloning a tree which has detached branch checked out

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 7, 2012, 17:11 UTC
Message-ID
<7v4nv236xn.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120207153225.GA14773@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 15 quoted lines
> On Tue, Feb 07, 2012 at 07:57:08PM +0700, Nguyen Thai Ngoc Duy wrote:
>
>> On Tue, Feb 7, 2012 at 5:41 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
>> >> > #git clone -n lab:/home/mst/scm/linux
>> >> > ....
>> >> > error: Trying to write ref HEAD with nonexistant object
>> >> > cec64082f689f949a397cb9b39423dc41545fa0e
>> >> > fatal: Cannot update the ref 'HEAD'.
>> >> >
>> >> > Looks like a bug, doesn't it?
>> >> ...
>
> This particular bug should have been fixed before that, even, with my
> c1921c1 (clone: always fetch remote HEAD, 2011-06-07). And it is tested
> explicitly in t5707,...

That was my thought when I first saw it. The failure case was that HEAD was pointing at something no ref reaches, and clone was only grabbing the tips of branches, which failed to transfer the history leading to HEAD.

> ... So I think your guess about a subtle error in the local ref
> processing is a reasonable one.

What is funny is "error: Trying to write ref HEAD with nonexistant object". "git grep -e nonexistant f3fb0" does not register any hit.

Could it be that mysterious "lab:" protocol handler that is misbehaving?
Previous: Jeff KingNext: Jeff King
Message 8 of 10 in “cloning a tree which has detached branch checked out”
  1. Michael S. TsirkinFeb 7, 2012
  2. Jakub NarebskiFeb 7, 2012
  3. Michael S. TsirkinFeb 7, 2012
  4. Nguyen Thai Ngoc DuyFeb 7, 2012
  5. Michael S. TsirkinFeb 7, 2012
  6. Nguyen Thai Ngoc DuyFeb 7, 2012
  7. Jeff KingFeb 7, 2012
  8. Junio C HamanoFeb 7, 2012
  9. Jeff KingFeb 7, 2012
  10. Michael S. TsirkinFeb 8, 2012

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.