From: Martin Waitz <tali@admingilde.org>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org
Subject: [PATCH] gitweb: make PATHINFO URL generation conditional on input URL.
Date: Tue, 3 Oct 2006 20:08:32 +0200 [thread overview]
Message-ID: <20061003180832.GP2871@admingilde.org> (raw)
In-Reply-To: <efu3u4$tc9$1@sea.gmane.org>
Now the feature 'pathinfo' configuration only applies to the project
list. All other URLs are generated in the form the webpage was
called itself.
Signed-off-by: Martin Waitz <tali@admingilde.org>
---
gitweb/gitweb.perl | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 0ff6f7c..70246de 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -206,6 +206,8 @@ our $git_version = qx($GIT --version) =~
$projects_list ||= $projectroot;
+our $use_pathinfo_url = gitweb_check_feature('pathinfo');
+
# ======================================================================
# input validation and dispatch
our $action = $cgi->param('a');
@@ -226,6 +228,8 @@ if (defined $project) {
undef $project;
die_error(undef, "No such project");
}
+ # we got called without PATH_INFO, let's keep it that way.
+ $use_pathinfo_url = 0;
}
our $file_name = $cgi->param('f');
@@ -308,6 +312,10 @@ sub evaluate_path_info {
undef $project;
return;
}
+
+ # we were called using a PATH_INFO URL, let's keep it that way.
+ $use_pathinfo_url = 1;
+
# do not change any parameters if an action is given using the query string
return if $action;
$path_info =~ s,^$project/*,,;
@@ -402,8 +410,7 @@ sub href(%) {
$params{'project'} = $project unless exists $params{'project'};
- my ($use_pathinfo) = gitweb_check_feature('pathinfo');
- if ($use_pathinfo) {
+ if ($use_pathinfo_url) {
# use PATH_INFO for project name
$href .= "/$params{'project'}" if defined $params{'project'};
delete $params{'project'};
--
1.4.2.3
--
Martin Waitz
next prev parent reply other threads:[~2006-10-03 18:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-29 22:16 [PATCH] gitweb: start to generate PATH_INFO URLs Martin Waitz
2006-09-29 22:30 ` Junio C Hamano
2006-09-30 18:14 ` Martin Waitz
2006-09-30 19:42 ` Junio C Hamano
2006-10-01 21:57 ` Martin Waitz
2006-10-03 12:18 ` Jakub Narebski
2006-10-03 17:39 ` Junio C Hamano
2006-10-03 17:50 ` Jakub Narebski
2006-10-03 20:16 ` Junio C Hamano
2006-10-03 20:28 ` Martin Waitz
2006-10-03 18:07 ` [PATCH] gitweb: warn if feature cannot be overridden Martin Waitz
2006-10-03 16:43 ` [PATCH] gitweb: start to generate PATH_INFO URLs Jakub Narebski
2006-10-03 18:08 ` Martin Waitz [this message]
2006-10-06 15:30 ` Petr Baudis
2006-10-07 8:40 ` Junio C Hamano
2006-10-03 12:16 ` Jakub Narebski
2006-10-03 17:12 ` Martin Waitz
2006-10-03 17:19 ` Jakub Narebski
2006-10-03 17:36 ` Junio C Hamano
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=20061003180832.GP2871@admingilde.org \
--to=tali@admingilde.org \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).