aboutsummaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2007-07-12 20:39:27 +0200
committerJunio C Hamano <gitster@pobox.com>2007-07-12 14:38:36 -0700
commit868bc068bb45e3b9d135151f2126ce3dba849426 (patch)
tree30a87f3927f82ff17814a445c5c04e8b6567f10b /gitweb
parent248c648a0de945ec37af13e0a9b8671da525c323 (diff)
downloadgit-868bc068bb45e3b9d135151f2126ce3dba849426.tar.gz
git-868bc068bb45e3b9d135151f2126ce3dba849426.tar.xz
gitweb: new cgi parameter: opt
Currently the only supported value is '--no-merges' for the 'rss', 'atom', 'log', 'shortlog' and 'history' actions, but it can be easily extended to allow other parameters for other actions. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl19
1 files changed, 19 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 27580b567..c8ba3a27a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -386,6 +386,23 @@ if (defined $hash_base) {
}
}
+my %allowed_options = (
+ "--no-merges" => [ qw(rss atom log shortlog history) ],
+);
+
+our @extra_options = $cgi->param('opt');
+if (defined @extra_options) {
+ foreach(@extra_options)
+ {
+ if (not grep(/^$_$/, keys %allowed_options)) {
+ die_error(undef, "Invalid option parameter");
+ }
+ if (not grep(/^$action$/, @{$allowed_options{$_}})) {
+ die_error(undef, "Invalid option parameter for this action");
+ }
+ }
+}
+
our $hash_parent_base = $cgi->param('hpb');
if (defined $hash_parent_base) {
if (!validate_refname($hash_parent_base)) {
@@ -537,6 +554,7 @@ sub href(%) {
action => "a",
file_name => "f",
file_parent => "fp",
+ extra_options => "opt",
hash => "h",
hash_parent => "hp",
hash_base => "hb",
@@ -1773,6 +1791,7 @@ sub parse_commits {
($arg ? ($arg) : ()),
("--max-count=" . $maxcount),
("--skip=" . $skip),
+ @extra_options,
$commit_id,
"--",
($filename ? ($filename) : ())