{"thread":{"id":"23842","subject":"[PATCHv4 GSoC] gitweb: Move static files into seperate subdirectory","startedAt":"2010-05-19T09:51:31Z","lastAt":"2010-05-19T13:32:59Z","messageCount":5,"participants":["Pavan Kumar Sunkara","Erik Faye-Lund","Will Palmer","Jay Soffian"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"141901","messageId":"1274262692-3783-1-git-send-email-pavan.sss1991@gmail.com","threadId":"23842","inReplyTo":null,"subject":"[PATCHv4 GSoC] gitweb: Move static files into seperate subdirectory","fromName":"Pavan Kumar Sunkara","fromEmail":"pavan.sss1991@gmail.com","sentAt":"2010-05-19T09:51:31Z","receivedAt":"2010-05-19T09:51:31Z","isPatch":false,"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>\n---\n\nThis patch is based on the commit 'jn/gitweb-install' in the 'next' branch\nby Jakub Nareski.\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' \\\n@@ -2005,7 +2005,7 @@ endif\n \t./check_bindir \"z$$bindir\" \"z$$execdir\" \"$$bindir/git-add$X\"\n \n install-gitweb:\n-       $(MAKE) -C gitweb install\n+\t$(MAKE) -C gitweb install\n \n install-doc:\n \t$(MAKE) -C Documentation install\n@@ -2101,7 +2101,7 @@ clean:\n \t$(RM) $(htmldocs).tar.gz $(manpages).tar.gz\n \t$(MAKE) -C Documentation/ clean\n ifndef NO_PERL\n-\t$(RM) gitweb/gitweb.cgi gitweb/gitweb.min.*\n+\t$(RM) gitweb/gitweb.cgi gitweb/static/gitweb.min.*\n \t$(MAKE) -C perl clean\n endif\n ifndef NO_PYTHON\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/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.16.g5d405c.dirty\n"},{"id":"141902","messageId":"1274262692-3783-2-git-send-email-pavan.sss1991@gmail.com","threadId":"23842","inReplyTo":"1274262692-3783-1-git-send-email-pavan.sss1991@gmail.com","subject":"[PATCHv2] git-web--browse: Add support for google chrome","fromName":"Pavan Kumar Sunkara","fromEmail":"pavan.sss1991@gmail.com","sentAt":"2010-05-19T09:51:32Z","receivedAt":"2010-05-19T09:51:32Z","isPatch":false,"sender":{"key":"pavan.sss1991@gmail.com","avatar":"https://avatars.githubusercontent.com/u/174703?v=4"},"body":"Add support for another web browser called chrome. To\nselect it, the value of the browser is 'chromium'.\n\nSigned-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>\n---\n git-web--browse.sh |    9 +++++++--\n 1 files changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/git-web--browse.sh b/git-web--browse.sh\nindex a578c3a..6df5ee8 100755\n--- a/git-web--browse.sh\n+++ b/git-web--browse.sh\n@@ -31,7 +31,7 @@ valid_custom_tool()\n \n valid_tool() {\n \tcase \"$1\" in\n-\t\tfirefox | iceweasel | konqueror | w3m | links | lynx | dillo | open | start)\n+\t\tfirefox | iceweasel | chrome | chromium | konqueror | w3m | links | lynx | dillo | open | start)\n \t\t\t;; # happy\n \t\t*)\n \t\t\tvalid_custom_tool \"$1\" || return 1\n@@ -103,7 +103,7 @@ fi\n \n if test -z \"$browser\" ; then\n     if test -n \"$DISPLAY\"; then\n-\tbrowser_candidates=\"firefox iceweasel konqueror w3m links lynx dillo\"\n+\tbrowser_candidates=\"firefox iceweasel chrome chromium konqueror w3m links lynx dillo\"\n \tif test \"$KDE_FULL_SESSION\" = \"true\"; then\n \t    browser_candidates=\"konqueror $browser_candidates\"\n \tfi\n@@ -146,6 +146,11 @@ case \"$browser\" in\n \ttest \"$vers\" -lt 2 && NEWTAB=''\n \t\"$browser_path\" $NEWTAB \"$@\" &\n \t;;\n+    chrome|chromium)\n+\t# Actual command for chromium is chromium-browser.\n+\t# No need to specify newTab. It's default in chromium\n+\teval \"$browser_path-browser\" \"$@\" &\n+\t;;\n     konqueror)\n \tcase \"$(basename \"$browser_path\")\" in\n \t    konqueror)\n-- \n1.7.1.16.g5d405c.dirty\n"},{"id":"141903","messageId":"AANLkTinzbHtabNuDbRRSzyy6a87JeXotiZTq4foR-iVG@mail.gmail.com","threadId":"23842","inReplyTo":"1274262692-3783-2-git-send-email-pavan.sss1991@gmail.com","subject":"Re: [PATCHv2] git-web--browse: Add support for google chrome","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@googlemail.com","sentAt":"2010-05-19T10:06:29Z","receivedAt":"2010-05-19T10:06:29Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Wed, May 19, 2010 at 11:51 AM, Pavan Kumar Sunkara\n<pavan.sss1991@gmail.com> wrote:\n> Add support for another web browser called chrome. To\n> select it, the value of the browser is 'chromium'.\n>\n\nExtreme nit-pick: This last sentence is a bit outdated now, isn't it?\nBoth 'chrome' and 'chromium' should work now, right? If you decide to\npost another version (I'm not sure it's worth the hassle, though -\nthis is probably in the who-cares-land), perhaps you should mention\nthat you're adding support for Chrome AND Chromium?\n\n-- \nErik \"kusma\" Faye-Lund\n"},{"id":"141904","messageId":"1274265104.2121.7.camel@wpalmer.simply-domain","threadId":"23842","inReplyTo":"1274262692-3783-2-git-send-email-pavan.sss1991@gmail.com","subject":"Re: [PATCHv2] git-web--browse: Add support for google chrome","fromName":"Will Palmer","fromEmail":"wmpalmer@gmail.com","sentAt":"2010-05-19T10:31:44Z","receivedAt":"2010-05-19T10:31:44Z","isPatch":false,"sender":{"key":"wmpalmer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/357044?v=4"},"body":"On Wed, 2010-05-19 at 15:21 +0530, Pavan Kumar Sunkara wrote:\n> Add support for another web browser called chrome. To\n> select it, the value of the browser is 'chromium'.\n\nperhaps this has already been discussed, but aren't \"chrome\" and\n\"chromium\" two different browsers? (based on the same code, sure, but\ndifferent releases which are often installed separately, all the same)\n\nIn my set-up (which as far as I know is done by blindly following\ninstructions from google), the browser is executed by the user as\n\"google-chrome\". \"chrome\" by itself is not in my PATH, through\ngoogle-chrome is a shell script which seems to eventually execute\nsomething called \"chrome\" internally, after setting some paths.\n"},{"id":"141906","messageId":"AANLkTikxis7BU-OGi76MzjN_JuOwmGNhDXYmZ1_bgMTl@mail.gmail.com","threadId":"23842","inReplyTo":"1274265104.2121.7.camel@wpalmer.simply-domain","subject":"Re: [PATCHv2] git-web--browse: Add support for google chrome","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2010-05-19T13:32:59Z","receivedAt":"2010-05-19T13:32:59Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Wed, May 19, 2010 at 6:31 AM, Will Palmer <wmpalmer@gmail.com> wrote:\n> perhaps this has already been discussed, but aren't \"chrome\" and\n> \"chromium\" two different browsers? (based on the same code, sure, but\n> different releases which are often installed separately, all the same)\n\nCorrect. The chromium browser is 100% open-source. You can compile it\nyourself or download a continuous build of it from the chromium trunk\n(the Chromium project uses subversion for\nchromium/chrome/chrome-frame, though interestingly uses git for\nChromiumOS). This is generally a developer release.\n\nGoogle Chrome is a Google-branded version of the chromium browser. It\nincludes some non-opensource or restricted components (such as H.264\nplayback, Flash, Google design assets, etc), so you can't compile it\nyourself. Rather you can only download binaries of various vintages\n(dev, beta, stable). This is generally the consumer release.\n\nj.\n"}]}