git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: mike@csa.net (mike dalessio)
Cc: git@vger.kernel.org, normalperson@yhbt.net
Subject: Re: [PATCH] instaweb: added support Ruby's WEBrick server
Date: Tue, 18 Sep 2007 16:15:52 -0700	[thread overview]
Message-ID: <7vodfztviv.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20070918121634.E8EFF814635@cyrano> (mike dalessio's message of "Tue, 18 Sep 2007 08:16:34 -0400 (EDT)")

mike@csa.net (mike dalessio) writes:

> 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".

> 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...

  parent reply	other threads:[~2007-09-18 23:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-18 12:16 [PATCH] instaweb: added support Ruby's WEBrick server mike dalessio
2007-09-18 20:40 ` Eric Wong
2007-09-18 23:15 ` Junio C Hamano [this message]
2007-09-19  0:41   ` David Symonds
2007-09-19  1:27   ` Johannes Schindelin
     [not found]   ` <55e906d58f15c79c61d83ad4c52ef085de8ad736.1191687881.git.mike@csa.net>
2007-10-06 17:29     ` [PATCH 1/2] instaweb: allow for use of auto-generated scripts mike
     [not found]     ` <cbdd8ea5ab52c45e87319335546ec7c2c06191cd.1191687881.git.mike@csa.net>
2007-10-06 17:29       ` [PATCH 2/2] instaweb: support for Ruby's WEBrick server mike
2007-10-14  9:49     ` [PATCH 1/2] instaweb: allow for use of auto-generated scripts Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vodfztviv.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mike@csa.net \
    --cc=normalperson@yhbt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).