threads / patch / 4990

patch, 5 partsgit-instaweb: store parameters in config

Subject: [PATCH 3/5] git-instaweb: store parameters in config

## tl;dr

4 messages between Jul 26, 2006 and Jul 26, 2006. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Johannes Schindelin· Jul 26, 2006, 14:33 UTC · lore

It already reads the config for defaults, and now it also stores the last passed parameters in the config.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 git-instaweb.sh |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
Show changes to git-instaweb.sh +5 −0
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 9829c59..1d3ea73 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -78,6 +78,7 @@ do
 		;;
 	--local|-l)
 		local=true
+		git repo-config instaweb.local true
 		;;
 	-d|--httpd|--httpd=*)
 		case "$#,$1" in
@@ -89,6 +90,7 @@ do
 			httpd="$2"
 			shift ;;
 		esac
+		git-repo-config instaweb.httpd "$httpd"
 		;;
 	-b|--browser|--browser=*)
 		case "$#,$1" in
@@ -100,6 +102,7 @@ do
 			browser="$2"
 			shift ;;
 		esac
+		git-repo-config instaweb.browser "$browser"
 		;;
 	-p|--port|--port=*)
 		case "$#,$1" in
@@ -111,6 +114,7 @@ do
 			port="$2"
 			shift ;;
 		esac
+		git-repo-config instaweb.port "$port"
 		;;
 	-m|--module-path=*|--module-path)
 		case "$#,$1" in
@@ -122,6 +126,7 @@ do
 			module_path="$2"
 			shift ;;
 		esac
+		git-repo-config instaweb.modulepath "$module_path"
 		;;
 	*)
 		usage
-- 
1.4.2.rc2.g6a4e
Junio C Hamano· Jul 26, 2006, 19:16 UTC · re: Johannes Schindelin · lore

Re: [PATCH 3/5] git-instaweb: store parameters in config

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> It already reads the config for defaults, and now it also stores
> the last passed parameters in the config.

This might need to be conditional -- usually people override the default from the command line as a one-shot thing, and storing them in the configuration file would upset them.

Johannes Schindelin· Jul 26, 2006, 19:53 UTC · re: Junio C Hamano · lore

Re: [PATCH 3/5] git-instaweb: store parameters in config

Hi,
On Wed, 26 Jul 2006, Junio C Hamano wrote:
Show 8 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > It already reads the config for defaults, and now it also stores
> > the last passed parameters in the config.
> 
> This might need to be conditional -- usually people override the
> default from the command line as a one-shot thing, and storing
> them in the configuration file would upset them.

I agree that this should be conditional, but the other way round, no? git-instaweb is meant as a one-shot install thing, so I would like to do this in some arbitrary repo:

	git-instaweb

and see a browser. Okay, so it does not work: I do not have LigHTTP, and my apache is not in the path (and you need to specify the modules-path anyway, if it is different than /usr/lib/apache2/modules), so I do

	git-instaweb --httpd=/usr/local/apache2/bin/httpd\ -f \
		--module-path=/usr/local/apache2/modules

Works! After I played a little with it (or rebooted the computer), I would like to start it again:

	git-instaweb

My point being: you do not really need a different configuration with git-instaweb, once you got it right.

Ciao, Dscho

Johannes Schindelin· Jul 26, 2006, 21:13 UTC · re: Johannes Schindelin · lore

Re: [PATCH 3/5] git-instaweb: store parameters in config

Hi,
On Wed, 26 Jul 2006, Johannes Schindelin wrote:
Show 12 quoted lines
> On Wed, 26 Jul 2006, Junio C Hamano wrote:
> 
> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> > 
> > > It already reads the config for defaults, and now it also stores
> > > the last passed parameters in the config.
> > 
> > This might need to be conditional -- usually people override the
> > default from the command line as a one-shot thing, and storing
> > them in the configuration file would upset them.
> 
> I agree that this should be conditional, but the other way round, no? 

Being bitten by my own words. It is plain dumb to store parameters for which instaweb fails. And my patch did that. Oh, well.

So, I'd say: just forget about patches [3-5]/5.

Ciao, Dscho

← back to recent threads