{"thread":{"id":"23928","subject":"[PATCH GSoC 1/4] gitweb: Move static files into seperate subdirectory","startedAt":"2010-05-28T06:25:49Z","lastAt":"2010-05-31T21:36:07Z","messageCount":7,"participants":["Pavan Kumar Sunkara","Christian Couder","Junio C Hamano","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"142482","messageId":"1275027952-5057-1-git-send-email-pavan.sss1991@gmail.com","threadId":"23928","inReplyTo":null,"subject":"[PATCH GSoC 1/4] gitweb: Move static files into seperate subdirectory","fromName":"Pavan Kumar Sunkara","fromEmail":"pavan.sss1991@gmail.com","sentAt":"2010-05-28T06:25:49Z","receivedAt":"2010-05-28T06:25:49Z","isPatch":true,"sender":{"key":"pavan.sss1991@gmail.com","avatar":"https://avatars.githubusercontent.com/u/174703?v=4"},"body":"Create a new subdirectory called 'static' in gitweb/, and move\nall static files required by gitweb.cgi when running, which means\nstyles, images and Javascript code. This should make gitweb more\nreadable and easier to maintain.\n\nUpdate t/gitweb-lib.sh to reflect this change.The install-gitweb\nnow also include moving of static files into 'static' subdirectory\nin target directory: update Makefile, gitweb's INSTALL, README and\nMakefile accordingly.\n\nSigned-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Petr Baudis <pasky@ucw.cz>\nAcked-by: Jakub Narebski <jnareb@gmail.com>\n---\n Makefile                            |   22 +++++++++---------\n gitweb/INSTALL                      |   19 +++++++--------\n gitweb/Makefile                     |   40 ++++++++++++++++++----------------\n gitweb/README                       |   14 +++++++-----\n gitweb/{ => static}/git-favicon.png |  Bin 115 -> 115 bytes\n gitweb/{ => static}/git-logo.png    |  Bin 207 -> 207 bytes\n gitweb/{ => static}/gitweb.css      |    0\n gitweb/{ => static}/gitweb.js       |    0\n t/gitweb-lib.sh                     |    6 ++--\n 9 files changed, 52 insertions(+), 49 deletions(-)\n rename gitweb/{ => static}/git-favicon.png (100%)\n rename gitweb/{ => static}/git-logo.png (100%)\n rename gitweb/{ => static}/gitweb.css (100%)\n rename gitweb/{ => static}/gitweb.js (100%)\n\ndiff --git a/Makefile b/Makefile\nindex 6eb6289..de7f680 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1561,32 +1561,32 @@ gitweb:\n \t$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all\n \n ifdef JSMIN\n-GITWEB_PROGRAMS += gitweb/gitweb.min.js\n-GITWEB_JS = gitweb/gitweb.min.js\n+GITWEB_PROGRAMS += gitweb/static/gitweb.min.js\n+GITWEB_JS = gitweb/static/gitweb.min.js\n else\n-GITWEB_JS = gitweb/gitweb.js\n+GITWEB_JS = gitweb/static/gitweb.js\n endif\n ifdef CSSMIN\n-GITWEB_PROGRAMS += gitweb/gitweb.min.css\n-GITWEB_CSS = gitweb/gitweb.min.css\n+GITWEB_PROGRAMS += gitweb/static/gitweb.min.css\n+GITWEB_CSS = gitweb/static/gitweb.min.css\n else\n-GITWEB_CSS = gitweb/gitweb.css\n+GITWEB_CSS = gitweb/static/gitweb.css\n endif\n OTHER_PROGRAMS +=  gitweb/gitweb.cgi  $(GITWEB_PROGRAMS)\n gitweb/gitweb.cgi: gitweb/gitweb.perl $(GITWEB_PROGRAMS)\n \t$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@)\n \n ifdef JSMIN\n-gitweb/gitweb.min.js: gitweb/gitweb.js\n+gitweb/static/gitweb.min.js: gitweb/static/gitweb.js\n \t$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@)\n endif # JSMIN\n ifdef CSSMIN\n-gitweb/gitweb.min.css: gitweb/gitweb.css\n+gitweb/static/gitweb.min.css: gitweb/static/gitweb.css\n \t$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@)\n endif # CSSMIN\n \n \n-git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.js\n+git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/static/gitweb.css gitweb/static/gitweb.js\n \t$(QUIET_GEN)$(RM) $@ $@+ && \\\n \tsed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n \t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\ndiff --git a/gitweb/INSTALL b/gitweb/INSTALL\nindex d484d76..8230531 100644\n--- a/gitweb/INSTALL\n+++ b/gitweb/INSTALL\n@@ -2,9 +2,10 @@ GIT web Interface (gitweb) Installation\n =======================================\n \n First you have to generate gitweb.cgi from gitweb.perl using\n-\"make gitweb\", then copy appropriate files (gitweb.cgi, gitweb.js,\n-gitweb.css, git-logo.png and git-favicon.png) to their destination.\n-For example if git was (or is) installed with /usr prefix, you can do\n+\"make gitweb\", then \"make install-gitweb\" appropriate files\n+(gitweb.cgi, gitweb.js, gitweb.css, git-logo.png and git-favicon.png)\n+to their destination. For example if git was (or is) installed with\n+/usr prefix and gitwebdir is /var/www/cgi-bin, you can do\n \n \t$ make prefix=/usr gitweb                            ;# as yourself\n \t# make gitwebdir=/var/www/cgi-bin install-gitweb     ;# as root\n@@ -81,16 +82,14 @@ Build example\n   minifiers, you can do\n \n \tmake GITWEB_PROJECTROOT=\"/home/local/scm\" \\\n-\t     GITWEB_JS=\"/gitweb/gitweb.js\" \\\n-\t     GITWEB_CSS=\"/gitweb/gitweb.css\" \\\n-\t     GITWEB_LOGO=\"/gitweb/git-logo.png\" \\\n-\t     GITWEB_FAVICON=\"/gitweb/git-favicon.png\" \\\n+\t     GITWEB_JS=\"gitweb/static/gitweb.js\" \\\n+\t     GITWEB_CSS=\"gitweb/static/gitweb.css\" \\\n+\t     GITWEB_LOGO=\"gitweb/static/git-logo.png\" \\\n+\t     GITWEB_FAVICON=\"gitweb/static/git-favicon.png\" \\\n \t     bindir=/usr/local/bin \\\n \t     gitweb\n \n-\tcp -fv gitweb/gitweb.{cgi,js,css} \\\n-\t       gitweb/git-{favicon,logo}.png \\\n-\t     /var/www/cgi-bin/gitweb/\n+\tmake gitwebdir=/var/www/cgi-bin/gitweb install-gitweb\n \n \n Gitweb config file\ndiff --git a/gitweb/Makefile b/gitweb/Makefile\nindex 935d2d2..d2584fe 100644\n--- a/gitweb/Makefile\n+++ b/gitweb/Makefile\n@@ -4,10 +4,10 @@ all::\n # Define V=1 to have a more verbose compile.\n #\n # Define JSMIN to point to JavaScript minifier that functions as\n-# a filter to have gitweb.js minified.\n+# a filter to have static/gitweb.js minified.\n #\n # Define CSSMIN to point to a CSS minifier in order to generate a minified\n-# version of gitweb.css\n+# version of static/gitweb.css\n #\n \n prefix ?= $(HOME)\n@@ -29,10 +29,10 @@ GITWEB_STRICT_EXPORT =\n GITWEB_BASE_URL =\n GITWEB_LIST =\n GITWEB_HOMETEXT = indextext.html\n-GITWEB_CSS = gitweb.css\n-GITWEB_LOGO = git-logo.png\n-GITWEB_FAVICON = git-favicon.png\n-GITWEB_JS = gitweb.js\n+GITWEB_CSS = static/gitweb.css\n+GITWEB_LOGO = static/git-logo.png\n+GITWEB_FAVICON = static/git-favicon.png\n+GITWEB_JS = static/gitweb.js\n GITWEB_SITE_HEADER =\n GITWEB_SITE_FOOTER =\n \n@@ -54,6 +54,7 @@ PERL_PATH  ?= /usr/bin/perl\n # Shell quote;\n bindir_SQ = $(subst ','\\'',$(bindir))#'\n gitwebdir_SQ = $(subst ','\\'',$(gitwebdir))#'\n+gitwebstaticdir_SQ = $(subst ','\\'',$(gitwebdir)/static)#'\n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))#'\n PERL_PATH_SQ  = $(subst ','\\'',$(PERL_PATH))#'\n DESTDIR_SQ    = $(subst ','\\'',$(DESTDIR))#'\n@@ -88,26 +89,26 @@ all:: gitweb.cgi\n GITWEB_PROGRAMS = gitweb.cgi\n \n ifdef JSMIN\n-GITWEB_FILES += gitweb.min.js\n-GITWEB_JS = gitweb.min.js\n-all:: gitweb.min.js\n-gitweb.min.js: gitweb.js GITWEB-BUILD-OPTIONS\n+GITWEB_FILES += static/gitweb.min.js\n+GITWEB_JS = static/gitweb.min.js\n+all:: static/gitweb.min.js\n+static/gitweb.min.js: static/gitweb.js GITWEB-BUILD-OPTIONS\n \t$(QUIET_GEN)$(JSMIN) <$< >$@\n else\n-GITWEB_FILES += gitweb.js\n+GITWEB_FILES += static/gitweb.js\n endif\n \n ifdef CSSMIN\n-GITWEB_FILES += gitweb.min.css\n-GITWEB_CSS = gitweb.min.css\n-all:: gitweb.min.css\n-gitweb.min.css: gitweb.css GITWEB-BUILD-OPTIONS\n+GITWEB_FILES += static/gitweb.min.css\n+GITWEB_CSS = static/gitweb.min.css\n+all:: static/gitweb.min.css\n+static/gitweb.min.css: static/gitweb.css GITWEB-BUILD-OPTIONS\n \t$(QUIET_GEN)$(CSSMIN) <$ >$@\n else\n-GITWEB_FILES += gitweb.css\n+GITWEB_FILES += static/gitweb.css\n endif\n \n-GITWEB_FILES += git-logo.png git-favicon.png\n+GITWEB_FILES += static/git-logo.png static/git-favicon.png\n \n GITWEB_REPLACE = \\\n \t-e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \\\n@@ -147,12 +148,13 @@ gitweb.cgi: gitweb.perl GITWEB-BUILD-OPTIONS\n install: all\n \t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebdir_SQ)'\n \t$(INSTALL) -m 755 $(GITWEB_PROGRAMS) '$(DESTDIR_SQ)$(gitwebdir_SQ)'\n-\t$(INSTALL) -m 644 $(GITWEB_FILES)    '$(DESTDIR_SQ)$(gitwebdir_SQ)'\n+\t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)'\n+\t$(INSTALL) -m 644 $(GITWEB_FILES) '$(DESTDIR_SQ)$(gitwebstaticdir_SQ)'\n \n ### Cleaning rules\n \n clean:\n-\t$(RM) gitweb.cgi gitweb.min.js gitweb.min.css GITWEB-BUILD-OPTIONS\n+\t$(RM) gitweb.cgi static/gitweb.min.js static/gitweb.min.css GITWEB-BUILD-OPTIONS\n \n .PHONY: all clean install .FORCE-GIT-VERSION-FILE FORCE\n \ndiff --git a/gitweb/README b/gitweb/README\nindex 71742b3..0e19be8 100644\n--- a/gitweb/README\n+++ b/gitweb/README\n@@ -80,24 +80,26 @@ You can specify the following configuration variables when building GIT:\n    Points to the location where you put gitweb.css on your web server\n    (or to be more generic, the URI of gitweb stylesheet).  Relative to the\n    base URI of gitweb.  Note that you can setup multiple stylesheets from\n-   the gitweb config file.  [Default: gitweb.css (or gitweb.min.css if the\n-   CSSMIN variable is defined / CSS minifier is used)]\n+   the gitweb config file.  [Default: static/gitweb.css (or\n+   static/gitweb.min.css if the CSSMIN variable is defined / CSS minifier\n+   is used)]\n  * GITWEB_LOGO\n    Points to the location where you put git-logo.png on your web server\n    (or to be more generic URI of logo, 72x27 size, displayed in top right\n    corner of each gitweb page, and used as logo for Atom feed).  Relative\n-   to base URI of gitweb.  [Default: git-logo.png]\n+   to base URI of gitweb.  [Default: static/git-logo.png]\n  * GITWEB_FAVICON\n    Points to the location where you put git-favicon.png on your web server\n    (or to be more generic URI of favicon, assumed to be image/png type;\n    web browsers that support favicons (website icons) may display them\n    in the browser's URL bar and next to site name in bookmarks).  Relative\n-   to base URI of gitweb.  [Default: git-favicon.png]\n+   to base URI of gitweb.  [Default: static/git-favicon.png]\n  * GITWEB_JS\n    Points to the localtion where you put gitweb.js on your web server\n    (or to be more generic URI of JavaScript code used by gitweb).\n-   Relative to base URI of gitweb.  [Default: gitweb.js (or gitweb.min.js\n-   if JSMIN build variable is defined / JavaScript minifier is used)]\n+   Relative to base URI of gitweb.  [Default: static/gitweb.js (or\n+   static/gitweb.min.js if JSMIN build variable is defined / JavaScript\n+   minifier is used)]\n  * GITWEB_CONFIG\n    This Perl file will be loaded using 'do' and can be used to override any\n    of the options above as well as some other options -- see the \"Runtime\ndiff --git a/gitweb/gitweb.css b/gitweb/static/gitweb.css\nsimilarity index 100%\nrename from gitweb/gitweb.css\nrename to gitweb/static/gitweb.css\ndiff --git a/gitweb/gitweb.js b/gitweb/static/gitweb.js\nsimilarity index 100%\nrename from gitweb/gitweb.js\nrename to gitweb/static/gitweb.js\ndiff --git a/gitweb/git-logo.png b/gitweb/static/git-logo.png\nsimilarity index 100%\nrename from gitweb/git-logo.png\nrename to gitweb/static/git-logo.png\ndiff --git a/gitweb/git-favicon.png b/gitweb/static/git-favicon.png\nsimilarity index 100%\nrename from gitweb/git-favicon.png\nrename to gitweb/static/git-favicon.png\ndiff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh\nindex 5a734b1..b70b891 100644\n--- a/t/gitweb-lib.sh\n+++ b/t/gitweb-lib.sh\n@@ -19,9 +19,9 @@ our \\$site_name = '[localhost]';\n our \\$site_header = '';\n our \\$site_footer = '';\n our \\$home_text = 'indextext.html';\n-our @stylesheets = ('file:///$TEST_DIRECTORY/../gitweb/gitweb.css');\n-our \\$logo = 'file:///$TEST_DIRECTORY/../gitweb/git-logo.png';\n-our \\$favicon = 'file:///$TEST_DIRECTORY/../gitweb/git-favicon.png';\n+our @stylesheets = ('file:///$TEST_DIRECTORY/../gitweb/static/gitweb.css');\n+our \\$logo = 'file:///$TEST_DIRECTORY/../gitweb/static/git-logo.png';\n+our \\$favicon = 'file:///$TEST_DIRECTORY/../gitweb/static/git-favicon.png';\n our \\$projects_list = '';\n our \\$export_ok = '';\n our \\$strict_export = '';\n-- \n1.7.1.18.gf661c6.dirty\n"},{"id":"142484","messageId":"1275027952-5057-2-git-send-email-pavan.sss1991@gmail.com","threadId":"23928","inReplyTo":"1275027952-5057-1-git-send-email-pavan.sss1991@gmail.com","subject":"[PATCH GSoC 2/4] gitweb: Set default destination directory for installing gitweb in Makefile","fromName":"Pavan Kumar Sunkara","fromEmail":"pavan.sss1991@gmail.com","sentAt":"2010-05-28T06:25:50Z","receivedAt":"2010-05-28T06:25:50Z","isPatch":true,"sender":{"key":"pavan.sss1991@gmail.com","avatar":"https://avatars.githubusercontent.com/u/174703?v=4"},"body":"Currently installing gitweb requires to give a target directory\n(via 'gitwebdir' build variable).  Giving it a default value\nprotects against user errors.\n\nSigned-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Petr Baudis <pasky@ucw.cz>\nAcked-by: Jakub Narebski <jnareb@gmail.com>\n---\n Makefile |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex de7f680..caf2f64 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -269,6 +269,7 @@ mandir = share/man\n infodir = share/info\n gitexecdir = libexec/git-core\n sharedir = $(prefix)/share\n+gitwebdir = $(sharedir)/gitweb\n template_dir = share/git-core/templates\n htmldir = share/doc/git-doc\n ifeq ($(prefix),/usr)\n-- \n1.7.1.18.gf661c6.dirty\n"},{"id":"142483","messageId":"1275027952-5057-3-git-send-email-pavan.sss1991@gmail.com","threadId":"23928","inReplyTo":"1275027952-5057-1-git-send-email-pavan.sss1991@gmail.com","subject":"[PATCH GSoC 3/4] git-instaweb: Put httpd logs in a \"$httpd_only\" subdirectory","fromName":"Pavan Kumar Sunkara","fromEmail":"pavan.sss1991@gmail.com","sentAt":"2010-05-28T06:25:51Z","receivedAt":"2010-05-28T06:25:51Z","isPatch":true,"sender":{"key":"pavan.sss1991@gmail.com","avatar":"https://avatars.githubusercontent.com/u/174703?v=4"},"body":"Resolve full httpd and create \"$httpd_only\" subdirectory before\nwriting httpd.conf so that error.log and access.log go into it.\n\nWhile at it, change apache2 configuration to use logs in a\nsimiliar fashion.\n\nSigned-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Petr Baudis <pasky@ucw.cz>\n---\n git-instaweb.sh |   14 +++++++++-----\n 1 files changed, 9 insertions(+), 5 deletions(-)\n\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex f608014..f03465c 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -206,11 +206,11 @@ server.port = $port\n server.modules = ( \"mod_setenv\", \"mod_cgi\" )\n server.indexfiles = ( \"gitweb.cgi\" )\n server.pid-file = \"$fqgitdir/pid\"\n-server.errorlog = \"$fqgitdir/gitweb/error.log\"\n+server.errorlog = \"$fqgitdir/gitweb/$httpd_only/error.log\"\n \n # to enable, add \"mod_access\", \"mod_accesslog\" to server.modules\n # variable above and uncomment this\n-#accesslog.filename = \"$fqgitdir/gitweb/access.log\"\n+#accesslog.filename = \"$fqgitdir/gitweb/$httpd_only/access.log\"\n \n setenv.add-environment = ( \"PATH\" => env.PATH )\n \n@@ -277,7 +277,6 @@ EOF\n \n apache2_conf () {\n \ttest -z \"$module_path\" && module_path=/usr/lib/apache2/modules\n-\tmkdir -p \"$GIT_DIR/gitweb/logs\"\n \tbind=\n \ttest x\"$local\" = xtrue && bind='127.0.0.1:'\n \techo 'text/css css' > \"$fqgitdir/mime.types\"\n@@ -285,6 +284,8 @@ apache2_conf () {\n ServerName \"git-instaweb\"\n ServerRoot \"$fqgitdir/gitweb\"\n DocumentRoot \"$fqgitdir/gitweb\"\n+ErrorLog \"$fqgitdir/gitweb/$httpd_only/error.log\"\n+CustomLog \"$fqgitdir/gitweb/$httpd_only/access.log\" combined\n PidFile \"$fqgitdir/pid\"\n Listen $bind$port\n EOF\n@@ -357,8 +358,8 @@ root\t\t$fqgitdir/gitweb\n ports\t\t$port\n index_files\tgitweb.cgi\n #ssl_cert\t$fqgitdir/gitweb/ssl_cert.pem\n-error_log\t$fqgitdir/gitweb/error.log\n-access_log\t$fqgitdir/gitweb/access.log\n+error_log\t$fqgitdir/gitweb/$httpd_only/error.log\n+access_log\t$fqgitdir/gitweb/$httpd_only/access.log\n \n #cgi setup\n cgi_env\t\tPATH=$PATH,GIT_DIR=$GIT_DIR,GIT_EXEC_PATH=$GIT_EXEC_PATH\n@@ -406,6 +407,9 @@ gitweb_cgi \"$GIT_DIR/gitweb/gitweb.cgi\"\n gitweb_css \"$GIT_DIR/@@GITWEB_CSS_NAME@@\"\n gitweb_js  \"$GIT_DIR/@@GITWEB_JS_NAME@@\"\n \n+resolve_full_httpd\n+mkdir -p \"$fqgitdir/gitweb/$httpd_only\"\n+\n case \"$httpd\" in\n *lighttpd*)\n \tlighttpd_conf\n-- \n1.7.1.18.gf661c6.dirty\n"},{"id":"142485","messageId":"1275027952-5057-4-git-send-email-pavan.sss1991@gmail.com","threadId":"23928","inReplyTo":"1275027952-5057-1-git-send-email-pavan.sss1991@gmail.com","subject":"[PATCH GSoC 4/4] git-instaweb: Configure it to work with new gitweb structure","fromName":"Pavan Kumar Sunkara","fromEmail":"pavan.sss1991@gmail.com","sentAt":"2010-05-28T06:25:52Z","receivedAt":"2010-05-28T06:25:52Z","isPatch":true,"sender":{"key":"pavan.sss1991@gmail.com","avatar":"https://avatars.githubusercontent.com/u/174703?v=4"},"body":"git-instaweb in its current form (re)creates gitweb.cgi and\n(some of) required static files in $GIT_DIR/gitweb/ directory.\nSplitting gitweb would make it difficult for git-instaweb to\ncontinue with this method.\n\nUse the instaweb.gitwebdir config variable to point git-instaweb script\nto a global directory which contains gitweb files as server root\nand the httpd.conf along with server logs and pid go into\n'$(GIT_DIR)/gitweb' directory.\n\nSigned-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>\nMentored-by: Christian Couder <chriscool@tuxfamily.org>\nMentored-by: Petr Baudis <pasky@ucw.cz>\nAcked-by: Jakub Narebski <jnareb@gmail.com>\n---\n Makefile        |   11 ++------\n git-instaweb.sh |   68 +++++++++++++++++++-----------------------------------\n 2 files changed, 27 insertions(+), 52 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex caf2f64..9161172 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1426,6 +1426,7 @@ gitexecdir_SQ = $(subst ','\\'',$(gitexecdir))\n template_dir_SQ = $(subst ','\\'',$(template_dir))\n htmldir_SQ = $(subst ','\\'',$(htmldir))\n prefix_SQ = $(subst ','\\'',$(prefix))\n+gitwebdir_SQ = $(subst ','\\'',$(gitwebdir))\n \n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n PERL_PATH_SQ = $(subst ','\\'',$(PERL_PATH))\n@@ -1592,15 +1593,8 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/static/gitweb.css gitweb/\n \tsed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \\\n \t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n \t    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n-\t    -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \\\n-\t    -e '/@@GITWEB_CGI@@/d' \\\n-\t    -e '/@@GITWEB_CSS@@/r $(GITWEB_CSS)' \\\n-\t    -e '/@@GITWEB_CSS@@/d' \\\n-\t    -e '/@@GITWEB_JS@@/r $(GITWEB_JS)' \\\n-\t    -e '/@@GITWEB_JS@@/d' \\\n+\t    -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \\\n \t    -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \\\n-            -e 's|@@GITWEB_CSS_NAME@@|$(GITWEB_CSS)|' \\\n-            -e 's|@@GITWEB_JS_NAME@@|$(GITWEB_JS)|' \\\n \t    $@.sh > $@+ && \\\n \tchmod +x $@+ && \\\n \tmv $@+ $@\n@@ -1972,6 +1966,7 @@ install: all\n \t$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install\n ifndef NO_PERL\n \t$(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install\n+\t$(MAKE) -C gitweb gitwebdir=$(gitwebdir_SQ) install\n endif\n ifndef NO_PYTHON\n \t$(MAKE) -C git_remote_helpers prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex f03465c..5c700b6 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -24,6 +24,7 @@ restart        restart the web server\n fqgitdir=\"$GIT_DIR\"\n local=\"$(git config --bool --get instaweb.local)\"\n httpd=\"$(git config --get instaweb.httpd)\"\n+root=\"$(git config --get instaweb.gitwebdir)\"\n port=$(git config --get instaweb.port)\n module_path=\"$(git config --get instaweb.modulepath)\"\n \n@@ -34,6 +35,9 @@ conf=\"$GIT_DIR/gitweb/httpd.conf\"\n # if installed, it doesn't need further configuration (module_path)\n test -z \"$httpd\" && httpd='lighttpd -f'\n \n+# Default is @@GITWEBDIR@@\n+test -z \"$root\" && root='@@GITWEBDIR@@'\n+\n # any untaken local port will do...\n test -z \"$port\" && port=1234\n \n@@ -57,7 +61,7 @@ resolve_full_httpd () {\n \t\t# these days and those are not in most users $PATHs\n \t\t# in addition, we may have generated a server script\n \t\t# in $fqgitdir/gitweb.\n-\t\tfor i in /usr/local/sbin /usr/sbin \"$fqgitdir/gitweb\"\n+\t\tfor i in /usr/local/sbin /usr/sbin \"$root\" \"$fqgitdir/gitweb\"\n \t\tdo\n \t\t\tif test -x \"$i/$httpd_only\"\n \t\t\tthen\n@@ -159,8 +163,8 @@ done\n mkdir -p \"$GIT_DIR/gitweb/tmp\"\n GIT_EXEC_PATH=\"$(git --exec-path)\"\n GIT_DIR=\"$fqgitdir\"\n-export GIT_EXEC_PATH GIT_DIR\n-\n+GITWEB_CONFIG=\"$fqgitdir/gitweb/gitweb_config.perl\"\n+export GIT_EXEC_PATH GIT_DIR GITWEB_CONFIG\n \n webrick_conf () {\n \t# generate a standalone server script in $fqgitdir/gitweb.\n@@ -192,7 +196,7 @@ EOF\n \n \tcat >\"$conf\" <<EOF\n :Port: $port\n-:DocumentRoot: \"$fqgitdir/gitweb\"\n+:DocumentRoot: \"$root\"\n :DirectoryIndex: [\"gitweb.cgi\"]\n :PidFile: \"$fqgitdir/pid\"\n EOF\n@@ -201,7 +205,7 @@ EOF\n \n lighttpd_conf () {\n \tcat > \"$conf\" <<EOF\n-server.document-root = \"$fqgitdir/gitweb\"\n+server.document-root = \"$root\"\n server.port = $port\n server.modules = ( \"mod_setenv\", \"mod_cgi\" )\n server.indexfiles = ( \"gitweb.cgi\" )\n@@ -212,7 +216,7 @@ server.errorlog = \"$fqgitdir/gitweb/$httpd_only/error.log\"\n # variable above and uncomment this\n #accesslog.filename = \"$fqgitdir/gitweb/$httpd_only/access.log\"\n \n-setenv.add-environment = ( \"PATH\" => env.PATH )\n+setenv.add-environment = ( \"PATH\" => env.PATH, \"GITWEB_CONFIG\" => env.GITWEB_CONFIG )\n \n cgi.assign = ( \".cgi\" => \"\" )\n \n@@ -282,8 +286,8 @@ apache2_conf () {\n \techo 'text/css css' > \"$fqgitdir/mime.types\"\n \tcat > \"$conf\" <<EOF\n ServerName \"git-instaweb\"\n-ServerRoot \"$fqgitdir/gitweb\"\n-DocumentRoot \"$fqgitdir/gitweb\"\n+ServerRoot \"$root\"\n+DocumentRoot \"$root\"\n ErrorLog \"$fqgitdir/gitweb/$httpd_only/error.log\"\n CustomLog \"$fqgitdir/gitweb/$httpd_only/access.log\" combined\n PidFile \"$fqgitdir/pid\"\n@@ -304,13 +308,14 @@ EOF\n \t# check to see if Dennis Stosberg's mod_perl compatibility patch\n \t# (<20060621130708.Gcbc6e5c@leonov.stosberg.net>) has been applied\n \tif test -f \"$module_path/mod_perl.so\" &&\n-\t   sane_grep 'MOD_PERL' \"$GIT_DIR/gitweb/gitweb.cgi\" >/dev/null\n+\t   sane_grep 'MOD_PERL' \"$root/gitweb.cgi\" >/dev/null\n \tthen\n \t\t# favor mod_perl if available\n \t\tcat >> \"$conf\" <<EOF\n LoadModule perl_module $module_path/mod_perl.so\n PerlPassEnv GIT_DIR\n PerlPassEnv GIT_EXEC_DIR\n+PerlPassEnv GITWEB_CONFIG\n <Location /gitweb.cgi>\n \tSetHandler perl-script\n \tPerlResponseHandler ModPerl::Registry\n@@ -354,7 +359,7 @@ mongoose_conf() {\n # For detailed description of every option, visit\n # http://code.google.com/p/mongoose/wiki/MongooseManual\n \n-root\t\t$fqgitdir/gitweb\n+root\t\t$root\n ports\t\t$port\n index_files\tgitweb.cgi\n #ssl_cert\t$fqgitdir/gitweb/ssl_cert.pem\n@@ -362,7 +367,7 @@ error_log\t$fqgitdir/gitweb/$httpd_only/error.log\n access_log\t$fqgitdir/gitweb/$httpd_only/access.log\n \n #cgi setup\n-cgi_env\t\tPATH=$PATH,GIT_DIR=$GIT_DIR,GIT_EXEC_PATH=$GIT_EXEC_PATH\n+cgi_env\t\tPATH=$PATH,GIT_DIR=$GIT_DIR,GIT_EXEC_PATH=$GIT_EXEC_PATH,GITWEB_CONFIG=$GITWEB_CONFIG\n cgi_interp\t$PERL\n cgi_ext\t\tcgi,pl\n \n@@ -371,41 +376,16 @@ mime_types\t.gz=application/x-gzip,.tar.gz=application/x-tgz,.tgz=application/x-t\n EOF\n }\n \n-\n-script='\n-s#^(my|our) \\$projectroot =.*#$1 \\$projectroot = \"'$(dirname \"$fqgitdir\")'\";#;\n-s#(my|our) \\$gitbin =.*#$1 \\$gitbin = \"'$GIT_EXEC_PATH'\";#;\n-s#(my|our) \\$projects_list =.*#$1 \\$projects_list = \\$projectroot;#;\n-s#(my|our) \\$git_temp =.*#$1 \\$git_temp = \"'$fqgitdir/gitweb/tmp'\";#;'\n-\n-gitweb_cgi () {\n-\tcat > \"$1.tmp\" <<\\EOFGITWEB\n-@@GITWEB_CGI@@\n-EOFGITWEB\n-\t# Use the configured full path to perl to match the generated\n-\t# scripts' 'hashpling' line\n-\t\"$PERL\" -p -e \"$script\" \"$1.tmp\"  > \"$1\"\n-\tchmod +x \"$1\"\n-\trm -f \"$1.tmp\"\n-}\n-\n-gitweb_css () {\n-\tcat > \"$1\" <<\\EOFGITWEB\n-@@GITWEB_CSS@@\n-\n-EOFGITWEB\n-}\n-\n-gitweb_js () {\n-\tcat > \"$1\" <<\\EOFGITWEB\n-@@GITWEB_JS@@\n-\n-EOFGITWEB\n+gitweb_conf() {\n+\tcat > \"$fqgitdir/gitweb/gitweb_config.perl\" <<EOF\n+#!/usr/bin/perl\n+our \\$projectroot = \"$(dirname \"$fqgitdir\")\";\n+our \\$git_temp = \"$fqgitdir/gitweb/tmp\";\n+our \\$projects_list = \\$projectroot;\n+EOF\n }\n \n-gitweb_cgi \"$GIT_DIR/gitweb/gitweb.cgi\"\n-gitweb_css \"$GIT_DIR/@@GITWEB_CSS_NAME@@\"\n-gitweb_js  \"$GIT_DIR/@@GITWEB_JS_NAME@@\"\n+gitweb_conf\n \n resolve_full_httpd\n mkdir -p \"$fqgitdir/gitweb/$httpd_only\"\n-- \n1.7.1.18.gf661c6.dirty\n"},{"id":"142499","messageId":"201005281856.27438.chriscool@tuxfamily.org","threadId":"23928","inReplyTo":"1275027952-5057-1-git-send-email-pavan.sss1991@gmail.com","subject":"Re: [PATCH GSoC 1/4] gitweb: Move static files into seperate subdirectory","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2010-05-28T16:56:27Z","receivedAt":"2010-05-28T16:56:27Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Friday 28 May 2010 08:25:49 Pavan Kumar Sunkara wrote:\n> Create a new subdirectory called 'static' in gitweb/, and move\n> all static files required by gitweb.cgi when running, which means\n> styles, images and Javascript code. This should make gitweb more\n> readable and easier to maintain.\n> \n> Update t/gitweb-lib.sh to reflect this change.The install-gitweb\n> now also include moving of static files into 'static' subdirectory\n> in target directory: update Makefile, gitweb's INSTALL, README and\n> Makefile accordingly.\n> \n> Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>\n> Mentored-by: Christian Couder <chriscool@tuxfamily.org>\n> Mentored-by: Petr Baudis <pasky@ucw.cz>\n> Acked-by: Jakub Narebski <jnareb@gmail.com>\n\nThat's nice but you should probably have sent the patch series to Junio too \naccording to this part of the SubmittingPatches document:\n\n\"- send the patch to the list (git@vger.kernel.org) and the maintainer \n(gitster@pobox.com) if (and only if) the patch is ready for inclusion.\"\n\nThanks,\nChristian.\n"},{"id":"142514","messageId":"7v7hmn5x7h.fsf@alter.siamese.dyndns.org","threadId":"23928","inReplyTo":"201005281856.27438.chriscool@tuxfamily.org","subject":"Re: [PATCH GSoC 1/4] gitweb: Move static files into seperate subdirectory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-05-29T01:10:58Z","receivedAt":"2010-05-29T01:10:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> That's nice but you should probably have sent the patch series to Junio too \n> according to this part of the SubmittingPatches document:\n\nThanks; I usually look at all the mails (I do not necessarily _read_ them\nall, though), and I am slowly catching up with the list traffic ;-)\n\nWill take a look and apply.\n"},{"id":"142623","messageId":"20100531213607.GQ3563@machine.or.cz","threadId":"23928","inReplyTo":"1275027952-5057-1-git-send-email-pavan.sss1991@gmail.com","subject":"Re: [PATCH GSoC 1/4] gitweb: Move static files into seperate subdirectory","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2010-05-31T21:36:07Z","receivedAt":"2010-05-31T21:36:07Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Fri, May 28, 2010 at 11:55:49AM +0530, Pavan Kumar Sunkara wrote:\n> Create a new subdirectory called 'static' in gitweb/, and move\n> all static files required by gitweb.cgi when running, which means\n> styles, images and Javascript code. This should make gitweb more\n> readable and easier to maintain.\n> \n> Update t/gitweb-lib.sh to reflect this change.The install-gitweb\n> now also include moving of static files into 'static' subdirectory\n> in target directory: update Makefile, gitweb's INSTALL, README and\n> Makefile accordingly.\n> \n> Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>\n> Mentored-by: Christian Couder <chriscool@tuxfamily.org>\n> Mentored-by: Petr Baudis <pasky@ucw.cz>\n> Acked-by: Jakub Narebski <jnareb@gmail.com>\n\nAcked-by: Petr Baudis <pasky@suse.cz>\n"}]}