# rc3 gitweb is broken, won't deliver snapshots

5 messages from 2007-07-25 to 2007-07-26. Participants: Mark Levedahl, Jakub Narebski, Junio C Hamano.
Thread: https://gitlist.dev/t/9219

## Mark Levedahl, 2007-07-25 13:27

Subject: rc3 gitweb is broken, won't deliver snapshots
Message-ID: <30e4a070707250627l29ce4794x97d03b8232352cae@mail.gmail.com>
URL: https://gitlist.dev/e/30e4a070707250627l29ce4794x97d03b8232352cae%40mail.gmail.com

```
gitweb in 1.5.3-rc3 fails to deliver snapshots in any useable format
(bzip2, gz, or zip). Clicking on a link seems to work, but the
delivered file as stored on my system is empty. No error messages
appear anywhere I can find. I am hosting gitweb on FC7 using lighttpd,
if that matters.

The snapshot service at git.kernel.org also seems broken, I don't know
what gitweb is running there so don't know if the issue is related.

I have fixed this for my use by reverting the following commits

3473e7df5f8c7f8dc3e2c3f2fdc99a1d1a719c16 gitweb: More detailed error
messages for snapshot format
a781785d8f1eb7adf05a24b121104716a086a67a gitweb: Fix support for
legacy gitweb config for snapshots
a3c8ab30a54c30a6a434760bedf04548425416ef gitweb: snapshot cleanups &
support for offering multiple formats

The snapshot problem first appears when a3c8ab30a54 is applied.

Mark Levedahl

```

## Jakub Narebski, 2007-07-25 22:17

Subject: [PATCH] gitweb: Fix error in generating snapshot
Message-ID: <11854018464134-git-send-email-jnareb@gmail.com>
URL: https://gitlist.dev/e/11854018464134-git-send-email-jnareb%40gmail.com
In-Reply-To: <30e4a070707250627l29ce4794x97d03b8232352cae@mail.gmail.com>

```
There was an error while generating cmmandline to run git-archive:
there were no whitespace between two options.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
 gitweb/gitweb.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 0acd0ca..b381692 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4343,7 +4343,7 @@ sub git_snapshot {
 	my $cmd;
 	$filename .= "-$hash$known_snapshot_formats{$format}{'suffix'}";
 	$cmd = "$git_command archive " .
-		"--format=$known_snapshot_formats{$format}{'format'}" .
+		"--format=$known_snapshot_formats{$format}{'format'} " .
 		"--prefix=\'$name\'/ $hash";
 	if (exists $known_snapshot_formats{$format}{'compressor'}) {
 		$cmd .= ' | ' . join ' ', @{$known_snapshot_formats{$format}{'compressor'}};
-- 
1.5.2.4

```

## Junio C Hamano, 2007-07-25 22:47

Subject: Re: [PATCH] gitweb: Fix error in generating snapshot
Message-ID: <7vwswocd8d.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vwswocd8d.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <11854018464134-git-send-email-jnareb@gmail.com>

```
Heh, I was working on that and had the identical fix committed
;-).

Thanks.

```

## Junio C Hamano, 2007-07-25 22:48

Subject: Re: rc3 gitweb is broken, won't deliver snapshots
Message-ID: <7vsl7ccd6o.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vsl7ccd6o.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <30e4a070707250627l29ce4794x97d03b8232352cae@mail.gmail.com>

```
"Mark Levedahl" <mlevedahl@gmail.com> writes:

> gitweb in 1.5.3-rc3 fails to deliver snapshots in any useable format
> (bzip2, gz, or zip). Clicking on a link seems to work, but the
> delivered file as stored on my system is empty. No error messages
> appear anywhere I can find. I am hosting gitweb on FC7 using lighttpd,
> if that matters.
>
> The snapshot service at git.kernel.org also seems broken, I don't know
> what gitweb is running there so don't know if the issue is related.
>
> I have fixed this for my use by reverting the following commits
>
> 3473e7df5f8c7f8dc3e2c3f2fdc99a1d1a719c16 gitweb: More detailed error
> messages for snapshot format
> a781785d8f1eb7adf05a24b121104716a086a67a gitweb: Fix support for
> legacy gitweb config for snapshots
> a3c8ab30a54c30a6a434760bedf04548425416ef gitweb: snapshot cleanups &
> support for offering multiple formats
>
> The snapshot problem first appears when a3c8ab30a54 is applied.

True.  I wonder if people who submitted patches even tested
these things... Sigh.

---

 gitweb/gitweb.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 0acd0ca..b381692 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4343,7 +4343,7 @@ sub git_snapshot {
 	my $cmd;
 	$filename .= "-$hash$known_snapshot_formats{$format}{'suffix'}";
 	$cmd = "$git_command archive " .
-		"--format=$known_snapshot_formats{$format}{'format'}" .
+		"--format=$known_snapshot_formats{$format}{'format'} " .
 		"--prefix=\'$name\'/ $hash";
 	if (exists $known_snapshot_formats{$format}{'compressor'}) {
 		$cmd .= ' | ' . join ' ', @{$known_snapshot_formats{$format}{'compressor'}};

```

## Jakub Narebski, 2007-07-26 09:17

Subject: Re: [PATCH] gitweb: Fix error in generating snapshot
Message-ID: <f89os3$arg$1@sea.gmane.org>
URL: https://gitlist.dev/e/f89os3%24arg%241%40sea.gmane.org
In-Reply-To: <11854018464134-git-send-email-jnareb@gmail.com>

```
Jakub Narebski wrote:

> There was an error while generating cmmandline to run git-archive:
> there were no whitespace between two options.
> 
> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Noticed-by: Mark Levedahl <mlevedahl@gmail.com>

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```
