git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Remote's 'currently active branch' not HEAD?
@ 2013-09-03 10:46 Andreas Krey
  2013-09-03 11:48 ` Andreas Krey
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Krey @ 2013-09-03 10:46 UTC (permalink / raw)
  To: Git Mailing List

Hi everyone,

I have a strange behaviour from a bare repo I inherited;
when I clone from that one (ssh) the branch checked out
is *not* the one referenced in HEAD in the remote repo,
but apparently some variation of the alphabetically first
or temporally last, or the last *new* branch pushed.

Where would I look to find the reason for this behaviour?
How does git transfer the 'current branch' info during the clone?

There is no 'master' branch in the original bare repo,
but HEAD points to a valid value (refs/heads/r1).

Testing with another repo unfortunately doesn't show any
consistency, more like heisenbuggish.

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Remote's 'currently active branch' not HEAD?
  2013-09-03 10:46 Remote's 'currently active branch' not HEAD? Andreas Krey
@ 2013-09-03 11:48 ` Andreas Krey
  2013-09-03 12:37   ` Andreas Krey
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Krey @ 2013-09-03 11:48 UTC (permalink / raw)
  To: Git Mailing List

On Tue, 03 Sep 2013 12:46:52 +0000, Andreas Krey wrote:
...
> I have a strange behaviour from a bare repo I inherited;
> when I clone from that one (ssh) the branch checked out
> is *not* the one referenced in HEAD in the remote repo,

I now have a sample repo that reproduces this behaviour.
Unpack tar file, clone, see clone having 'wrong' branch
checked out, apparently independent of the transport:

  wget http://abox.h.apk.li/clot.tar
  tar xvf clot.tar
  (cd clot && git branch -a)  # Current branch is 'r1'
  git clone clot c1
  (cd c1 && git branch -a)    # Current branch is 'aa'?

Same with git v1.7.1.x and v1.8.4.

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Remote's 'currently active branch' not HEAD?
  2013-09-03 11:48 ` Andreas Krey
@ 2013-09-03 12:37   ` Andreas Krey
  2013-09-03 13:02     ` Michael Schubert
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Krey @ 2013-09-03 12:37 UTC (permalink / raw)
  To: Git Mailing List

On Tue, 03 Sep 2013 13:48:31 +0000, Andreas Krey wrote:
...
> I now have a sample repo that reproduces this behaviour.
> Unpack tar file, clone, see clone having 'wrong' branch
> checked out, apparently independent of the transport:

Ouch, it looks like 'git clone' doesn't actually know
the 'current remote branch' but picks one of those that
happen to have the HEAD *commit* as their tip.

At least the 'git clone' doc would be misleading then.

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Remote's 'currently active branch' not HEAD?
  2013-09-03 12:37   ` Andreas Krey
@ 2013-09-03 13:02     ` Michael Schubert
  2013-09-03 13:50       ` Andreas Krey
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Schubert @ 2013-09-03 13:02 UTC (permalink / raw)
  To: Andreas Krey; +Cc: Git Mailing List

On Tue, Sep 03, 2013 at 02:37:33PM +0200, Andreas Krey wrote:
> On Tue, 03 Sep 2013 13:48:31 +0000, Andreas Krey wrote:
> ...
> > I now have a sample repo that reproduces this behaviour.
> > Unpack tar file, clone, see clone having 'wrong' branch
> > checked out, apparently independent of the transport:
> 
> Ouch, it looks like 'git clone' doesn't actually know
> the 'current remote branch' but picks one of those that
> happen to have the HEAD *commit* as their tip.

Yes, it picks the first of those:

http://thread.gmane.org/gmane.comp.version-control.git/168144

> At least the 'git clone' doc would be misleading then.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Remote's 'currently active branch' not HEAD?
  2013-09-03 13:02     ` Michael Schubert
@ 2013-09-03 13:50       ` Andreas Krey
  2013-09-03 15:33         ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Krey @ 2013-09-03 13:50 UTC (permalink / raw)
  To: Michael Schubert; +Cc: Git Mailing List

On Tue, 03 Sep 2013 15:02:50 +0000, Michael Schubert wrote:
...
> > happen to have the HEAD *commit* as their tip.
> 
> Yes, it picks the first of those:
> 
> http://thread.gmane.org/gmane.comp.version-control.git/168144

Thanks for the pointer.

And pity, the patches didn't make it that time either...

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Remote's 'currently active branch' not HEAD?
  2013-09-03 13:50       ` Andreas Krey
@ 2013-09-03 15:33         ` Junio C Hamano
  2013-09-06 11:41           ` Andreas Krey
  0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2013-09-03 15:33 UTC (permalink / raw)
  To: Andreas Krey; +Cc: Michael Schubert, Git Mailing List

Andreas Krey <a.krey@gmx.de> writes:

> On Tue, 03 Sep 2013 15:02:50 +0000, Michael Schubert wrote:
> ...
>> > happen to have the HEAD *commit* as their tip.
>> 
>> Yes, it picks the first of those:
>> 
>> http://thread.gmane.org/gmane.comp.version-control.git/168144
>
> Thanks for the pointer.
>
> And pity, the patches didn't make it that time either...

And the key article in that discussion by Peff points to
http://thread.gmane.org/gmane.comp.version-control.git/102039 with
"I had some complaints at the time, but re-reading it I don't see
anything that would prevent us from revisiting the topic now."
Reading the patch series from 2008 again, I do agree with J6t's
comment that it should be just a regular capability, i.e. like what
Peff suggests in his comment on [PATCH 5/6 (v2)], but other than
that, I do not see anything that would prevent us from revisiting
the topic now, either.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Remote's 'currently active branch' not HEAD?
  2013-09-03 15:33         ` Junio C Hamano
@ 2013-09-06 11:41           ` Andreas Krey
  2013-09-06 12:54             ` Andreas Krey
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Krey @ 2013-09-06 11:41 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Michael Schubert, Git Mailing List

On Tue, 03 Sep 2013 08:33:39 +0000, Junio C Hamano wrote:
...
> Reading the patch series from 2008 again, I do agree with J6t's
> comment that it should be just a regular capability,

I've implemented it as a 'sym=refs/heads/foo' capability.
It actually makes the patch series a lot shorter; the only
thing I don't get running is the t5601-clone.sh test case.

If I run the exact same commands in a shell script they succeed,
in t5601-clone.sh the clone step seems to fail, and I have no
clue where to look for a clue.

Any pointers?

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Remote's 'currently active branch' not HEAD?
  2013-09-06 11:41           ` Andreas Krey
@ 2013-09-06 12:54             ` Andreas Krey
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Krey @ 2013-09-06 12:54 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Michael Schubert, Git Mailing List

On Fri, 06 Sep 2013 13:41:30 +0000, Andreas Krey wrote:
...
> If I run the exact same commands in a shell script they succeed,
> in t5601-clone.sh the clone step seems to fail, and I have no
> clue where to look for a clue.

Oh, never mind. --verbose shows that the test is borked;
it tries a checkout into an already-existing dir. Patch
coming up soon.

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-09-06 12:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-03 10:46 Remote's 'currently active branch' not HEAD? Andreas Krey
2013-09-03 11:48 ` Andreas Krey
2013-09-03 12:37   ` Andreas Krey
2013-09-03 13:02     ` Michael Schubert
2013-09-03 13:50       ` Andreas Krey
2013-09-03 15:33         ` Junio C Hamano
2013-09-06 11:41           ` Andreas Krey
2013-09-06 12:54             ` Andreas Krey

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).