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

[PATCH] gitweb: make PATHINFO URL generation conditional on input URL.

From
Martin Waitz <tali@admingilde.org>
Date
Oct 3, 2006, 18:08 UTC
Message-ID
<20061003180832.GP2871@admingilde.org>
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
Previous: Jakub NarebskiNext: Petr Baudis
Message 13 of 19 in “gitweb: start to generate PATH_INFO URLs”
  1. gitweb: start to generate PATH_INFO URLsMartin Waitz, Sep 29, 2006
  2. Junio C HamanoSep 29, 2006
  3. Martin WaitzSep 30, 2006
  4. Junio C HamanoSep 30, 2006
  5. gitweb: start to generate PATH_INFO URLs.Martin Waitz, Oct 1, 2006
  6. Jakub NarebskiOct 3, 2006
  7. Junio C HamanoOct 3, 2006
  8. Jakub NarebskiOct 3, 2006
  9. Junio C HamanoOct 3, 2006
  10. Martin WaitzOct 3, 2006
  11. gitweb: warn if feature cannot be overridden.Martin Waitz, Oct 3, 2006
  12. Jakub NarebskiOct 3, 2006
  13. gitweb: make PATHINFO URL generation conditional on input URL.Martin Waitz, Oct 3, 2006
  14. Petr BaudisOct 6, 2006
  15. Junio C HamanoOct 7, 2006
  16. Jakub NarebskiOct 3, 2006
  17. Martin WaitzOct 3, 2006
  18. Jakub NarebskiOct 3, 2006
  19. Junio C HamanoOct 3, 2006

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.