Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] gitweb.perl - Optionally send archives as .zip files

From: Petr Baudis <hidden>
Date: 2016-06-15 22:43:12

 Hi,

On Sun, May 20, 2007 at 05:46:46PM CEST, Mark Levedahl wrote:
git-archive already knows how to generate an archive as a tar or a zip
file, but gitweb did not. zip archvies are much more usable in a Windows
environment due to native support and this patch allows a site admin the
option to deliver zip rather than tar files. The selection is done by
inserting

$feature{'snapshot'}{'default'} = ['x-zip', 'zip', ''];

in gitweb_config.perl.

Tar files remain the default option.

Signed-off-by: Mark Levedahl <redacted>
Acked-by: Petr Baudis <redacted>

Maybe the code should decide based on program value being 'zip' rather
than suffix value, but that's just dubious nit-picking.
quoted hunk ↗ jump to hunk
@@ -3912,19 +3914,26 @@ sub git_snapshot {
 		$hash = git_get_head_hash($project);
 	}

-	my $filename = decode_utf8(basename($project)) . "-$hash.tar.$suffix";
+	my $git = git_cmd_str();
+	my $name = $project;
+	$name =~ s/\047/\047\\\047\047/g;
By the way, this really looks like an entry to our very own would-be
"git obfuscation of the month" contest. Why did whoever made the code
not just write that ' there?  (I know it's been in the original code
too.)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Ever try. Ever fail. No matter. // Try again. Fail again. Fail better.
		-- Samuel Beckett
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help