{"thread":{"id":"5051","subject":"[PATCH] gitweb: fill in gitweb configuration by Makefile","startedAt":"2006-07-30T22:37:54Z","lastAt":"2006-08-01T19:34:08Z","messageCount":13,"participants":["Martin Waitz","Junio C Hamano","Luben Tuikov","Jakub Narebski","Johannes Schindelin","Jon Loeliger"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"24391","messageId":"20060730223754.GA16364@admingilde.org","threadId":"5051","inReplyTo":null,"subject":"[PATCH] gitweb: fill in gitweb configuration by Makefile","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2006-07-30T22:37:54Z","receivedAt":"2006-07-30T22:37:54Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"Generate gitweb/gitweb.cgi to reduce the need to patch gitweb.cgi by\nthe end user.\nThe GIT installation directory and version are already known by the\nMakefile, they can be inserted directly into gitweb.\nAll other gitweb configuration parameters can now be specified\nby providing GITWEB_* variables while building GIT.\nThese are described in gitweb/README.\n\nSigned-off-by: Martin Waitz <tali@admingilde.org>\n---\n Makefile                         |   25 +++++++++++++++++++++++--\n gitweb/.gitignore                |    1 +\n gitweb/README                    |   17 +++++++++++++++++\n gitweb/{gitweb.cgi => gitweb.pl} |   15 +++++++--------\n 4 files changed, 48 insertions(+), 10 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 8349e3defacca69ae48c477ff99be527b9af3b77..bd59d6b58d1cfcaecd033f186d7c2cc537416b75 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -116,6 +116,13 @@ template_dir = $(prefix)/share/git-core/\n GIT_PYTHON_DIR = $(prefix)/share/git-core/python\n # DESTDIR=\n \n+# default configuration for gitweb\n+GITWEB_SITENAME = \n+GITWEB_PROJECTROOT = /pub/git\n+GITWEB_LIST = \n+GITWEB_HOMETEXT = indextext.html\n+GITWEB_CSS = gitweb.css\n+\n export prefix bindir gitexecdir template_dir GIT_PYTHON_DIR\n \n CC = gcc\n@@ -509,7 +516,7 @@ LIB_OBJS += $(COMPAT_OBJS)\n export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir\n ### Build rules\n \n-all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk\n+all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi\n \n all:\n \t$(MAKE) -C templates\n@@ -567,6 +574,20 @@ git-status: git-commit\n \tcp $< $@+\n \tmv $@+ $@\n \n+gitweb/gitweb.cgi: gitweb/gitweb.pl\n+\trm -f $@ $@+\n+\tsed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n+\t    -e 's|@@GIT_VERSION@@|$(GIT_VERSION)|g' \\\n+\t    -e 's|@@GIT_BINDIR@@|$(bindir)|g' \\\n+\t    -e 's|@@GITWEB_SITENAME@@|$(GITWEB_SITENAME)|g' \\\n+\t    -e 's|@@GITWEB_PROJECTROOT@@|$(GITWEB_PROJECTROOT)|g' \\\n+\t    -e 's|@@GITWEB_LIST@@|$(GITWEB_LIST)|g' \\\n+\t    -e 's|@@GITWEB_HOMETEXT@@|$(GITWEB_HOMETEXT)|g' \\\n+\t    -e 's|@@GITWEB_CSS@@|$(GITWEB_CSS)|g' \\\n+\t    $< >$@+\n+\tchmod +x $@+\n+\tmv $@+ $@\n+\n git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css\n \trm -f $@ $@+\n \tsed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n@@ -577,7 +598,7 @@ git-instaweb: git-instaweb.sh gitweb/git\n \t    -e '/@@GITWEB_CGI@@/d' \\\n \t    -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \\\n \t    -e '/@@GITWEB_CSS@@/d' \\\n-\t    $@.sh | sed \"s|/usr/bin/git|$(bindir)/git|\" > $@+\n+\t    $@.sh > $@+\n \tchmod +x $@+\n \tmv $@+ $@\n \ndiff --git a/gitweb/.gitignore b/gitweb/.gitignore\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..e83127e3f09f8496d0cd07b8f632ff341c96fd00\n--- /dev/null\n+++ b/gitweb/.gitignore\n@@ -0,0 +1 @@\n+gitweb.cgi\ndiff --git a/gitweb/README b/gitweb/README\nindex 8d672762eab427f3b732626d6b3f8e05a7e8f8c9..ed939e2fb5264cce24e770272583b12372c3ab68 100644\n--- a/gitweb/README\n+++ b/gitweb/README\n@@ -5,5 +5,22 @@ The one working on:\n \n From the git version 1.4.0 gitweb is bundled with git.\n \n+\n+How to configure gitweb for your local system:\n+\n+You can specify the following configuration variables when building GIT:\n+ * GITWEB_SITENAME\n+   Shown in the title of all generated pages, defaults to the servers name.\n+ * GITWEB_PROJECTROOT\n+   The root directory for all projects shown by gitweb.\n+ * GITWEB_LIST\n+   points to a directory to scan for projects (defaults to project root)\n+   or to a file for explicit listing of projects.\n+ * GITWEB_HOMETEXT\n+   points to an .html file which is included on the gitweb project\n+   overview page.\n+ * GITWEB_CSS\n+   Points to the location where you put gitweb.css on your web server.\n+\n Any comment/question/concern to:\n   Kay Sievers <kay.sievers@vrfy.org>\ndiff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.pl\nsimilarity index 100%\nrename from gitweb/gitweb.cgi\nrename to gitweb/gitweb.pl\nindex 243a2921f849568260e848201d238b3b9fe7e1f2..8e05c335f801d4c52a9b348fa56fccfae36ce621 100755\n--- a/gitweb/gitweb.cgi\n+++ b/gitweb/gitweb.pl\n@@ -24,14 +24,14 @@ our $rss_link = \"\";\n \n # core git executable to use\n # this can just be \"git\" if your webserver has a sensible PATH\n-our $GIT = \"/usr/bin/git\";\n+our $GIT = \"@@GIT_BINDIR@@/git\";\n \n # absolute fs-path which will be prepended to the project path\n #our $projectroot = \"/pub/scm\";\n-our $projectroot = \"/home/kay/public_html/pub/scm\";\n+our $projectroot = \"@@GITWEB_PROJECTROOT@@\";\n \n # version of the core git binary\n-our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : \"unknown\";\n+our $git_version = \"@@GIT_VERSION@@\";\n \n # location for temporary files needed for diffs\n our $git_temp = \"/tmp/gitweb\";\n@@ -44,17 +44,16 @@ our $home_link = $my_uri;\n \n # name of your site or organization to appear in page titles\n # replace this with something more descriptive for clearer bookmarks\n-our $site_name = $ENV{'SERVER_NAME'} || \"Untitled\";\n+our $site_name = \"@@GITWEB_SITENAME@@\" || $ENV{'SERVER_NAME'} || \"Untitled\";\n \n # html text to include at home page\n-our $home_text = \"indextext.html\";\n+our $home_text = \"@@GITWEB_HOMETEXT@@\";\n \n # URI of default stylesheet\n-our $stylesheet = \"gitweb.css\";\n+our $stylesheet = \"@@GITWEB_CSS@@\";\n \n # source of projects list\n-#our $projects_list = $projectroot;\n-our $projects_list = \"index/index.aux\";\n+our $projects_list = \"@@GITWEB_LIST@@\" || \"$projectroot\";\n \n # default blob_plain mimetype and default charset for text/plain blob\n our $default_blob_plain_mimetype = 'text/plain';\n-- \n1.4.2.rc2.gf055\n\n-- \nMartin Waitz\n"},{"id":"24402","messageId":"7vzmeqa7tx.fsf@assigned-by-dhcp.cox.net","threadId":"5051","inReplyTo":"20060730223754.GA16364@admingilde.org","subject":"Re: [PATCH] gitweb: fill in gitweb configuration by Makefile","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-31T01:20:26Z","receivedAt":"2006-07-31T01:20:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Waitz <tali@admingilde.org> writes:\n\n> diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.pl\n> similarity index 100%\n> rename from gitweb/gitweb.cgi\n> rename to gitweb/gitweb.pl\n> index 243a2921f849568260e848201d238b3b9fe7e1f2..8e05c335f801d4c52a9b348fa56fccfae36ce621 100755\n> --- a/gitweb/gitweb.cgi\n> +++ b/gitweb/gitweb.pl\n> @@ -24,14 +24,14 @@ our $rss_link = \"\";\n>  \n>  # core git executable to use\n>  # this can just be \"git\" if your webserver has a sensible PATH\n> -our $GIT = \"/usr/bin/git\";\n> +our $GIT = \"@@GIT_BINDIR@@/git\";\n>  \n>  # absolute fs-path which will be prepended to the project path\n>  #our $projectroot = \"/pub/scm\";\n> -our $projectroot = \"/home/kay/public_html/pub/scm\";\n> +our $projectroot = \"@@GITWEB_PROJECTROOT@@\";\n>  \n>  # version of the core git binary\n> -our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : \"unknown\";\n> +our $git_version = \"@@GIT_VERSION@@\";\n\nI think the other parts are sensible but I am not sure if we\nwant to report the version of git distribution (your patch), or\nthe version of git binary the cgi script happens to use (the\ncurrent implementation).\n"},{"id":"24403","messageId":"20060731035737.24181.qmail@web31803.mail.mud.yahoo.com","threadId":"5051","inReplyTo":"20060730223754.GA16364@admingilde.org","subject":"Re: [PATCH] gitweb: fill in gitweb configuration by Makefile","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-07-31T03:57:37Z","receivedAt":"2006-07-31T03:57:37Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Martin Waitz <tali@admingilde.org> wrote:\n> Generate gitweb/gitweb.cgi to reduce the need to patch gitweb.cgi by\n> the end user.\n> The GIT installation directory and version are already known by the\n> Makefile, they can be inserted directly into gitweb.\n> All other gitweb configuration parameters can now be specified\n> by providing GITWEB_* variables while building GIT.\n> These are described in gitweb/README.\n\nNACK.\n\nI don't like it.  While this method works, it is too much effort\nto have to run make to do this, plus it pollutes your tree.\n\nInstead, what you can do is make gitweb.cgi read a text file\nfrom . which has those variables defined.\n\nThis way, I can just copy gitweb.cgi into my web-server directory\nand voila it works, since the variable definition file would\nalways be there.  This way:\n  - no need to run make to build \"gitweb.cgi\" or \"gitweb.pl\" whatever\n    you call it,\n  - no need to pollute your tree with site defined variables,\n  - simple copy (cp) would install a working version, instead of\n    the current cp + patch with local settings method.\n\n   Luben\n\n\n> \n> Signed-off-by: Martin Waitz <tali@admingilde.org>\n> ---\n>  Makefile                         |   25 +++++++++++++++++++++++--\n>  gitweb/.gitignore                |    1 +\n>  gitweb/README                    |   17 +++++++++++++++++\n>  gitweb/{gitweb.cgi => gitweb.pl} |   15 +++++++--------\n>  4 files changed, 48 insertions(+), 10 deletions(-)\n> \n> diff --git a/Makefile b/Makefile\n> index 8349e3defacca69ae48c477ff99be527b9af3b77..bd59d6b58d1cfcaecd033f186d7c2cc537416b75 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -116,6 +116,13 @@ template_dir = $(prefix)/share/git-core/\n>  GIT_PYTHON_DIR = $(prefix)/share/git-core/python\n>  # DESTDIR=\n>  \n> +# default configuration for gitweb\n> +GITWEB_SITENAME = \n> +GITWEB_PROJECTROOT = /pub/git\n> +GITWEB_LIST = \n> +GITWEB_HOMETEXT = indextext.html\n> +GITWEB_CSS = gitweb.css\n> +\n>  export prefix bindir gitexecdir template_dir GIT_PYTHON_DIR\n>  \n>  CC = gcc\n> @@ -509,7 +516,7 @@ LIB_OBJS += $(COMPAT_OBJS)\n>  export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir\n>  ### Build rules\n>  \n> -all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk\n> +all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi\n>  \n>  all:\n>  \t$(MAKE) -C templates\n> @@ -567,6 +574,20 @@ git-status: git-commit\n>  \tcp $< $@+\n>  \tmv $@+ $@\n>  \n> +gitweb/gitweb.cgi: gitweb/gitweb.pl\n> +\trm -f $@ $@+\n> +\tsed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n> +\t    -e 's|@@GIT_VERSION@@|$(GIT_VERSION)|g' \\\n> +\t    -e 's|@@GIT_BINDIR@@|$(bindir)|g' \\\n> +\t    -e 's|@@GITWEB_SITENAME@@|$(GITWEB_SITENAME)|g' \\\n> +\t    -e 's|@@GITWEB_PROJECTROOT@@|$(GITWEB_PROJECTROOT)|g' \\\n> +\t    -e 's|@@GITWEB_LIST@@|$(GITWEB_LIST)|g' \\\n> +\t    -e 's|@@GITWEB_HOMETEXT@@|$(GITWEB_HOMETEXT)|g' \\\n> +\t    -e 's|@@GITWEB_CSS@@|$(GITWEB_CSS)|g' \\\n> +\t    $< >$@+\n> +\tchmod +x $@+\n> +\tmv $@+ $@\n> +\n>  git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css\n>  \trm -f $@ $@+\n>  \tsed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n> @@ -577,7 +598,7 @@ git-instaweb: git-instaweb.sh gitweb/git\n>  \t    -e '/@@GITWEB_CGI@@/d' \\\n>  \t    -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \\\n>  \t    -e '/@@GITWEB_CSS@@/d' \\\n> -\t    $@.sh | sed \"s|/usr/bin/git|$(bindir)/git|\" > $@+\n> +\t    $@.sh > $@+\n>  \tchmod +x $@+\n>  \tmv $@+ $@\n>  \n> diff --git a/gitweb/.gitignore b/gitweb/.gitignore\n> new file mode 100644\n> index 0000000000000000000000000000000000000000..e83127e3f09f8496d0cd07b8f632ff341c96fd00\n> --- /dev/null\n> +++ b/gitweb/.gitignore\n> @@ -0,0 +1 @@\n> +gitweb.cgi\n> diff --git a/gitweb/README b/gitweb/README\n> index 8d672762eab427f3b732626d6b3f8e05a7e8f8c9..ed939e2fb5264cce24e770272583b12372c3ab68 100644\n> --- a/gitweb/README\n> +++ b/gitweb/README\n> @@ -5,5 +5,22 @@ The one working on:\n>  \n>  From the git version 1.4.0 gitweb is bundled with git.\n>  \n> +\n> +How to configure gitweb for your local system:\n> +\n> +You can specify the following configuration variables when building GIT:\n> + * GITWEB_SITENAME\n> +   Shown in the title of all generated pages, defaults to the servers name.\n> + * GITWEB_PROJECTROOT\n> +   The root directory for all projects shown by gitweb.\n> + * GITWEB_LIST\n> +   points to a directory to scan for projects (defaults to project root)\n> +   or to a file for explicit listing of projects.\n> + * GITWEB_HOMETEXT\n> +   points to an .html file which is included on the gitweb project\n> +   overview page.\n> + * GITWEB_CSS\n> +   Points to the location where you put gitweb.css on your web server.\n> +\n>  Any comment/question/concern to:\n>    Kay Sievers <kay.sievers@vrfy.org>\n> diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.pl\n> similarity index 100%\n> rename from gitweb/gitweb.cgi\n> rename to gitweb/gitweb.pl\n> index 243a2921f849568260e848201d238b3b9fe7e1f2..8e05c335f801d4c52a9b348fa56fccfae36ce621 100755\n> --- a/gitweb/gitweb.cgi\n> +++ b/gitweb/gitweb.pl\n> @@ -24,14 +24,14 @@ our $rss_link = \"\";\n>  \n>  # core git executable to use\n>  # this can just be \"git\" if your webserver has a sensible PATH\n> -our $GIT = \"/usr/bin/git\";\n> +our $GIT = \"@@GIT_BINDIR@@/git\";\n>  \n>  # absolute fs-path which will be prepended to the project path\n>  #our $projectroot = \"/pub/scm\";\n> -our $projectroot = \"/home/kay/public_html/pub/scm\";\n> +our $projectroot = \"@@GITWEB_PROJECTROOT@@\";\n>  \n>  # version of the core git binary\n> -our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : \"unknown\";\n> +our $git_version = \"@@GIT_VERSION@@\";\n>  \n>  # location for temporary files needed for diffs\n>  our $git_temp = \"/tmp/gitweb\";\n> @@ -44,17 +44,16 @@ our $home_link = $my_uri;\n>  \n>  # name of your site or organization to appear in page titles\n>  # replace this with something more descriptive for clearer bookmarks\n> -our $site_name = $ENV{'SERVER_NAME'} || \"Untitled\";\n> +our $site_name = \"@@GITWEB_SITENAME@@\" || $ENV{'SERVER_NAME'} || \"Untitled\";\n>  \n>  # html text to include at home page\n> -our $home_text = \"indextext.html\";\n> +our $home_text = \"@@GITWEB_HOMETEXT@@\";\n>  \n>  # URI of default stylesheet\n> -our $stylesheet = \"gitweb.css\";\n> +our $stylesheet = \"@@GITWEB_CSS@@\";\n>  \n>  # source of projects list\n> -#our $projects_list = $projectroot;\n> -our $projects_list = \"index/index.aux\";\n> +our $projects_list = \"@@GITWEB_LIST@@\" || \"$projectroot\";\n>  \n>  # default blob_plain mimetype and default charset for text/plain blob\n>  our $default_blob_plain_mimetype = 'text/plain';\n> -- \n> 1.4.2.rc2.gf055\n> \n> -- \n> Martin Waitz\n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n"},{"id":"24407","messageId":"7vslki9sy9.fsf@assigned-by-dhcp.cox.net","threadId":"5051","inReplyTo":"20060731035737.24181.qmail@web31803.mail.mud.yahoo.com","subject":"Re: [PATCH] gitweb: fill in gitweb configuration by Makefile","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-31T06:41:50Z","receivedAt":"2006-07-31T06:41:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"-\nLuben Tuikov <ltuikov@yahoo.com> writes:\n\n> -- Martin Waitz <tali@admingilde.org> wrote:\n>> Generate gitweb/gitweb.cgi to reduce the need to patch gitweb.cgi by\n>> the end user.\n>> The GIT installation directory and version are already known by the\n>> Makefile, they can be inserted directly into gitweb.\n>> All other gitweb configuration parameters can now be specified\n>> by providing GITWEB_* variables while building GIT.\n>> These are described in gitweb/README.\n>\n> NACK.\n>\n> I don't like it.  While this method works, it is too much effort\n> to have to run make to do this, plus it pollutes your tree.\n\nI do not quite agree with this reasoning.  With that definition\nof \"polluting your tree\", all build of git-*.{sh,perl,py} are\npolluting your tree.  If compile/install time customization is\nhandier I do not have problem doing it that way.\n\n> Instead, what you can do is make gitweb.cgi read a text file\n> from . which has those variables defined.\n\nI think there was a discussion on having a configuration file\nfor gitweb (not per-repository .git/config but installation wide\nconfiguration file).  If I recall correctly, the killer argument\nagainst it was that you would need to bootstrap the process by\nsomehow telling gitweb.cgi where to read from that configuration\nfile, and if you are going to customize gitweb.cgi before\ninstallation for the site that way, then giving a bit more\nconfiguration in gitweb.cgi (like Martin did in the patch we are\ndiscussion) is simpler.\n\n>   - no need to run make to build \"gitweb.cgi\" or \"gitweb.pl\" whatever\n>     you call it,\n>   - no need to pollute your tree with site defined variables,\n>   - simple copy (cp) would install a working version, instead of\n>     the current cp + patch with local settings method.\n\nWhile I agree all of these \"no need to\" makes things slightly\nsimpler, I do not think it is such a big deal -- we are building\ngit-*.{sh,perl,py,c} anyway.\n"},{"id":"24409","messageId":"eak9hf$hv2$1@sea.gmane.org","threadId":"5051","inReplyTo":"20060730223754.GA16364@admingilde.org","subject":"Re: [PATCH] gitweb: fill in gitweb configuration by Makefile","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-07-31T06:55:57Z","receivedAt":"2006-07-31T06:55:57Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Martin Waitz wrote:\n\n>  gitweb/{gitweb.cgi => gitweb.pl} |   15 +++++++--------\n[...]\n> diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.pl\n> similarity index 100%\n> rename from gitweb/gitweb.cgi\n> rename to gitweb/gitweb.pl\n> index 243a2921f849568260e848201d238b3b9fe7e1f2..8e05c335f801d4c52a9b348fa56fccfae36ce621 100755\n> --- a/gitweb/gitweb.cgi\n> +++ b/gitweb/gitweb.pl\n\nShouldn't we use .perl suffix, i.e. gitweb.perl, like almost all\nother Perl files in git distribution (the exception is \nDocumentation/sort_glossary.pl which never get installed).\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"24411","messageId":"20060731070819.GD16364@admingilde.org","threadId":"5051","inReplyTo":"7vzmeqa7tx.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb: fill in gitweb configuration by Makefile","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2006-07-31T07:08:19Z","receivedAt":"2006-07-31T07:08:19Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Sun, Jul 30, 2006 at 06:20:26PM -0700, Junio C Hamano wrote:\n> I think the other parts are sensible but I am not sure if we\n> want to report the version of git distribution (your patch), or\n> the version of git binary the cgi script happens to use (the\n> current implementation).\n\nhmm, right.\nWell, now that gitweb is included with GIT I think that they will\nbe in sync on many sites, but of course that's not guaranteed.\n\nShall I send a new patch without that change?\n\n-- \nMartin Waitz\n"},{"id":"24413","messageId":"20060731072200.GE16364@admingilde.org","threadId":"5051","inReplyTo":"20060731035737.24181.qmail@web31803.mail.mud.yahoo.com","subject":"Re: [PATCH] gitweb: fill in gitweb configuration by Makefile","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2006-07-31T07:22:00Z","receivedAt":"2006-07-31T07:22:00Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nthanks for the feedback!\n\n> I don't like it.  While this method works, it is too much effort\n> to have to run make to do this, plus it pollutes your tree.\n\nDo you really think it is that much effort?\nWhat do others think? alternatives?\n\n> Instead, what you can do is make gitweb.cgi read a text file\n> from . which has those variables defined.\n\nI don't really care if it is a configuration file or a build-time\nconfiguration, but I need something now.\nIf you submit your proposal, we can compare both and choose the best\none ;-).\n\n> This way, I can just copy gitweb.cgi into my web-server directory\n> and voila it works, since the variable definition file would\n> always be there.  This way:\n>   - no need to run make to build \"gitweb.cgi\" or \"gitweb.pl\" whatever\n>     you call it,\n\nok, but you have to call make anyway to build the rest of GIT,\nso this shouldn't be a big problem.\n\n>   - no need to pollute your tree with site defined variables,\n\nthis is achieved by my patch, too.\n\n>   - simple copy (cp) would install a working version, instead of\n>     the current cp + patch with local settings method.\n\nthis is achieved by my patch, too.\n\n-- \nMartin Waitz\n"},{"id":"24414","messageId":"eakc16$p77$1@sea.gmane.org","threadId":"5051","inReplyTo":"20060731070819.GD16364@admingilde.org","subject":"Re: [PATCH] gitweb: fill in gitweb configuration by Makefile","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-07-31T07:38:26Z","receivedAt":"2006-07-31T07:38:26Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Martin Waitz wrote:\n\n> On Sun, Jul 30, 2006 at 06:20:26PM -0700, Junio C Hamano wrote:\n>>\n>> I think the other parts are sensible but I am not sure if we\n>> want to report the version of git distribution (your patch), or\n>> the version of git binary the cgi script happens to use (the\n>> current implementation).\n> \n> hmm, right.\n> Well, now that gitweb is included with GIT I think that they will\n> be in sync on many sites, but of course that's not guaranteed.\n> \n> Shall I send a new patch without that change?\n\nThere are currently two version variables in gitweb: the version of the\nscript, and the version of git binaries used. They might be different.\nBut now that gitweb is bundled with git, perhaps we could use compile-time\ngit version as gitweb version, i.e. \n\n  our $version = \"@@GIT_VERSION@@\";\n\nwhile leaving $git_version as is, i.e.\n\n  our $git_version = \n    qx($GIT --version) =~ m/git version (.*)$/ ? $1 : \"unknown\"\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"24415","messageId":"20060731081428.17416.qmail@web31807.mail.mud.yahoo.com","threadId":"5051","inReplyTo":"7vzmeqa7tx.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb: fill in gitweb configuration by Makefile","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-07-31T08:14:28Z","receivedAt":"2006-07-31T08:14:28Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Junio C Hamano <junkio@cox.net> wrote:\n> Martin Waitz <tali@admingilde.org> writes:\n> \n> > diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.pl\n> > similarity index 100%\n> > rename from gitweb/gitweb.cgi\n> > rename to gitweb/gitweb.pl\n> > index 243a2921f849568260e848201d238b3b9fe7e1f2..8e05c335f801d4c52a9b348fa56fccfae36ce621\n> 100755\n> > --- a/gitweb/gitweb.cgi\n> > +++ b/gitweb/gitweb.pl\n> > @@ -24,14 +24,14 @@ our $rss_link = \"\";\n> >  \n> >  # core git executable to use\n> >  # this can just be \"git\" if your webserver has a sensible PATH\n> > -our $GIT = \"/usr/bin/git\";\n> > +our $GIT = \"@@GIT_BINDIR@@/git\";\n> >  \n> >  # absolute fs-path which will be prepended to the project path\n> >  #our $projectroot = \"/pub/scm\";\n> > -our $projectroot = \"/home/kay/public_html/pub/scm\";\n> > +our $projectroot = \"@@GITWEB_PROJECTROOT@@\";\n> >  \n> >  # version of the core git binary\n> > -our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : \"unknown\";\n> > +our $git_version = \"@@GIT_VERSION@@\";\n> \n> I think the other parts are sensible but I am not sure if we\n> want to report the version of git distribution (your patch), or\n> the version of git binary the cgi script happens to use (the\n> current implementation).\n\nI'd rather see git distribution (Martin's patch) since, after all,\ngitweb became part of git not so long ago.  And as thus, its own\nnumbers don't matter much, but the git distribution.\n\nIn fact, I was thinking of submitting a patch to the same effect\nmyself.\n\n    Luben\n"},{"id":"24420","messageId":"Pine.LNX.4.63.0607311137360.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5051","inReplyTo":"20060731072200.GE16364@admingilde.org","subject":"Re: [PATCH] gitweb: fill in gitweb configuration by Makefile","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-31T09:38:15Z","receivedAt":"2006-07-31T09:38:15Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 31 Jul 2006, Martin Waitz wrote:\n\n> > I don't like it.  While this method works, it is too much effort\n> > to have to run make to do this, plus it pollutes your tree.\n> \n> Do you really think it is that much effort?\n> What do others think? alternatives?\n\nI think it is worth it, and it is cleaner. The only drawback: we have to \nstuff it somehow into git-instaweb...\n\nCiao,\nDscho\n"},{"id":"24440","messageId":"20060731165904.78929.qmail@web31815.mail.mud.yahoo.com","threadId":"5051","inReplyTo":"20060731072200.GE16364@admingilde.org","subject":"Re: [PATCH] gitweb: fill in gitweb configuration by Makefile","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-07-31T16:59:04Z","receivedAt":"2006-07-31T16:59:04Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Martin Waitz <tali@admingilde.org> wrote:\n> > This way, I can just copy gitweb.cgi into my web-server directory\n> > and voila it works, since the variable definition file would\n> > always be there.  This way:\n> >   - no need to run make to build \"gitweb.cgi\" or \"gitweb.pl\" whatever\n> >     you call it,\n> \n> ok, but you have to call make anyway to build the rest of GIT,\n> so this shouldn't be a big problem.\n> \n> >   - no need to pollute your tree with site defined variables,\n> \n> this is achieved by my patch, too.\n> \n> >   - simple copy (cp) would install a working version, instead of\n> >     the current cp + patch with local settings method.\n> \n> this is achieved by my patch, too.\n\nThat's true, but the difference is that one needs to keep\na per-site-installation tree which keeps the configuration of\ngitweb for that site (installation).\n\nSince you're working on this, can you come up with an alternative way?\nAt this point I don't care either way, but _if_ there is an alternative\nway, I'd rather we considered it.  (Possibly using a symbol table file\n(\"package\") to only keep those variables?)\n\nThe bash-sed editing is kind of, you have to admit, hackish.\n\n   Luben\n"},{"id":"24461","messageId":"1154381594.5107.55.camel@cashmere.sps.mot.com","threadId":"5051","inReplyTo":"20060731035737.24181.qmail@web31803.mail.mud.yahoo.com","subject":"Re: [PATCH] gitweb: fill in gitweb configuration by Makefile","fromName":"Jon Loeliger","fromEmail":"jdl@freescale.com","sentAt":"2006-07-31T21:33:14Z","receivedAt":"2006-07-31T21:33:14Z","isPatch":true,"sender":{"key":"jdl@jdl.com","avatar":"https://gravatar.com/avatar/75ce9a10b151acd2c28ec4ab2136dba7b2ff1634530bd04b155981a749d08a64?d=mp&s=160"},"body":"On Sun, 2006-07-30 at 22:57, Luben Tuikov wrote:\n> --- Martin Waitz <tali@admingilde.org> wrote:\n> > Generate gitweb/gitweb.cgi to reduce the need to patch gitweb.cgi by\n> > the end user.\n> > The GIT installation directory and version are already known by the\n> > Makefile, they can be inserted directly into gitweb.\n> > All other gitweb configuration parameters can now be specified\n> > by providing GITWEB_* variables while building GIT.\n> > These are described in gitweb/README.\n> \n> NACK.\n> \n> I don't like it.  While this method works, it is too much effort\n> to have to run make to do this, plus it pollutes your tree.\n> \n> Instead, what you can do is make gitweb.cgi read a text file\n> from . which has those variables defined.\n> \n> This way, I can just copy gitweb.cgi into my web-server directory\n> and voila it works, since the variable definition file would\n> always be there.  This way:\n>   - no need to run make to build \"gitweb.cgi\" or \"gitweb.pl\" whatever\n>     you call it,\n>   - no need to pollute your tree with site defined variables,\n>   - simple copy (cp) would install a working version, instead of\n>     the current cp + patch with local settings method.\n> \n>    Luben\n\nWhich sounds frighteningly similar to a patch I submitted\nquite a while ago, and brought up again twice, and have\nhad stomped on once.\n\nSo what now? :-)\n\njdl\n"},{"id":"24524","messageId":"20060801193408.GF16364@admingilde.org","threadId":"5051","inReplyTo":"eakc16$p77$1@sea.gmane.org","subject":"Re: [PATCH] gitweb: fill in gitweb configuration by Makefile","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2006-08-01T19:34:08Z","receivedAt":"2006-08-01T19:34:08Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Mon, Jul 31, 2006 at 09:38:26AM +0200, Jakub Narebski wrote:\n> There are currently two version variables in gitweb: the version of the\n> script, and the version of git binaries used. They might be different.\n> But now that gitweb is bundled with git, perhaps we could use compile-time\n> git version as gitweb version\n\nupdated patch below:\n\n+++\nGenerate gitweb/gitweb.cgi to reduce the need to patch gitweb.cgi by\nthe end user.\nThe GIT installation directory is already known by the Makefile, and can be\ninserted directly into gitweb.\nAll other gitweb configuration parameters can now be specified by providing\nGITWEB_* variables while building GIT.  These are described in gitweb/README.\n\nSigned-off-by: Martin Waitz <tali@admingilde.org>\n---\n Makefile                         |   25 +++++++++++++++++++++++--\n gitweb/.gitignore                |    1 +\n gitweb/README                    |   17 +++++++++++++++++\n gitweb/{gitweb.cgi => gitweb.pl} |   15 +++++++--------\n 4 files changed, 48 insertions(+), 10 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 15864e2..0d66c6a 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -116,6 +116,13 @@ template_dir = $(prefix)/share/git-core/\n GIT_PYTHON_DIR = $(prefix)/share/git-core/python\n # DESTDIR=\n \n+# default configuration for gitweb\n+GITWEB_SITENAME = \n+GITWEB_PROJECTROOT = /pub/git\n+GITWEB_LIST = \n+GITWEB_HOMETEXT = indextext.html\n+GITWEB_CSS = gitweb.css\n+\n export prefix bindir gitexecdir template_dir GIT_PYTHON_DIR\n \n CC = gcc\n@@ -514,7 +521,7 @@ LIB_OBJS += $(COMPAT_OBJS)\n export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir\n ### Build rules\n \n-all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk\n+all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi\n \n all:\n \t$(MAKE) -C templates\n@@ -572,6 +579,20 @@ git-status: git-commit\n \tcp $< $@+\n \tmv $@+ $@\n \n+gitweb/gitweb.cgi: gitweb/gitweb.pl\n+\trm -f $@ $@+\n+\tsed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \\\n+\t    -e 's|@@GIT_VERSION@@|$(GIT_VERSION)|g' \\\n+\t    -e 's|@@GIT_BINDIR@@|$(bindir)|g' \\\n+\t    -e 's|@@GITWEB_SITENAME@@|$(GITWEB_SITENAME)|g' \\\n+\t    -e 's|@@GITWEB_PROJECTROOT@@|$(GITWEB_PROJECTROOT)|g' \\\n+\t    -e 's|@@GITWEB_LIST@@|$(GITWEB_LIST)|g' \\\n+\t    -e 's|@@GITWEB_HOMETEXT@@|$(GITWEB_HOMETEXT)|g' \\\n+\t    -e 's|@@GITWEB_CSS@@|$(GITWEB_CSS)|g' \\\n+\t    $< >$@+\n+\tchmod +x $@+\n+\tmv $@+ $@\n+\n git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css\n \trm -f $@ $@+\n \tsed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n@@ -582,7 +603,7 @@ git-instaweb: git-instaweb.sh gitweb/git\n \t    -e '/@@GITWEB_CGI@@/d' \\\n \t    -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \\\n \t    -e '/@@GITWEB_CSS@@/d' \\\n-\t    $@.sh | sed \"s|/usr/bin/git|$(bindir)/git|\" > $@+\n+\t    $@.sh > $@+\n \tchmod +x $@+\n \tmv $@+ $@\n \ndiff --git a/gitweb/.gitignore b/gitweb/.gitignore\nnew file mode 100644\nindex 0000000..e83127e\n--- /dev/null\n+++ b/gitweb/.gitignore\n@@ -0,0 +1 @@\n+gitweb.cgi\ndiff --git a/gitweb/README b/gitweb/README\nindex 8d67276..ed939e2 100644\n--- a/gitweb/README\n+++ b/gitweb/README\n@@ -5,5 +5,22 @@ The one working on:\n \n From the git version 1.4.0 gitweb is bundled with git.\n \n+\n+How to configure gitweb for your local system:\n+\n+You can specify the following configuration variables when building GIT:\n+ * GITWEB_SITENAME\n+   Shown in the title of all generated pages, defaults to the servers name.\n+ * GITWEB_PROJECTROOT\n+   The root directory for all projects shown by gitweb.\n+ * GITWEB_LIST\n+   points to a directory to scan for projects (defaults to project root)\n+   or to a file for explicit listing of projects.\n+ * GITWEB_HOMETEXT\n+   points to an .html file which is included on the gitweb project\n+   overview page.\n+ * GITWEB_CSS\n+   Points to the location where you put gitweb.css on your web server.\n+\n Any comment/question/concern to:\n   Kay Sievers <kay.sievers@vrfy.org>\ndiff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.pl\nsimilarity index 100%\nrename from gitweb/gitweb.cgi\nrename to gitweb/gitweb.pl\nindex e5fca63..20dd901 100755\n--- a/gitweb/gitweb.cgi\n+++ b/gitweb/gitweb.pl\n@@ -17,18 +17,18 @@ use Fcntl ':mode';\n binmode STDOUT, ':utf8';\n \n our $cgi = new CGI;\n-our $version = \"267\";\n+our $version = \"@@GIT_VERSION@@\";\n our $my_url = $cgi->url();\n our $my_uri = $cgi->url(-absolute => 1);\n our $rss_link = \"\";\n \n # core git executable to use\n # this can just be \"git\" if your webserver has a sensible PATH\n-our $GIT = \"/usr/bin/git\";\n+our $GIT = \"@@GIT_BINDIR@@/git\";\n \n # absolute fs-path which will be prepended to the project path\n #our $projectroot = \"/pub/scm\";\n-our $projectroot = \"/home/kay/public_html/pub/scm\";\n+our $projectroot = \"@@GITWEB_PROJECTROOT@@\";\n \n # version of the core git binary\n our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : \"unknown\";\n@@ -44,17 +44,16 @@ our $home_link = $my_uri;\n \n # name of your site or organization to appear in page titles\n # replace this with something more descriptive for clearer bookmarks\n-our $site_name = $ENV{'SERVER_NAME'} || \"Untitled\";\n+our $site_name = \"@@GITWEB_SITENAME@@\" || $ENV{'SERVER_NAME'} || \"Untitled\";\n \n # html text to include at home page\n-our $home_text = \"indextext.html\";\n+our $home_text = \"@@GITWEB_HOMETEXT@@\";\n \n # URI of default stylesheet\n-our $stylesheet = \"gitweb.css\";\n+our $stylesheet = \"@@GITWEB_CSS@@\";\n \n # source of projects list\n-#our $projects_list = $projectroot;\n-our $projects_list = \"index/index.aux\";\n+our $projects_list = \"@@GITWEB_LIST@@\" || \"$projectroot\";\n \n # default blob_plain mimetype and default charset for text/plain blob\n our $default_blob_plain_mimetype = 'text/plain';\n-- \n1.4.2.rc2.gf055\n\n-- \nMartin Waitz\n"}]}