git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCHv2] git-instaweb: Add option to reuse previous config file
@ 2010-06-01 21:59 Pavan Kumar Sunkara
  2010-06-01 22:24 ` Jakub Narebski
  0 siblings, 1 reply; 2+ messages in thread
From: Pavan Kumar Sunkara @ 2010-06-01 21:59 UTC (permalink / raw
  To: git, jnareb, chriscool, pasky; +Cc: Pavan Kumar Sunkara

Add an option to git-instaweb which allows the usage of the old
gitweb_config.perl situated in '.git/gitweb' dir. When the option
is in use, gitweb_config.perl generated by git-instaweb won't be
overwritten.

Usage:
	git instaweb --reuse-config

Example:
	When I use git-instaweb, it is tiring to add customised
configuration (like highlight featues enabling) to the gitweb_config.perl
file everytime I initiate the server. With this,it's enough to use
this option.

Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
---
 Documentation/git-instaweb.txt |    5 ++++-
 git-instaweb.sh                |    8 +++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-instaweb.txt b/Documentation/git-instaweb.txt
index 2c3c4d2..0e7e20b 100644
--- a/Documentation/git-instaweb.txt
+++ b/Documentation/git-instaweb.txt
@@ -9,7 +9,7 @@ SYNOPSIS
 --------
 [verse]
 'git instaweb' [--local] [--httpd=<httpd>] [--port=<port>]
-               [--browser=<browser>]
+               [--browser=<browser>] [--reuse-config]
 'git instaweb' [--start] [--stop] [--restart]
 
 DESCRIPTION
@@ -49,6 +49,9 @@ OPTIONS
 	linkgit:git-web--browse[1] for more information about this. If
 	the script fails, the URL will be printed to stdout.
 
+--reuse-config::
+	The previous gitweb_config.perl will not be overwritten.
+
 --start::
 	Start the httpd instance and exit.  This does not generate
 	any of the configuration files for spawning a new instance.
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 1af4d5a..1c704a3 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -13,6 +13,7 @@ p,port=        the port to bind to
 d,httpd=       the command to launch
 b,browser=     the browser to launch
 m,module-path= the module path (only needed for apache2)
+reuse-config    reuse previous gitweb_config.perl from GIT_DIR
  Action
 stop           stop the web server
 start          start the web server
@@ -27,6 +28,7 @@ httpd="$(git config --get instaweb.httpd)"
 root="$(git config --get instaweb.gitwebdir)"
 port=$(git config --get instaweb.port)
 module_path="$(git config --get instaweb.modulepath)"
+no_reuse=true
 
 conf="$GIT_DIR/gitweb/httpd.conf"
 
@@ -171,6 +173,10 @@ do
 		shift
 		module_path="$1"
 		;;
+	--reuse-config)
+		shift
+		no_reuse=false
+		;;
 	--)
 		;;
 	*)
@@ -551,7 +557,7 @@ our \$projects_list = \$projectroot;
 EOF
 }
 
-gitweb_conf
+test "$no_reuse" = true || test ! -e "$GITWEB_CONFIG" && gitweb_conf
 
 resolve_full_httpd
 mkdir -p "$fqgitdir/gitweb/$httpd_only"
-- 
1.7.1.443.g62265.dirty

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCHv2] git-instaweb: Add option to reuse previous config file
  2010-06-01 21:59 [PATCHv2] git-instaweb: Add option to reuse previous config file Pavan Kumar Sunkara
@ 2010-06-01 22:24 ` Jakub Narebski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Narebski @ 2010-06-01 22:24 UTC (permalink / raw
  To: Pavan Kumar Sunkara; +Cc: git, chriscool, pasky

Pavan Kumar Sunkara wrote:

> Add an option to git-instaweb which allows the usage of the old
> gitweb_config.perl situated in '.git/gitweb' dir. When the option
> is in use, gitweb_config.perl generated by git-instaweb won't be
> overwritten.
> 
> Usage:
> 	git instaweb --reuse-config
> 
> Example:
> 	When I use git-instaweb, it is tiring to add customised
> configuration (like highlight featues enabling) to the gitweb_config.perl
> file everytime I initiate the server. With this,it's enough to use
> this option.
> 
> Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>

This addresses my issues:

Acked-by: Jakub Narebski <jnareb@gmail.com>

-- 
Jakub Narebski
Poland

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-01 22:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-01 21:59 [PATCHv2] git-instaweb: Add option to reuse previous config file Pavan Kumar Sunkara
2010-06-01 22:24 ` Jakub Narebski

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).