git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* remote's HEAD not detected correctly
@ 2011-02-28 20:52 Jeffrey Middleton
  2011-02-28 21:01 ` Shawn Pearce
  0 siblings, 1 reply; 4+ messages in thread
From: Jeffrey Middleton @ 2011-02-28 20:52 UTC (permalink / raw)
  To: git

There appears to be some weirdness here - git isn't properly looking
at the HEAD of the remote repository

#!/bin/bash

(mkdir project &&
cd project &&
git init -q &&
touch a &&
git add a &&
git commit -q -m "add a" &&
git checkout -q -b pu) &&
git clone -q project project.clone &&
(cd project.clone &&
echo -n "HEAD: " && git symbolic-ref HEAD &&
echo -n "origin/HEAD: " && git symbolic-ref refs/remotes/origin/HEAD &&
git remote show origin)


The output is:

HEAD: refs/heads/master
origin/HEAD: refs/remotes/origin/master
* remote origin
  Fetch URL: /home/jefromi/sandbox/project
  Push  URL: /home/jefromi/sandbox/project
  HEAD branch (remote HEAD is ambiguous, may be one of the following):
    master
    pu
8< more git remote output 8<

So somehow, the clone misses the fact that origin's HEAD is pu, not
master, and git remote is only partially aware of this. It looks like
this only happens when the two branches in question are pointing to
the same commit; perhaps git is trying to guess what HEAD is via the
SHA1? I know that ls-remote prints an SHA1, not a refname, for HEAD -
is it not actually possible to get that information through a general
transport protocol?


Jeffrey

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

end of thread, other threads:[~2011-02-28 23:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-28 20:52 remote's HEAD not detected correctly Jeffrey Middleton
2011-02-28 21:01 ` Shawn Pearce
2011-02-28 21:42   ` Jeff King
2011-02-28 23:10     ` Junio C Hamano

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