{"thread":{"id":"3483","subject":"[PATCH] git pull cannot find remote refs.","startedAt":"2006-02-27T21:49:37Z","lastAt":"2006-02-28T16:19:29Z","messageCount":3,"participants":["Stefan-W. Hahn","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"16855","messageId":"20060227214936.GA7205@scotty.home","threadId":"3483","inReplyTo":null,"subject":"[PATCH] git pull cannot find remote refs.","fromName":"Stefan-W. Hahn","fromEmail":"stefan.hahn@s-hahn.de","sentAt":"2006-02-27T21:49:37Z","receivedAt":"2006-02-27T21:49:37Z","isPatch":true,"sender":{"key":"stefan.hahn@s-hahn.de","avatar":null},"body":"[PATCH] git pull cannot find remote refs.\n\nWhen getting new data from an archive with 'git pull' I sometimes got the\nmessage\n\nfatal: unexpected EOF\nFailed to find remote refs\nAlready up-to-date.\n\nTracking it down, I found a gap between how git-ls-remote prints out the tags\nand git-fetch scans them with sed. Looking at the code of git-ls-remote the\nthere is an tab character between the sha1 and the refname, while there is a\nspace and a tab character in the regular expression for th sed command.\n\nAs a result the while where all is piped in cannot read the two values.\n\nSigned-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de>\n\n---\n\nI'm not sure if the solution is the best, because info sed say '\\t' is not portable,\nso perhaps it will be better to correct it another way?\n\nComments?\n\n git-fetch.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\n92905634295ea29a59c773c634197cc029839883\ndiff --git a/git-fetch.sh b/git-fetch.sh\nindex 0346d4a..c7b38b2 100755\n--- a/git-fetch.sh\n+++ b/git-fetch.sh\n@@ -375,7 +375,7 @@ case \"$no_tags$tags\" in\n \t\t# using local tracking branch.\n \t\ttaglist=$(IFS=\" \" &&\n \t\tgit-ls-remote $upload_pack --tags \"$remote\" |\n-\t\tsed -ne 's|^\\([0-9a-f]*\\)[ \t]\\(refs/tags/.*\\)^{}$|\\1 \\2|p' |\n+\t\tsed -ne 's|^\\([0-9a-f]*\\)[\\t]\\(refs/tags/.*\\)^{}$|\\1 \\2|p' |\n \t\twhile read sha1 name\n \t\tdo\n \t\t\ttest -f \"$GIT_DIR/$name\" && continue\n-- \n1.2.3.gc55f\n\n\n-- \nStefan-W. Hahn                          It is easy to make things.\n/ mailto:stefan.hahn@s-hahn.de /        It is hard to make things simple.\t\t\t\n"},{"id":"16872","messageId":"7vlkvwuvyl.fsf@assigned-by-dhcp.cox.net","threadId":"3483","inReplyTo":"20060227214936.GA7205@scotty.home","subject":"Re: [PATCH] git pull cannot find remote refs.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-02-28T01:13:22Z","receivedAt":"2006-02-28T01:13:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Stefan-W. Hahn\" <stefan.hahn@s-hahn.de> writes:\n\n> Tracking it down, I found a gap between how git-ls-remote prints out the tags\n> and git-fetch scans them with sed. Looking at the code of git-ls-remote the\n> there is an tab character between the sha1 and the refname, while there is a\n> space and a tab character in the regular expression for th sed command.\n>\n> As a result the while where all is piped in cannot read the two values.\n\nSorry.\n\nI do not understand the above comment, nor the following code.\n\n>  \t\tgit-ls-remote $upload_pack --tags \"$remote\" |\n> -\t\tsed -ne 's|^\\([0-9a-f]*\\)[ \t]\\(refs/tags/.*\\)^{}$|\\1 \\2|p' |\n> +\t\tsed -ne 's|^\\([0-9a-f]*\\)[\\t]\\(refs/tags/.*\\)^{}$|\\1 \\2|p' |\n\nls-remote shows \"SHA1\\tPATH\".  The original says \"hexadecimal\nfollowed by [either a single space or a single tab] followed by\na refpath\", while yours says \"hexadecimal followed by a single tab\nfollowed by a refpath\".  I do not see how that would make any\ndifference.  Puzzled...\n\nI've seen two servers DNS round-robin and one of them fail to\nrespond.  The first \"fetch\" goes to the good one and the second\nls-remote goes to the bad one, then you would see \"Oops, we\ncannot peek tags\".  But this patch does not have anything to do\nwith that problem..\n"},{"id":"16911","messageId":"20060228161928.GA4829@scotty.home","threadId":"3483","inReplyTo":"7vlkvwuvyl.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git pull cannot find remote refs.","fromName":"Stefan-W. Hahn","fromEmail":"stefan.hahn@s-hahn.de","sentAt":"2006-02-28T16:19:29Z","receivedAt":"2006-02-28T16:19:29Z","isPatch":true,"sender":{"key":"stefan.hahn@s-hahn.de","avatar":null},"body":"Also sprach Junio C Hamano am Mon, 27 Feb 2006 at 17:13:22 -0800:\n\n> ls-remote shows \"SHA1\\tPATH\".  The original says \"hexadecimal\n> followed by [either a single space or a single tab] followed by\n\n> difference.  Puzzled...\n\nGrmph... You are right.\n\n> I've seen two servers DNS round-robin and one of them fail to\n> respond.  The first \"fetch\" goes to the good one and the second\n> ls-remote goes to the bad one, then you would see \"Oops, we\n> cannot peek tags\".  But this patch does not have anything to do\n> with that problem..\n\nTrapped. I haven't seen this, but perhaps it was the problem. \nI'll watching for the next occurence.\n\n\nSorry for the noise.\n\nStefan\n\n-- \nStefan-W. Hahn                          It is easy to make things.\n/ mailto:stefan.hahn@s-hahn.de /        It is hard to make things simple.\t\t\t\n"}]}