{"thread":{"id":"8501","subject":"fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.","startedAt":"2007-06-08T10:08:31Z","lastAt":"2007-06-10T08:54:30Z","messageCount":7,"participants":["Thomas Glanzmann","Junio C Hamano","carbonated beverage"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"44328","messageId":"20070608100831.GA2335@cip.informatik.uni-erlangen.de","threadId":"8501","inReplyTo":null,"subject":"fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.","fromName":"Thomas Glanzmann","fromEmail":"thomas@glanzmann.de","sentAt":"2007-06-08T10:08:31Z","receivedAt":"2007-06-08T10:08:31Z","isPatch":false,"sender":{"key":"thomas@glanzmann.de","avatar":null},"body":"Hello,\n\n        (s017241) [/usr/src/linux-2.6] git checkout v2.6.20\n        warning: You appear to be on a branch yet to be born.\n        warning: Forcing checkout of v2.6.20.\n        fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.\n        Use '--' to separate paths from revisions\n        Cannot detach HEAD\n\n(s017241) [/usr/src/linux-2.6] git version\ngit version 1.5.2.1\n\nwhat is going wrong here?\n\n        Thomas\n"},{"id":"44329","messageId":"7vodjqkazp.fsf@assigned-by-dhcp.cox.net","threadId":"8501","inReplyTo":"20070608100831.GA2335@cip.informatik.uni-erlangen.de","subject":"Re: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-08T10:15:54Z","receivedAt":"2007-06-08T10:15:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Glanzmann <thomas@glanzmann.de> writes:\n\n> Hello,\n>\n>         (s017241) [/usr/src/linux-2.6] git checkout v2.6.20\n>         warning: You appear to be on a branch yet to be born.\n>         warning: Forcing checkout of v2.6.20.\n>         fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.\n>         Use '--' to separate paths from revisions\n>         Cannot detach HEAD\n>\n> (s017241) [/usr/src/linux-2.6] git version\n> git version 1.5.2.1\n>\n> what is going wrong here?\n\nPerhaps repository was set up in an unusual way by hand\n(i.e. not by a clone), such that:\n\n 1. you have HEAD pointing at a branch (e.g. 'refs/heads/master'),\n 2. which does _not_ exist yet (i.e. no 'refs/heads/master'),\n 3. yet you have a tag that you can try to detach your HEAD to (e.g. v2.6.20).\n\n... well that was my initial guess, but even after setting up such a\nfunny repository by hand, I cannot seem to reproduce it.\n"},{"id":"44330","messageId":"20070608102113.GB2335@cip.informatik.uni-erlangen.de","threadId":"8501","inReplyTo":"7vodjqkazp.fsf@assigned-by-dhcp.cox.net","subject":"Re: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.","fromName":"Thomas Glanzmann","fromEmail":"thomas@glanzmann.de","sentAt":"2007-06-08T10:21:13Z","receivedAt":"2007-06-08T10:21:13Z","isPatch":false,"sender":{"key":"thomas@glanzmann.de","avatar":null},"body":"Hello Junio,\n\n> ... well that was my initial guess, but even after setting up such a\n> funny repository by hand, I cannot seem to reproduce it.\n\nThis was on a fresh clone. What I did was:\n\n        (s017241) [/usr/src] git clone 131.188.30.102:/scratch/tg/linux-2.6/\n        Initialized empty Git repository in /usr/src/linux-2.6/.git/\n        remote: Generating pack...\n        remote: Done counting 496189 objects.\n        remote: Deltifying 496189 objects...\n        remote:  100% (496189/496189) done\n        Indexing 496189 objects...\n        remote: Total 496189 (delta 401610), reused 496189 (delta 401610)\n        100% (496189/496189) done\n        Resolving 401610 deltas...\n        100% (401610/401610) donedone\n        fatal: Not a valid object name HEAD\n\nI see it. Last line. I tried to clone from a repository which itself had a\ndetached HEAD. Could that be the problem?\n\n        Thomas\n"},{"id":"44331","messageId":"7vk5uekagd.fsf@assigned-by-dhcp.cox.net","threadId":"8501","inReplyTo":"7vodjqkazp.fsf@assigned-by-dhcp.cox.net","subject":"Re: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-08T10:27:30Z","receivedAt":"2007-06-08T10:27:30Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Perhaps repository was set up in an unusual way by hand\n> (i.e. not by a clone), such that:\n>\n>  1. you have HEAD pointing at a branch (e.g. 'refs/heads/master'),\n>  2. which does _not_ exist yet (i.e. no 'refs/heads/master'),\n>  3. yet you have a tag that you can try to detach your HEAD to (e.g. v2.6.20).\n>\n> ... well that was my initial guess, but even after setting up such a\n> funny repository by hand, I cannot seem to reproduce it.\n\nActually, that turns out to be the reason for 'maint' releases,\nalthough it works on 'master' (hence will be in 1.5.3 later).\n\nHow did you get your repository into such a state to begin with?\n"},{"id":"44332","messageId":"7vfy52ka63.fsf@assigned-by-dhcp.cox.net","threadId":"8501","inReplyTo":"20070608102113.GB2335@cip.informatik.uni-erlangen.de","subject":"Re: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-06-08T10:33:40Z","receivedAt":"2007-06-08T10:33:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Glanzmann <thomas@glanzmann.de> writes:\n\n> I see it. Last line. I tried to clone from a repository which itself had a\n> detached HEAD. Could that be the problem?\n\nAh, our mails crossed.\n\nThere is no reason to forbid cloning of a repository whose HEAD\nis detached, but detached HEAD is a relatively recent invention,\nand I would not be surprised if that was indeed the breakage,\nnor nobody has hit this so far.\n\nIt's sufficiently late here so I do not think I would be able to\ntake a look at it tonight, though.  Sorry.\n\nJust in case you need unblocking (although I think you know how\nalready), you should be able to continue with:\n\n\t$ git rev-parse v2.6.20^0 >.git/HEAD\n        $ git read-tree HEAD\n        $ git checkout-index -f -q -u -a\n\nThat would give you a normal detached state at v2.6.20; you\nshould be able to come back to your branches with usual \"git\ncheckout\".\n"},{"id":"44333","messageId":"20070608103849.GC2335@cip.informatik.uni-erlangen.de","threadId":"8501","inReplyTo":"7vfy52ka63.fsf@assigned-by-dhcp.cox.net","subject":"Re: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.","fromName":"Thomas Glanzmann","fromEmail":"thomas@glanzmann.de","sentAt":"2007-06-08T10:38:49Z","receivedAt":"2007-06-08T10:38:49Z","isPatch":false,"sender":{"key":"thomas@glanzmann.de","avatar":null},"body":"Hello Junio,\nsleep well! And if you want to reproduce it yourself we can e-mail\ntomorrow or whenever you like.\n\nThanks,\n        Thomas\n"},{"id":"44569","messageId":"20070610085430.GA17255@prophet.net-ronin.org","threadId":"8501","inReplyTo":"7vk5uekagd.fsf@assigned-by-dhcp.cox.net","subject":"Re: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.","fromName":"carbonated beverage","fromEmail":"ramune@net-ronin.org","sentAt":"2007-06-10T08:54:30Z","receivedAt":"2007-06-10T08:54:30Z","isPatch":false,"sender":{"key":"ramune@net-ronin.org","avatar":null},"body":"On Fri, Jun 08, 2007 at 03:27:30AM -0700, Junio C Hamano wrote:\n> How did you get your repository into such a state to begin with?\n\nIt's kinda odd to see this thread, as I hit this issue today, as well.\n\nIf you need another test case, the cvsps git repo shows this too:\n\nramune/lycaeum:git: git clone  http://ydirson.free.fr/soft/git/cvsps.git\n<snip checkout messages>\nramune/lycaeum:git: cd cvsps\nramune/lycaeum:cvsps: ls\nramune/lycaeum:cvsps: git checkout -f\nwarning: You appear to be on a branch yet to be born.\nwarning: Forcing checkout of HEAD.\nfatal: just how do you expect me to merge 0 trees?\nramune/lycaeum:cvsps: cat .git/HEAD\nref: refs/heads/master\nramune/lycaeum:cvsps: ls .git/refs/head/master\nls: .git/refs/head/master: No such file or directory\n\n-- DN\nDaniel\n"}]}