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

Symbolic refs break ref advertisement on 1.8.4.3+

From
Bryan Turner <bturner@atlassian.com>
Date
Nov 16, 2013, 14:39 UTC
Message-ID
<CAGyf7-EX2QXKyAwoxv2Ux5cjSp71m-dR+Vq4C3pevJrYaGu42g@mail.gmail.com>

According to a git bisect between the v1.8.4 and v1.8.4.3 tags, it appears the changes in 5e7dcad, "upload-pack: send non-HEAD symbolic refs", cause the ref advertisement to fail of the repository has more than a handful of symbolic refs. Here's a simple reproduce case (tested on Bash):

Aphrael:example bturner$ git version
git version 1.8.4.3
Aphrael:symbolic-refs bturner$ git init example
Initialized empty Git repository in /Users/bturner/example/.git/
Aphrael:symbolic-refs bturner$ cd example
Aphrael:example bturner$ echo "Testing..." > file.txt
Aphrael:example bturner$ git add file.txt
Aphrael:example bturner$ git commit -m "Initial commit"
[master (root-commit) b4c4b2a] Initial commit
 1 file changed, 1 insertion(+)
 create mode 100644 file.txt
Aphrael:example bturner$ for ((i=1;i<21;i++)); do git symbolic-ref
refs/heads/syms/$i refs/heads/master; done
Aphrael:example bturner$ git ls-remote .
fatal: protocol error: impossibly long line
fatal: Could not read from remote repository.

A symref= entry is written into the first packet of the ref advertisement, right after the capabilities, for each symbolic ref in the repository. Unfortunately, no splitting is done on that value and so once you have 15-20 symbolic refs (more or less depending on path lengths), you blow the 996 byte limit in format_packet (pkt-line.c) and all further clone/fetch operations fail.

I've verified this same issue exists in all 1.8.5 RCs.

Best regards, Bryan Turner

Next: Jeff King
Message 1 of 3 in “Symbolic refs break ref advertisement on 1.8.4.3+”
  1. Bryan TurnerNov 16, 2013
  2. Jeff KingNov 17, 2013
  3. Junio C HamanoNov 18, 2013

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.