From: Toby White <tow21@cam.ac.uk>
To: Toby White <tow21@cam.ac.uk>
Cc: git@vger.kernel.org
Subject: Re: gitweb / cg-export - corrected patch
Date: Wed, 16 Aug 2006 01:23:41 +0100 [thread overview]
Message-ID: <44E2658D.9020600@cam.ac.uk> (raw)
In-Reply-To: <44E263DD.6030305@cam.ac.uk>
Argh - sorry, patch got mangled somehow in previous message.
Correct patch below.
Toby
--- gitweb.cgi.orig 2006-08-16 01:00:03.000000000 +0100
+++ gitweb.cgi 2006-08-16 00:58:38.000000000 +0100
@@ -180,6 +180,9 @@
} elsif ($action eq "tree") {
git_tree();
exit;
+} elsif ($action eq "export") {
+ git_export();
+ exit;
} elsif ($action eq "rss") {
git_rss();
exit;
@@ -1523,6 +1526,21 @@
git_footer_html();
}
+sub git_export {
+ if (!defined $hash) {
+ $hash = git_read_head($project);
+ if (defined $file_name) {
+ my $base = $hash_base || $hash;
+ $hash = git_get_hash_by_path($base, $file_name, "tree");
+ }
+ if (!defined $hash_base) {
+ $hash_base = $hash;
+ }
+ }
+ print $cgi->header(-type=>'application/x-tar', -Content-Encoding=>'x-gzip', -status=> '200 OK');
+ exec "$gitbin/git-tar-tree $hash $project | gzip -c9" or die_error(undef, "Execute git-tar-tree failed.");
+}
+
sub git_rss {
# http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ
open my $fd, "-|", "$gitbin/git-rev-list --max-count=150 " . git_read_head($project) or die_error(undef, "Open failed.");
@@ -1779,6 +1797,7 @@
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$co{'tree'};hb=$hash"), class => "list"}, $co{'tree'})
.
"</td>" .
"<td class=\"link\">" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$co{'tree'};hb=$hash")}, "tree"
) .
+ "|" . $cgi->a({-href => "$my_uri/$project.tar.gz?" . esc_param("p=$project;a=export;h=$co{'tree'};hb=$hash")}, "tar.
gz") .
"</td>" .
"</tr>\n";
my $parents = $co{'parents'};
next prev parent reply other threads:[~2006-08-16 0:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-16 0:16 gitweb / cg-export Toby White
2006-08-16 0:23 ` Toby White [this message]
2006-08-16 9:54 ` Jakub Narebski
2006-08-16 10:53 ` Aneesh Kumar K.V
2006-08-16 11:32 ` Aneesh Kumar K.V
2006-08-16 20:05 ` Fredrik Kuivinen
2006-08-16 18:01 ` Junio C Hamano
2006-08-17 6:29 ` gitweb: Support for snapshots in gitweb Aneesh Kumar K.V
2006-08-17 7:34 ` Junio C Hamano
2006-08-17 7:48 ` Aneesh Kumar
2006-08-17 9:49 ` Jakub Narebski
2006-08-16 22:40 ` gitweb / cg-export Martin Waitz
2006-08-16 22:50 ` Kay Sievers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44E2658D.9020600@cam.ac.uk \
--to=tow21@cam.ac.uk \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.