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

[PATCH 07/10] gitweb: Add -partial_query option to href() subroutine

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 24, 2009, 22:44 UTC
Message-ID
<1248475450-5668-8-git-send-email-jnareb@gmail.com>
In-Reply-To
<1248475450-5668-1-git-send-email-jnareb@gmail.com>

href(..., -partial_query=>1) is meant to generate links which have not all parameters filled, and which can be completed by simply appending ';<param>=<value>'. This feature was implemented for future AJAX-y 'blame_incremental' in JavaScript.

Originally by Petr Baudis as part of "gitweb: Incremental blame" patch, to deal with path_info URLs in JavaScript part easily and correctly.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This change is extracted from incremental blame patch by Petr Baudis.
In previous version of this series it was part of 5/3 patch
introducing 'blame_incremental' view.
However as you can see in incremental blame patch by Matrin Koegler:
  http://thread.gmane.org/gmane.comp.version-control.git/47902/focus=47905

this is not strictly necessary. JavaScript (which is sole user of this '-partial-query' parameter) can simply check if there is '?' character in link already. On the other hand side it makes JavaScript code a bit simpler.

 gitweb/gitweb.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 2cb60be..0d91ac7 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -992,7 +992,8 @@ sub href {
 			}
 		}
 	}
-	$href .= "?" . join(';', @result) if scalar @result;
+	$href .= "?" . join(';', @result)
+		if ($params{-partial_query} or scalar @result);
 
 	return $href;
 }
-- 
1.6.3.3
Previous: Jakub NarebskiNext: Jakub Narebski
Message 11 of 21 in “[PATCHv2 00/10] gitweb: 'blame' view improvements”
  1. Jakub NarebskiJul 24, 2009
  2. 01/10 gitweb: Make .error style genericJakub Narebski, Jul 24, 2009
  3. 02/10 gitweb: Mark boundary commits in 'blame' viewJakub Narebski, Jul 24, 2009
  4. Junio C HamanoJul 25, 2009
  5. Jakub NarebskiJul 25, 2009
  6. Junio C HamanoJul 25, 2009
  7. 03/10 gitweb: Use "previous" header of git-blame -p in 'blame' viewJakub Narebski, Jul 24, 2009
  8. 04/10 gitweb: Mark commits with no "previous" in 'blame' viewJakub Narebski, Jul 24, 2009
  9. 05/10 gitweb: Add author initials in 'blame' view, a la "git gui blame"Jakub Narebski, Jul 24, 2009
  10. 06/10 gitweb: Use light/dark for class names also in 'blame' viewJakub Narebski, Jul 24, 2009
  11. 07/10 gitweb: Add -partial_query option to href() subroutineJakub Narebski, Jul 24, 2009
  12. 08/10 gitweb: Add optional "time to generate page" info in footerJakub Narebski, Jul 24, 2009
  13. 09/10 gitweb: Incremental blame (proof of concept)Jakub Narebski, Jul 24, 2009
  14. Jakub NarebskiJul 25, 2009
  15. 10/10 gitweb: Create links leading to 'blame_incremental' using JavaScriptJakub Narebski, Jul 24, 2009
  16. Martin KoeglerJul 25, 2009
  17. Jakub NarebskiJul 26, 2009
  18. Martin KoeglerJul 27, 2009
  19. Jakub NarebskiJul 27, 2009
  20. Junio C HamanoJul 24, 2009
  21. Jakub NarebskiJul 25, 2009

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.