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

Re: [PATCH] instaweb: added support Ruby's WEBrick server

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 18, 2007, 23:15 UTC
Message-ID
<7vodfztviv.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20070918121634.E8EFF814635@cyrano>
mike@csa.net (mike dalessio) writes:
Show 12 quoted lines
> diff --git a/Documentation/git-instaweb.txt b/Documentation/git-instaweb.txt
> index cec60ee..914fc4c 100644
> --- a/Documentation/git-instaweb.txt
> +++ b/Documentation/git-instaweb.txt
> @@ -27,7 +27,8 @@ OPTIONS
>  	The HTTP daemon command-line that will be executed.
>  	Command-line options may be specified here, and the
>  	configuration file will be added at the end of the command-line.
> -	Currently, lighttpd and apache2 are the only supported servers.
> +	Currently, lighttpd, apache2 and webrick are the only supported
> +	servers.
>  	(Default: lighttpd)

Perhaps we can start thinking about rewording "are the only suported servers" to "are supported".

Show 15 quoted lines
> diff --git a/git-instaweb.sh b/git-instaweb.sh
> index b79c6b6..803a754 100755
> --- a/git-instaweb.sh
> +++ b/git-instaweb.sh
> @@ -37,7 +37,9 @@ start_httpd () {
>  	else
>  		# many httpds are installed in /usr/sbin or /usr/local/sbin
>  		# these days and those are not in most users $PATHs
> -		for i in /usr/local/sbin /usr/sbin
> +		# in addition, we may have generated a server script
> +		# in $fqgitdir/gitweb.
> +		for i in /usr/local/sbin /usr/sbin $fqgitdir/gitweb
>  		do
>  			if test -x "$i/$httpd_only"
>  			then

I do not think this hunk belongs to this patch. It alone would be a useful addition to the program even without the rest of your patch, wouldn't it? Imagine a case where I automatically would reject all patches that have "Ruby" in it for some unknown reason. Do we want to drop this hunk in such a case?

> +	# generate a shell script to invoke the above ruby script,
> +	# which assumes _ruby_ is in the user's $PATH. that's _one_
> +	# portable way to run ruby, which could be installed anywhere,
> +	# really.
No games with env, type, nor which.  Good.
Just a few style things (-) and one concern (+):
> +	cat > "$fqgitdir/gitweb/$httpd" <<EOF
> +#! /bin/sh
> +ruby $fqgitdir/gitweb/$httpd.rb \$*
> +EOF
 - I do not like extra whitespace between she-bang #! and the
   path.  Looks very ugly.
 - I do not like extra whitespace between redirection > and
   redirected filename either.  Looks very ugly.
 - I prefer such wrapper to exec the command, like this:
	#!/bin/sh
        exec ruby ...
 + fqgitdir and httpd need to be shell quoted.  I do not think
   anybody is stupid enough to have his GIT_DIR set to something
   like "/opt/funny/; rm -f / nuke-me/.git/" but you would see
   spaces and single quotes in pathnames in odd environments.

I wonder how popular instaweb is and how widely it is used. I've actually wondering if we should demote it to contrib/ somewhere, but it gets occasional updates so people must be using it...

Previous: Eric WongNext: David Symonds
Message 3 of 8 in “instaweb: added support Ruby's WEBrick server”
  1. instaweb: added support Ruby's WEBrick servermike dalessio, Sep 18, 2007
  2. Eric WongSep 18, 2007
  3. Junio C HamanoSep 18, 2007
  4. David SymondsSep 19, 2007
  5. Johannes SchindelinSep 19, 2007
  6. 1/2 instaweb: allow for use of auto-generated scriptsmike@csa.net, Oct 6, 2007
  7. 2/2 instaweb: support for Ruby's WEBrick servermike@csa.net, Oct 6, 2007
  8. Eric WongOct 14, 2007

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.