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

[PATCH] git pull cannot find remote refs.

From
SHStefan-W. Hahn <stefan.hahn@s-hahn.de>
Date
Feb 27, 2006, 21:49 UTC
Message-ID
<20060227214936.GA7205@scotty.home>
[PATCH] git pull cannot find remote refs.

When getting new data from an archive with 'git pull' I sometimes got the message

fatal: unexpected EOF Failed to find remote refs Already up-to-date.

Tracking it down, I found a gap between how git-ls-remote prints out the tags and git-fetch scans them with sed. Looking at the code of git-ls-remote the there is an tab character between the sha1 and the refname, while there is a space and a tab character in the regular expression for th sed command.

As a result the while where all is piped in cannot read the two values.
Signed-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de>
---

I'm not sure if the solution is the best, because info sed say '\t' is not portable, so perhaps it will be better to correct it another way?

Comments?
 git-fetch.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
92905634295ea29a59c773c634197cc029839883
diff --git a/git-fetch.sh b/git-fetch.sh
index 0346d4a..c7b38b2 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -375,7 +375,7 @@ case "$no_tags$tags" in
 		# using local tracking branch.
 		taglist=$(IFS=" " &&
 		git-ls-remote $upload_pack --tags "$remote" |
-		sed -ne 's|^\([0-9a-f]*\)[ 	]\(refs/tags/.*\)^{}$|\1 \2|p' |
+		sed -ne 's|^\([0-9a-f]*\)[\t]\(refs/tags/.*\)^{}$|\1 \2|p' |
 		while read sha1 name
 		do
 			test -f "$GIT_DIR/$name" && continue
-- 
1.2.3.gc55f


-- 
Stefan-W. Hahn                          It is easy to make things.
/ mailto:stefan.hahn@s-hahn.de /        It is hard to make things simple.			
Next: Junio C Hamano
Message 1 of 3 in “git pull cannot find remote refs.”
  1. git pull cannot find remote refs.Stefan-W. Hahn, Feb 27, 2006
  2. Junio C HamanoFeb 28, 2006
  3. Stefan-W. HahnFeb 28, 2006

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.