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

[PATCH 1/3] gitweb: Add tests for overriding gitweb config with repo config

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 2, 2007, 23:41 UTC
Message-ID
<1194046880-29941-2-git-send-email-jnareb@gmail.com>
In-Reply-To
<1194046880-29941-1-git-send-email-jnareb@gmail.com>

Make blame view and snapshot support overridable by repository config. Test tree view with both features disabled, and with both features enabled.

Test with features enabled also tests multiple formats snapshot support (in tree view).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
If I remember correctly it was when creating this test that there were
probles with CGI::Carp::set_programname() in t9500 test. And it took
me some time to discover where the bug was.
 t/t9500-gitweb-standalone-no-errors.sh |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 1bf0988..35fff3d 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -557,4 +557,27 @@ test_expect_success \
 	'gitweb_run "p=.git;a=tree;opt=--no-merges"'
 test_debug 'cat gitweb.log'
 
+# ----------------------------------------------------------------------
+# gitweb config and repo config
+
+cat >>gitweb_config.perl <<EOF
+
+\$feature{'blame'}{'override'} = 1;
+\$feature{'snapshot'}{'override'} = 1;
+EOF
+
+test_expect_success \
+	'config override: tree view, features disabled in repo config' \
+	'git config gitweb.blame no &&
+	 git config gitweb.snapshot none &&
+	 gitweb_run "p=.git;a=tree"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+	'config override: tree view, features enabled in repo config' \
+	'git config gitweb.blame yes &&
+	 git config gitweb.snapshot "zip,tgz, tbz2" &&
+	 gitweb_run "p=.git;a=tree"'
+test_debug 'cat gitweb.log'
+
 test_done
-- 
1.5.3.5
Previous: Jakub NarebskiNext: Jakub Narebski
Message 2 of 4 in “gitweb: Improve reading of repo config”
  1. 0/3 gitweb: Improve reading of repo configJakub Narebski, Nov 2, 2007
  2. 1/3 gitweb: Add tests for overriding gitweb config with repo configJakub Narebski, Nov 2, 2007
  3. 2/3 gitweb: Read repo config using 'git config -z -l'Jakub Narebski, Nov 2, 2007
  4. 3/3 gitweb: Use config file for repository description and URLsJakub Narebski, Nov 2, 2007

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.