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

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

From
Petr Baudis <pasky@suse.cz>
Date
May 22, 2007, 12:28 UTC
Message-ID
<20070522122828.GJ4489@pasky.or.cz>
In-Reply-To
<11796760064103-git-send-email-mdl123@verizon.net>
 Hi,
On Sun, May 20, 2007 at 05:46:46PM CEST, Mark Levedahl wrote:
Show 13 quoted lines
> 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 <mdl123@verizon.net>
Acked-by: Petr Baudis <pasky@suse.cz>

Maybe the code should decide based on program value being 'zip' rather than suffix value, but that's just dubious nit-picking.

Show 8 quoted lines
> @@ -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
Previous: Mark LevedahlNext: Junio C Hamano
Message 2 of 3 in “gitweb.perl - Optionally send archives as .zip files”
  1. gitweb.perl - Optionally send archives as .zip filesMark Levedahl, May 20, 2007
  2. Petr BaudisMay 22, 2007
  3. Junio C HamanoMay 23, 2007

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.