git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git pull cannot find remote refs.
@ 2006-02-27 21:49 Stefan-W. Hahn
  2006-02-28  1:13 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan-W. Hahn @ 2006-02-27 21:49 UTC (permalink / raw)
  To: git

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

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

* Re: [PATCH] git pull cannot find remote refs.
  2006-02-27 21:49 [PATCH] git pull cannot find remote refs Stefan-W. Hahn
@ 2006-02-28  1:13 ` Junio C Hamano
  2006-02-28 16:19   ` Stefan-W. Hahn
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2006-02-28  1:13 UTC (permalink / raw)
  To: Stefan-W. Hahn; +Cc: git

"Stefan-W. Hahn" <stefan.hahn@s-hahn.de> writes:

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

Sorry.

I do not understand the above comment, nor the following code.

>  		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' |

ls-remote shows "SHA1\tPATH".  The original says "hexadecimal
followed by [either a single space or a single tab] followed by
a refpath", while yours says "hexadecimal followed by a single tab
followed by a refpath".  I do not see how that would make any
difference.  Puzzled...

I've seen two servers DNS round-robin and one of them fail to
respond.  The first "fetch" goes to the good one and the second
ls-remote goes to the bad one, then you would see "Oops, we
cannot peek tags".  But this patch does not have anything to do
with that problem..

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

* Re: [PATCH] git pull cannot find remote refs.
  2006-02-28  1:13 ` Junio C Hamano
@ 2006-02-28 16:19   ` Stefan-W. Hahn
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan-W. Hahn @ 2006-02-28 16:19 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Also sprach Junio C Hamano am Mon, 27 Feb 2006 at 17:13:22 -0800:

> ls-remote shows "SHA1\tPATH".  The original says "hexadecimal
> followed by [either a single space or a single tab] followed by

> difference.  Puzzled...

Grmph... You are right.

> I've seen two servers DNS round-robin and one of them fail to
> respond.  The first "fetch" goes to the good one and the second
> ls-remote goes to the bad one, then you would see "Oops, we
> cannot peek tags".  But this patch does not have anything to do
> with that problem..

Trapped. I haven't seen this, but perhaps it was the problem. 
I'll watching for the next occurence.


Sorry for the noise.

Stefan

-- 
Stefan-W. Hahn                          It is easy to make things.
/ mailto:stefan.hahn@s-hahn.de /        It is hard to make things simple.			

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

end of thread, other threads:[~2006-02-28 16:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-27 21:49 [PATCH] git pull cannot find remote refs Stefan-W. Hahn
2006-02-28  1:13 ` Junio C Hamano
2006-02-28 16:19   ` Stefan-W. Hahn

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