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

Re: remote's HEAD not detected correctly

From
Shawn Pearce <spearce@spearce.org>
Date
Feb 28, 2011, 21:01 UTC
Message-ID
<AANLkTimqTa24QSWACFX9GErt-Tn+wLda1s_AvH7dzEpm@mail.gmail.com>
In-Reply-To
<AANLkTimWieViK4JcJQuTDiRiAdyvHuwkwy8fL+XUV+i-@mail.gmail.com>
On Mon, Feb 28, 2011 at 12:52, Jeffrey Middleton <jefromi@gmail.com> wrote:
Show 8 quoted lines
>
> 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?

Right. The transport protocol doesn't expose the name that a symbolic reference points to, only its current value. Thus clients are forced to guess by looking for another reference whose current SHA-1 is the same. If there is more than one, its taking a best guess.

There have been a few attempts to expand the protocol and include the current symbolic reference target name, but thus far it hasn't gotten much beyond the idea stage.

-- 
Shawn.
Previous: Jeffrey MiddletonNext: Jeff King
Message 2 of 4 in “remote's HEAD not detected correctly”
  1. Jeffrey MiddletonFeb 28, 2011
  2. Shawn PearceFeb 28, 2011
  3. Jeff KingFeb 28, 2011
  4. Junio C HamanoFeb 28, 2011

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.