{"thread":{"id":"34839","subject":"Remote's 'currently active branch' not HEAD?","startedAt":"2013-09-03T10:46:52Z","lastAt":"2013-09-06T12:54:44Z","messageCount":8,"participants":["Andreas Krey","Michael Schubert","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"226609","messageId":"20130903104652.GA5813@inner.h.apk.li","threadId":"34839","inReplyTo":null,"subject":"Remote's 'currently active branch' not HEAD?","fromName":"Andreas Krey","fromEmail":"a.krey@gmx.de","sentAt":"2013-09-03T10:46:52Z","receivedAt":"2013-09-03T10:46:52Z","isPatch":false,"sender":{"key":"a.krey@gmx.de","avatar":"https://avatars.githubusercontent.com/u/37810?v=4"},"body":"Hi everyone,\n\nI have a strange behaviour from a bare repo I inherited;\nwhen I clone from that one (ssh) the branch checked out\nis *not* the one referenced in HEAD in the remote repo,\nbut apparently some variation of the alphabetically first\nor temporally last, or the last *new* branch pushed.\n\nWhere would I look to find the reason for this behaviour?\nHow does git transfer the 'current branch' info during the clone?\n\nThere is no 'master' branch in the original bare repo,\nbut HEAD points to a valid value (refs/heads/r1).\n\nTesting with another repo unfortunately doesn't show any\nconsistency, more like heisenbuggish.\n\nAndreas\n\n-- \n\"Totally trivial. Famous last words.\"\nFrom: Linus Torvalds <torvalds@*.org>\nDate: Fri, 22 Jan 2010 07:29:21 -0800\n"},{"id":"226611","messageId":"20130903114831.GA8559@inner.h.apk.li","threadId":"34839","inReplyTo":"20130903104652.GA5813@inner.h.apk.li","subject":"Re: Remote's 'currently active branch' not HEAD?","fromName":"Andreas Krey","fromEmail":"a.krey@gmx.de","sentAt":"2013-09-03T11:48:31Z","receivedAt":"2013-09-03T11:48:31Z","isPatch":false,"sender":{"key":"a.krey@gmx.de","avatar":"https://avatars.githubusercontent.com/u/37810?v=4"},"body":"On Tue, 03 Sep 2013 12:46:52 +0000, Andreas Krey wrote:\n...\n> I have a strange behaviour from a bare repo I inherited;\n> when I clone from that one (ssh) the branch checked out\n> is *not* the one referenced in HEAD in the remote repo,\n\nI now have a sample repo that reproduces this behaviour.\nUnpack tar file, clone, see clone having 'wrong' branch\nchecked out, apparently independent of the transport:\n\n  wget http://abox.h.apk.li/clot.tar\n  tar xvf clot.tar\n  (cd clot && git branch -a)  # Current branch is 'r1'\n  git clone clot c1\n  (cd c1 && git branch -a)    # Current branch is 'aa'?\n\nSame with git v1.7.1.x and v1.8.4.\n\nAndreas\n\n-- \n\"Totally trivial. Famous last words.\"\nFrom: Linus Torvalds <torvalds@*.org>\nDate: Fri, 22 Jan 2010 07:29:21 -0800\n"},{"id":"226617","messageId":"20130903123733.GR12966@inner.h.apk.li","threadId":"34839","inReplyTo":"20130903114831.GA8559@inner.h.apk.li","subject":"Re: Remote's 'currently active branch' not HEAD?","fromName":"Andreas Krey","fromEmail":"a.krey@gmx.de","sentAt":"2013-09-03T12:37:33Z","receivedAt":"2013-09-03T12:37:33Z","isPatch":false,"sender":{"key":"a.krey@gmx.de","avatar":"https://avatars.githubusercontent.com/u/37810?v=4"},"body":"On Tue, 03 Sep 2013 13:48:31 +0000, Andreas Krey wrote:\n...\n> I now have a sample repo that reproduces this behaviour.\n> Unpack tar file, clone, see clone having 'wrong' branch\n> checked out, apparently independent of the transport:\n\nOuch, it looks like 'git clone' doesn't actually know\nthe 'current remote branch' but picks one of those that\nhappen to have the HEAD *commit* as their tip.\n\nAt least the 'git clone' doc would be misleading then.\n\nAndreas\n\n-- \n\"Totally trivial. Famous last words.\"\nFrom: Linus Torvalds <torvalds@*.org>\nDate: Fri, 22 Jan 2010 07:29:21 -0800\n"},{"id":"226618","messageId":"20130903130250.GB20459@pc.elego.de","threadId":"34839","inReplyTo":"20130903123733.GR12966@inner.h.apk.li","subject":"Re: Remote's 'currently active branch' not HEAD?","fromName":"Michael Schubert","fromEmail":"mschub@elegosoft.com","sentAt":"2013-09-03T13:02:50Z","receivedAt":"2013-09-03T13:02:50Z","isPatch":false,"sender":{"key":"mschub@elegosoft.com","avatar":null},"body":"On Tue, Sep 03, 2013 at 02:37:33PM +0200, Andreas Krey wrote:\n> On Tue, 03 Sep 2013 13:48:31 +0000, Andreas Krey wrote:\n> ...\n> > I now have a sample repo that reproduces this behaviour.\n> > Unpack tar file, clone, see clone having 'wrong' branch\n> > checked out, apparently independent of the transport:\n> \n> Ouch, it looks like 'git clone' doesn't actually know\n> the 'current remote branch' but picks one of those that\n> happen to have the HEAD *commit* as their tip.\n\nYes, it picks the first of those:\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/168144\n\n> At least the 'git clone' doc would be misleading then.\n"},{"id":"226620","messageId":"20130903135034.GS12966@inner.h.apk.li","threadId":"34839","inReplyTo":"20130903130250.GB20459@pc.elego.de","subject":"Re: Remote's 'currently active branch' not HEAD?","fromName":"Andreas Krey","fromEmail":"a.krey@gmx.de","sentAt":"2013-09-03T13:50:34Z","receivedAt":"2013-09-03T13:50:34Z","isPatch":false,"sender":{"key":"a.krey@gmx.de","avatar":"https://avatars.githubusercontent.com/u/37810?v=4"},"body":"On Tue, 03 Sep 2013 15:02:50 +0000, Michael Schubert wrote:\n...\n> > happen to have the HEAD *commit* as their tip.\n> \n> Yes, it picks the first of those:\n> \n> http://thread.gmane.org/gmane.comp.version-control.git/168144\n\nThanks for the pointer.\n\nAnd pity, the patches didn't make it that time either...\n\nAndreas\n\n-- \n\"Totally trivial. Famous last words.\"\nFrom: Linus Torvalds <torvalds@*.org>\nDate: Fri, 22 Jan 2010 07:29:21 -0800\n"},{"id":"226625","messageId":"xmqqd2opvs18.fsf@gitster.dls.corp.google.com","threadId":"34839","inReplyTo":"20130903135034.GS12966@inner.h.apk.li","subject":"Re: Remote's 'currently active branch' not HEAD?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-09-03T15:33:39Z","receivedAt":"2013-09-03T15:33:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Krey <a.krey@gmx.de> writes:\n\n> On Tue, 03 Sep 2013 15:02:50 +0000, Michael Schubert wrote:\n> ...\n>> > happen to have the HEAD *commit* as their tip.\n>> \n>> Yes, it picks the first of those:\n>> \n>> http://thread.gmane.org/gmane.comp.version-control.git/168144\n>\n> Thanks for the pointer.\n>\n> And pity, the patches didn't make it that time either...\n\nAnd the key article in that discussion by Peff points to\nhttp://thread.gmane.org/gmane.comp.version-control.git/102039 with\n\"I had some complaints at the time, but re-reading it I don't see\nanything that would prevent us from revisiting the topic now.\"\nReading the patch series from 2008 again, I do agree with J6t's\ncomment that it should be just a regular capability, i.e. like what\nPeff suggests in his comment on [PATCH 5/6 (v2)], but other than\nthat, I do not see anything that would prevent us from revisiting\nthe topic now, either.\n"},{"id":"226930","messageId":"20130906114130.GB12966@inner.h.apk.li","threadId":"34839","inReplyTo":"xmqqd2opvs18.fsf@gitster.dls.corp.google.com","subject":"Re: Remote's 'currently active branch' not HEAD?","fromName":"Andreas Krey","fromEmail":"a.krey@gmx.de","sentAt":"2013-09-06T11:41:30Z","receivedAt":"2013-09-06T11:41:30Z","isPatch":false,"sender":{"key":"a.krey@gmx.de","avatar":"https://avatars.githubusercontent.com/u/37810?v=4"},"body":"On Tue, 03 Sep 2013 08:33:39 +0000, Junio C Hamano wrote:\n...\n> Reading the patch series from 2008 again, I do agree with J6t's\n> comment that it should be just a regular capability,\n\nI've implemented it as a 'sym=refs/heads/foo' capability.\nIt actually makes the patch series a lot shorter; the only\nthing I don't get running is the t5601-clone.sh test case.\n\nIf I run the exact same commands in a shell script they succeed,\nin t5601-clone.sh the clone step seems to fail, and I have no\nclue where to look for a clue.\n\nAny pointers?\n\nAndreas\n\n-- \n\"Totally trivial. Famous last words.\"\nFrom: Linus Torvalds <torvalds@*.org>\nDate: Fri, 22 Jan 2010 07:29:21 -0800\n"},{"id":"226935","messageId":"20130906125444.GD12966@inner.h.apk.li","threadId":"34839","inReplyTo":"20130906114130.GB12966@inner.h.apk.li","subject":"Re: Remote's 'currently active branch' not HEAD?","fromName":"Andreas Krey","fromEmail":"a.krey@gmx.de","sentAt":"2013-09-06T12:54:44Z","receivedAt":"2013-09-06T12:54:44Z","isPatch":false,"sender":{"key":"a.krey@gmx.de","avatar":"https://avatars.githubusercontent.com/u/37810?v=4"},"body":"On Fri, 06 Sep 2013 13:41:30 +0000, Andreas Krey wrote:\n...\n> If I run the exact same commands in a shell script they succeed,\n> in t5601-clone.sh the clone step seems to fail, and I have no\n> clue where to look for a clue.\n\nOh, never mind. --verbose shows that the test is borked;\nit tries a checkout into an already-existing dir. Patch\ncoming up soon.\n\nAndreas\n\n-- \n\"Totally trivial. Famous last words.\"\nFrom: Linus Torvalds <torvalds@*.org>\nDate: Fri, 22 Jan 2010 07:29:21 -0800\n"}]}