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

Re: Issue 323 in msysgit: Can't clone over http

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Sep 4, 2009, 13:29 UTC
Message-ID
<20090904212956.f02b0c60.rctay89@gmail.com>
In-Reply-To
<7viqfzvwf1.fsf@alter.siamese.dyndns.org>
Hi,
On Fri, Sep 4, 2009 at 6:25 PM, Junio C Hamano<gitster@pobox.com> wrote:
Show 7 quoted lines
> codesite-noreply@google.com writes:
>
>> Status: New
>> Owner: ----
>>
>> New issue 323 by bjelli: Can't clone over http
>> http://code.google.com/p/msysgit/issues/detail?id=323
Junio, thanks for bringing this issue to the list's and my attention.
> This does not seem to be an msysgit issue.  Even on a Linux host, v1.6.2.5
> seems to work Ok but 'maint', 'master', nor 'next' does not clone this one
> correctly.
Releases including and after v1.6.4 will have this issue:
>> error: Unable to verify pack 382c25c935b744e909c749532578112d72a4aff9 is
>> available
>> error: Unable to find 0a41ac04d56ccc96491989dc71d9875cd804fc6b under
>> http://github.com/tekkub/addontemplate.git

The issue at hand is due to git checking the http repository for the pack file before commencing the transfer; failing which, the transfer aborts.

Right now, git chokes on the 500 error that github.com gives it, which shouldn't be the case, even though that's a weird response.

-- Cheers, Ray Chuan

-- >8 --
Subject: [PATCH] http.c: clarify missing-pack-check

Abort the pack transfer only if the pack is not available in the HTTP- served repository; otherwise, allow the transfer to continue, even if the check failed.

This addresses an issue raised by bjelli:
  http://code.google.com/p/msysgit/issues/detail?id=323
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 http.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/http.c b/http.c
index 5926c5b..cba7e9a 100644
--- a/http.c
+++ b/http.c
@@ -864,6 +864,7 @@ int http_fetch_ref(const char *base, struct ref *ref)
 static int fetch_pack_index(unsigned char *sha1, const char *base_url)
 {
 	int ret = 0;
+	int result;
 	char *hex = xstrdup(sha1_to_hex(sha1));
 	char *filename;
 	char *url;
@@ -874,11 +875,14 @@ static int fetch_pack_index(unsigned char *sha1, const char *base_url)
 	strbuf_addf(&buf, "objects/pack/pack-%s.pack", hex);
 	url = strbuf_detach(&buf, 0);

-	if (http_get_strbuf(url, NULL, 0)) {
-		ret = error("Unable to verify pack %s is available",
+	result = http_get_strbuf(url, NULL, 0);
+	if (result == HTTP_MISSING_TARGET) {
+		ret = error("Unable to find pack %s",
 			    hex);
 		goto cleanup;
-	}
+	} else if (result && http_is_verbose)
+		fprintf(stderr, "Unable to verify pack %s is available\n",
+			hex);

 	if (has_pack_index(sha1)) {
 		ret = 0;
--
1.6.4.2
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 16 in “Re: Issue 323 in msysgit: Can't clone over http”
  1. Junio C HamanoSep 4, 2009
  2. Tay Ray ChuanSep 4, 2009
  3. Junio C HamanoSep 7, 2009
  4. Tay Ray ChuanSep 7, 2009
  5. Junio C HamanoSep 7, 2009
  6. Junio C HamanoSep 7, 2009
  7. Tay Ray ChuanSep 7, 2009
  8. Junio C HamanoSep 7, 2009
  9. Jakub NarebskiSep 8, 2009
  10. Tay Ray ChuanSep 8, 2009
  11. Tay Ray ChuanSep 8, 2009
  12. Tay Ray ChuanSep 9, 2009
  13. Junio C HamanoSep 9, 2009
  14. Junio C HamanoSep 11, 2009
  15. Tay Ray ChuanSep 12, 2009
  16. Junio C HamanoSep 12, 2009

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.