1 From 19c051eab05ab0b826f3ca45346610a73a95d738 Mon Sep 17 00:00:00 2001
2 From: "Kyle J. McKay" <mackyle@gmail.com>
3 Date: Sun, 8 Feb 2015 12:18:36 -0800
4 Subject: [PATCH] git-instaweb: add git-browser graphiclog link
6 Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
8 git-instaweb.sh | 17 +++++++++++++++--
9 1 file changed, 15 insertions(+), 2 deletions(-)
11 diff --git a/git-instaweb.sh b/git-instaweb.sh
12 index 2231670c..cdaef50b 100755
15 @@ -105,6 +105,7 @@ start_httpd () {
17 # generate correct config file if it doesn't exist
18 test -f "$conf" || configure_httpd
19 + test -f "$fqgitdir/gitweb/git-browser.conf" || gitbrowser_conf
20 test -f "$fqgitdir/gitweb/gitweb_config.perl" || gitweb_conf
22 # don't quote $full_httpd, there can be arguments to it (-f)
23 @@ -196,7 +197,8 @@ mkdir -p "$GIT_DIR/gitweb/tmp"
24 GIT_EXEC_PATH="$(git --exec-path)"
26 GITWEB_CONFIG="$fqgitdir/gitweb/gitweb_config.perl"
27 -export GIT_EXEC_PATH GIT_DIR GITWEB_CONFIG
28 +GITBROWSER_CONFIG="$fqgitdir/gitweb/git-browser.conf"
29 +export GIT_EXEC_PATH GIT_DIR GITWEB_CONFIG GITBROWSER_CONFIG
32 # webrick seems to have no way of passing arbitrary environment
33 @@ -262,7 +264,7 @@ server.force-lowercase-filenames = "disable"
34 # variable above and uncomment this
35 #accesslog.filename = "$fqgitdir/gitweb/$httpd_only/access.log"
37 -setenv.add-environment = ( "PATH" => env.PATH, "GITWEB_CONFIG" => env.GITWEB_CONFIG )
38 +setenv.add-environment = ( "PATH" => env.PATH, "GITWEB_CONFIG" => env.GITWEB_CONFIG, "GITBROWSER_CONFIG" => env.GITBROWSER_CONFIG )
40 cgi.assign = ( ".cgi" => "" )
42 @@ -591,6 +593,13 @@ EOF
47 + cat > "$fqgitdir/gitweb/git-browser.conf" <<EOF
48 +gitbin: $(command -v git)
49 +warehouse: $(dirname "$fqgitdir")
54 cat > "$fqgitdir/gitweb/gitweb_config.perl" <<EOF
56 @@ -605,6 +614,9 @@ our \$favicon = "/static/git-favicon.png";
57 our \$gitwebjs = "/static/gitweb.js";
58 our @diff_opts = ('-B', '-C');
60 +\$feature{'actions'}{'default'}=[
61 + ('graphiclog', "/git-browser/by-commit.html?r=%n", 'log')
63 \$feature{'remote_heads'}{'default'} = [1];
64 \$feature{'blame'}{'default'} = [1];
65 \$feature{'pathinfo'}{'default'} = [1];
66 @@ -664,6 +676,7 @@ restart)