summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2010-04-24 13:53:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-05-01 19:09:43 (GMT)
commit377bee3424ba871278d230ed296f74ccac8ad607 (patch)
treecd6b83146ade0ac1b045dc90fd9aadd6994444e2 /gitweb
parent5ae8030fdeb0bb00b94cc830dc98d4fb9d0d532e (diff)
downloadgit-377bee3424ba871278d230ed296f74ccac8ad607.zip
git-377bee3424ba871278d230ed296f74ccac8ad607.tar.gz
git-377bee3424ba871278d230ed296f74ccac8ad607.tar.bz2
gitweb: href(..., -path_info => 0|1)
If named boolean option -path_info is passed to href() subroutine, it would use its value to decide whether to generate path_info URL form. If this option is not passed, href() queries 'pathinfo' feature to check whether to generate path_info URL (if generating path_info link is possible at all). href(-replay=>1, -path_info=>0) is meant to be used to generate a key for caching gitweb output; alternate solution would be to use freeze() from Storable (core module) on %input_params hash (or its reference), e.g.: $key = freeze \%input_params; or other serialization of %input_params. While at it document extra options/flags to href(). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl7
1 files changed, 6 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c356e95..6cefb09 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -977,6 +977,10 @@ exit;
## ======================================================================
## action links
+# possible values of extra options
+# -full => 0|1 - use absolute/full URL ($my_uri/$my_url as base)
+# -replay => 1 - start from a current view (replay with modifications)
+# -path_info => 0|1 - don't use/use path_info URL (if possible)
sub href {
my %params = @_;
# default is to use -absolute url() i.e. $my_uri
@@ -993,7 +997,8 @@ sub href {
}
my $use_pathinfo = gitweb_check_feature('pathinfo');
- if ($use_pathinfo and defined $params{'project'}) {
+ if (defined $params{'project'} &&
+ (exists $params{-path_info} ? $params{-path_info} : $use_pathinfo)) {
# try to put as many parameters as possible in PATH_INFO:
# - project name
# - action