git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problem fetching the git homepage
@ 2008-05-28 15:45 Gustaf Hendeby
  2008-05-28 16:39 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Gustaf Hendeby @ 2008-05-28 15:45 UTC (permalink / raw)
  To: Git Mailing List

I'm trying to fetch the repo of the git homepage but get this error:

$ git version
git version 1.5.6.rc0.140.ga9675
$ git fetch origin
Getting alternates list for http://repo.or.cz/r/git-homepage.git
Getting pack list for http://repo.or.cz/r/git-homepage.git
Getting index for pack d4404a860edd30b154e8cd5b8c66ec35cf682dae
Getting pack d4404a860edd30b154e8cd5b8c66ec35cf682dae
  which contains 50819d376acb03429ab2628ef3d07893c7f0e22c
error: packfile 
.git/objects/pack/pack-d4404a860edd30b154e8cd5b8c66ec35cf682dae.pack 
size changed
fatal: packfile 
.git/objects/pack/pack-d4404a860edd30b154e8cd5b8c66ec35cf682dae.pack 
cannot be accessed

The last commit I have is "Automated update: [2008-04-20] v1.5.5 -> 
v1.5.5.1" (2b7e2d6a).

Is this due to something I've done?  (Not even sure from the error 
message if it is a local error, or a remote error.) Or a sign of 
something more serious?

/Gustaf

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

* Re: Problem fetching the git homepage
  2008-05-28 15:45 Problem fetching the git homepage Gustaf Hendeby
@ 2008-05-28 16:39 ` Junio C Hamano
  2008-05-28 16:47   ` [PATCH] fix sha1_pack_index_name() Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2008-05-28 16:39 UTC (permalink / raw)
  To: Gustaf Hendeby; +Cc: Git Mailing List

Gustaf Hendeby <hendeby@isy.liu.se> writes:

> I'm trying to fetch the repo of the git homepage but get this error:
>
> $ git version
> git version 1.5.6.rc0.140.ga9675
> $ git fetch origin
> Getting alternates list for http://repo.or.cz/r/git-homepage.git
> Getting pack list for http://repo.or.cz/r/git-homepage.git
> Getting index for pack d4404a860edd30b154e8cd5b8c66ec35cf682dae
> Getting pack d4404a860edd30b154e8cd5b8c66ec35cf682dae
>  which contains 50819d376acb03429ab2628ef3d07893c7f0e22c
> error: packfile
> .git/objects/pack/pack-d4404a860edd30b154e8cd5b8c66ec35cf682dae.pack
> size changed
> fatal: packfile
> .git/objects/pack/pack-d4404a860edd30b154e8cd5b8c66ec35cf682dae.pack
> cannot be accessed
>
> The last commit I have is "Automated update: [2008-04-20] v1.5.5 ->
> v1.5.5.1" (2b7e2d6a).
>
> Is this due to something I've done?  (Not even sure from the error
> message if it is a local error, or a remote error.) Or a sign of
> something more serious?

Thanks for reporting.  This is a breakage in 633f43e (Remove redundant
code, eliminate one static variable, 2008-05-24).

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

* [PATCH] fix sha1_pack_index_name()
  2008-05-28 16:39 ` Junio C Hamano
@ 2008-05-28 16:47   ` Junio C Hamano
  2008-05-28 16:59     ` Gustaf Hendeby
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2008-05-28 16:47 UTC (permalink / raw)
  To: Heikki Orsila; +Cc: Gustaf Hendeby, Git Mailing List

An earlier commit 633f43e (Remove redundant code, eliminate one static
variable, 2008-05-24) had a thinko (perhaps an eyeno) that broke
sha1_pack_index_name() function.  One symptom of this was that the http
walker is now completely broken.

This should fix it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 sha1_file.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/sha1_file.c b/sha1_file.c
index 9679040..adcf37c 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -177,7 +177,7 @@ char *sha1_file_name(const unsigned char *sha1)
 }
 
 static char *sha1_get_pack_name(const unsigned char *sha1,
-				char **name, char **base)
+				char **name, char **base, const char *which)
 {
 	static const char hex[] = "0123456789abcdef";
 	char *buf;
@@ -187,7 +187,8 @@ static char *sha1_get_pack_name(const unsigned char *sha1,
 		const char *sha1_file_directory = get_object_directory();
 		int len = strlen(sha1_file_directory);
 		*base = xmalloc(len + 60);
-		sprintf(*base, "%s/pack/pack-1234567890123456789012345678901234567890.pack", sha1_file_directory);
+		sprintf(*base, "%s/pack/pack-1234567890123456789012345678901234567890.%s",
+			sha1_file_directory, which);
 		*name = *base + len + 11;
 	}
 
@@ -206,14 +207,14 @@ char *sha1_pack_name(const unsigned char *sha1)
 {
 	static char *name, *base;
 
-	return sha1_get_pack_name(sha1, &name, &base);
+	return sha1_get_pack_name(sha1, &name, &base, "pack");
 }
 
 char *sha1_pack_index_name(const unsigned char *sha1)
 {
 	static char *name, *base;
 
-	return sha1_get_pack_name(sha1, &name, &base);
+	return sha1_get_pack_name(sha1, &name, &base, "idx");
 }
 
 struct alternate_object_database *alt_odb_list;

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

* Re: [PATCH] fix sha1_pack_index_name()
  2008-05-28 16:47   ` [PATCH] fix sha1_pack_index_name() Junio C Hamano
@ 2008-05-28 16:59     ` Gustaf Hendeby
  0 siblings, 0 replies; 4+ messages in thread
From: Gustaf Hendeby @ 2008-05-28 16:59 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Heikki Orsila, Git Mailing List

On 05/28/2008 06:47 PM, Junio C Hamano wrote:
> An earlier commit 633f43e (Remove redundant code, eliminate one static
> variable, 2008-05-24) had a thinko (perhaps an eyeno) that broke
> sha1_pack_index_name() function.  One symptom of this was that the http
> walker is now completely broken.
> 
> This should fix it.
> 
> Signed-off-by: Junio C Hamano <gitster@pobox.com>

This did - applied on top of next - not fix my problem but changed the 
error message somewhat:

$ git version
git version 1.5.6.rc0.141.g55e0e
$ git fetch origin
Getting alternates list for http://repo.or.cz/r/git-homepage.git
Getting pack list for http://repo.or.cz/r/git-homepage.git
error: Unable to find 50819d376acb03429ab2628ef3d07893c7f0e22c under 
http://repo.or.cz/r/git-homepage.git
Cannot obtain needed object 50819d376acb03429ab2628ef3d07893c7f0e22c
fatal: Fetch failed.

/Gustaf

> ---
>  sha1_file.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/sha1_file.c b/sha1_file.c
> index 9679040..adcf37c 100644
> --- a/sha1_file.c
> +++ b/sha1_file.c
> @@ -177,7 +177,7 @@ char *sha1_file_name(const unsigned char *sha1)
>  }
>  
>  static char *sha1_get_pack_name(const unsigned char *sha1,
> -				char **name, char **base)
> +				char **name, char **base, const char *which)
>  {
>  	static const char hex[] = "0123456789abcdef";
>  	char *buf;
> @@ -187,7 +187,8 @@ static char *sha1_get_pack_name(const unsigned char *sha1,
>  		const char *sha1_file_directory = get_object_directory();
>  		int len = strlen(sha1_file_directory);
>  		*base = xmalloc(len + 60);
> -		sprintf(*base, "%s/pack/pack-1234567890123456789012345678901234567890.pack", sha1_file_directory);
> +		sprintf(*base, "%s/pack/pack-1234567890123456789012345678901234567890.%s",
> +			sha1_file_directory, which);
>  		*name = *base + len + 11;
>  	}
>  
> @@ -206,14 +207,14 @@ char *sha1_pack_name(const unsigned char *sha1)
>  {
>  	static char *name, *base;
>  
> -	return sha1_get_pack_name(sha1, &name, &base);
> +	return sha1_get_pack_name(sha1, &name, &base, "pack");
>  }
>  
>  char *sha1_pack_index_name(const unsigned char *sha1)
>  {
>  	static char *name, *base;
>  
> -	return sha1_get_pack_name(sha1, &name, &base);
> +	return sha1_get_pack_name(sha1, &name, &base, "idx");
>  }
>  
>  struct alternate_object_database *alt_odb_list;

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

end of thread, other threads:[~2008-05-28 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-28 15:45 Problem fetching the git homepage Gustaf Hendeby
2008-05-28 16:39 ` Junio C Hamano
2008-05-28 16:47   ` [PATCH] fix sha1_pack_index_name() Junio C Hamano
2008-05-28 16:59     ` Gustaf Hendeby

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