Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] gitweb: use single quotes for values replaced by the Makefile
Date: Wed, 02 Aug 2006 13:50:53 -0700	[thread overview]
Message-ID: <7vmzamuaj6.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <E1G8N9c-0004GK-Gz@moooo.ath.cx> (Matthias Lederhofer's message of "Wed, 2 Aug 2006 22:17:20 +0200")

I understand that (1) "@@FOO@@" is problematic, (2) being able
to run gitweb/gitweb.perl while coming up with improvements is
nice, but (3) not being able to say "/etc/foo/$ENV{SITE_NAME}"
is quite a drawback on the deployment side.

So why don't we use something other than @@, perhaps "++FOO++"?

I'm inclined to take these two patches:

    gitweb: optionally read config from GITWEB_CONFIG (Jeff King)
    gitweb: require $ENV{'GITWEB_CONFIG'} (Matthias Lederhofer)

so on top of them something like this?

-- >8 --
[PATCH] gitweb: do not use @@FOO@@ for replaced tokens

This makes it easier to run gitweb/gitweb.perl without token substitution.
Using @@ makes Perl emit "unintended interpolation" warnings.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 Makefile           |   18 +++++++++---------
 gitweb/gitweb.perl |   18 +++++++++---------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index a2b4aca..3816ef7 100644
--- a/Makefile
+++ b/Makefile
@@ -584,15 +584,15 @@ git-status: git-commit
 gitweb/gitweb.cgi: gitweb/gitweb.perl
 	rm -f $@ $@+
 	sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
-	    -e 's|@@GIT_VERSION@@|$(GIT_VERSION)|g' \
-	    -e 's|@@GIT_BINDIR@@|$(bindir)|g' \
-	    -e 's|@@GITWEB_CONFIG@@|$(GITWEB_CONFIG)|g' \
-	    -e 's|@@GITWEB_SITENAME@@|$(GITWEB_SITENAME)|g' \
-	    -e 's|@@GITWEB_PROJECTROOT@@|$(GITWEB_PROJECTROOT)|g' \
-	    -e 's|@@GITWEB_LIST@@|$(GITWEB_LIST)|g' \
-	    -e 's|@@GITWEB_HOMETEXT@@|$(GITWEB_HOMETEXT)|g' \
-	    -e 's|@@GITWEB_CSS@@|$(GITWEB_CSS)|g' \
-	    -e 's|@@GITWEB_LOGO@@|$(GITWEB_LOGO)|g' \
+	    -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
+	    -e 's|++GIT_BINDIR++|$(bindir)|g' \
+	    -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \
+	    -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
+	    -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
+	    -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
+	    -e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \
+	    -e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
+	    -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
 	    $< >$@+
 	chmod +x $@+
 	mv $@+ $@
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c7f13e7..3cd2b89 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -18,18 +18,18 @@ use File::Find qw();
 binmode STDOUT, ':utf8';
 
 our $cgi = new CGI;
-our $version = "@@GIT_VERSION@@";
+our $version = "++GIT_VERSION++";
 our $my_url = $cgi->url();
 our $my_uri = $cgi->url(-absolute => 1);
 our $rss_link = "";
 
 # core git executable to use
 # this can just be "git" if your webserver has a sensible PATH
-our $GIT = "@@GIT_BINDIR@@/git";
+our $GIT = "++GIT_BINDIR++/git";
 
 # absolute fs-path which will be prepended to the project path
 #our $projectroot = "/pub/scm";
-our $projectroot = "@@GITWEB_PROJECTROOT@@";
+our $projectroot = "++GITWEB_PROJECTROOT++";
 
 # location for temporary files needed for diffs
 our $git_temp = "/tmp/gitweb";
@@ -39,18 +39,18 @@ our $home_link = $my_uri;
 
 # name of your site or organization to appear in page titles
 # replace this with something more descriptive for clearer bookmarks
-our $site_name = "@@GITWEB_SITENAME@@" || $ENV{'SERVER_NAME'} || "Untitled";
+our $site_name = "++GITWEB_SITENAME++" || $ENV{'SERVER_NAME'} || "Untitled";
 
 # html text to include at home page
-our $home_text = "@@GITWEB_HOMETEXT@@";
+our $home_text = "++GITWEB_HOMETEXT++";
 
 # URI of default stylesheet
-our $stylesheet = "@@GITWEB_CSS@@";
+our $stylesheet = "++GITWEB_CSS++";
 # URI of GIT logo
-our $logo = "@@GITWEB_LOGO@@";
+our $logo = "++GITWEB_LOGO++";
 
 # source of projects list
-our $projects_list = "@@GITWEB_LIST@@";
+our $projects_list = "++GITWEB_LIST++";
 
 # default blob_plain mimetype and default charset for text/plain blob
 our $default_blob_plain_mimetype = 'text/plain';
@@ -60,7 +60,7 @@ # file to use for guessing MIME types be
 # (relative to the current git repository)
 our $mimetypes_file = undef;
 
-our $GITWEB_CONFIG = "@@GITWEB_CONFIG@@";
+our $GITWEB_CONFIG = "++GITWEB_CONFIG++";
 require $GITWEB_CONFIG if -e $GITWEB_CONFIG;
 
 if (defined($ENV{'GITWEB_CONFIG'}) && -e $ENV{'GITWEB_CONFIG'}) {
-- 
1.4.2.rc2.g767b2

  reply	other threads:[~2006-08-02 20:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-02 19:23 [PATCH] gitweb: optionally read config from GITWEB_CONFIG Jeff King
2006-08-02 20:17 ` [PATCH] gitweb: use single quotes for values replaced by the Makefile Matthias Lederhofer
2006-08-02 20:50   ` Junio C Hamano [this message]
2006-08-02 20:57     ` Matthias Lederhofer
2006-08-02 20:58     ` Jeff King
2006-08-02 20:21 ` [PATCH] gitweb: optionally read config from GITWEB_CONFIG Jakub Narebski
2006-08-02 20:31   ` Matthias Lederhofer
2006-08-02 20:36     ` Jakub Narebski
2006-08-02 20:41   ` Jeff King
2006-08-02 20:28 ` Junio C Hamano
2006-08-02 20:29 ` [PATCH] gitweb: require $ENV{'GITWEB_CONFIG'} Matthias Lederhofer
2006-08-02 20:50   ` Jeff King
2006-08-02 20:58     ` Junio C Hamano
2006-08-02 20:59       ` Jeff King
2006-08-02 20:51 ` [PATCH] gitweb: optionally read config from GITWEB_CONFIG Luben Tuikov
2006-08-02 20:56   ` Jeff King

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

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

  git send-email \
    --in-reply-to=7vmzamuaj6.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox