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

[PATCH 1/4] git-instaweb: Extract configuring web server into configure_httpd

From
Jakub Narebski <jnareb@gmail.com>
Date
Jun 23, 2011, 19:55 UTC
Message-ID
<20110623195111.18265.77040.stgit@localhost.localdomain>
In-Reply-To
<20110623194624.18265.82482.stgit@localhost.localdomain>

This is preparatory work for making start/restart check that git-instaweb set up correct configuration, and generate it if it is missing.

Pure refactoring, no functional changes. 
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
As usual, you can check this change with
  $ git blame -w --date=short -C -C HEAD^.. -- git-instaweb.sh |
    grep -C 3 -e '^[^^]' | less -S
assuming that it is checked out (HEAD == this commit).
Thanks Junio for the tip!

Nb. it would be nice to have an option to 'git diff' which would function like '-w' but ignore code movement...

 git-instaweb.sh |   46 +++++++++++++++++++++++++---------------------
 1 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 8bfa8a0..49bab7b 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -587,32 +587,36 @@ our \$projects_list = \$projectroot;
 EOF
 }
 
+configure_httpd() {
+	case "$httpd" in
+	*lighttpd*)
+		lighttpd_conf
+		;;
+	*apache2*|*httpd*)
+		apache2_conf
+		;;
+	webrick)
+		webrick_conf
+		;;
+	*mongoose*)
+		mongoose_conf
+		;;
+	*plackup*)
+		plackup_conf
+		;;
+	*)
+		echo "Unknown httpd specified: $httpd"
+		exit 1
+		;;
+	esac
+}
+
 gitweb_conf
 
 resolve_full_httpd
 mkdir -p "$fqgitdir/gitweb/$httpd_only"
 
-case "$httpd" in
-*lighttpd*)
-	lighttpd_conf
-	;;
-*apache2*|*httpd*)
-	apache2_conf
-	;;
-webrick)
-	webrick_conf
-	;;
-*mongoose*)
-	mongoose_conf
-	;;
-*plackup*)
-	plackup_conf
-	;;
-*)
-	echo "Unknown httpd specified: $httpd"
-	exit 1
-	;;
-esac
+configure_httpd
 
 start_httpd
 url=http://127.0.0.1:$port
Previous: Jakub NarebskiNext: Jakub Narebski
Message 6 of 10 in “Having some problem with instaweb”
  1. Gurjeet SinghJun 23, 2011
  2. Jakub NarebskiJun 23, 2011
  3. Gurjeet SinghJun 23, 2011
  4. Jakub NarebskiJun 23, 2011
  5. 0/4 git-instaweb: Improving handling of --start/--restartJakub Narebski, Jun 23, 2011
  6. 1/4 git-instaweb: Extract configuring web server into configure_httpdJakub Narebski, Jun 23, 2011
  7. 2/4 git-instaweb: Use $conf, not $fqgitdir/gitweb/httpd.confJakub Narebski, Jun 23, 2011
  8. 3/4 git-instaweb: Move all actions at the end of scriptJakub Narebski, Jun 23, 2011
  9. 4/4 git-instaweb: Check that correct config file exists for (re)startJakub Narebski, Jun 23, 2011
  10. Eric WongJun 28, 2011

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.