git-instaweb: Check that correct config file exists for (re)startgit-instaweb
commit840be9a10119ce02de062a41aeb1202b105c5d53
authorJakub Narebski <jnareb@gmail.com>
Fri, 24 Jun 2011 09:56:35 +0000 (24 11:56 +0200)
committerJakub Narebski <jnareb@gmail.com>
Fri, 24 Jun 2011 09:56:35 +0000 (24 11:56 +0200)
treecba5586cc5f9562067305f089e2a3fcf6b7c5055
parent91db344a105dd05eefd1275347e8faf136f69d99
git-instaweb: Check that correct config file exists for (re)start

Currently start/restart does not generate any configuration files for
spawning a new instance.  This means that

  $ git instaweb --http=<server> --start

might pick up stale 'httpd.conf' file for a different web server
(e.g. for default lighttpd when requesting apache2).

This commit changes that, and makes git-instaweb generate web server
config file and/or gitweb config file if don't exists.

This required naming config files after the name of web server
(alternate solution would be to somehow mark for which web server was
config file generated).

Note that web servers that embed configuration in server script file,
namely webrick and plackup, and which delete "$conf" in their *_conf
function, would have their config (server script) always regenerated.

Note: this commit introduces a bit of code repetition (but only a few
lines).

Reported-by: Gurjeet Singh <singh.gurjeet@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Documentation/git-instaweb.txt
git-instaweb.sh