From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: Petr Baudis <pasky@suse.cz>, Fredrik Kuivinen <frekui@gmail.com>,
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>,
Luben Tuikov <ltuikov@yahoo.com>,
Martin Koegler <mkoegler@auto.tuwien.ac.at>,
Jakub Narebski <jnareb@gmail.com>
Subject: [PATCHv1/RFC 5/5] gitweb: Minify gitweb.js if JSMIN is defined
Date: Tue, 1 Sep 2009 13:39:20 +0200 [thread overview]
Message-ID: <1251805160-5303-6-git-send-email-jnareb@gmail.com> (raw)
In-Reply-To: <1251805160-5303-5-git-send-email-jnareb@gmail.com>
It requires that $JSMIN command can function as a filter.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch is new in series. Comments welcome.
I have not tested it extensively, but JSMIN=cat seems to work
correctly.
Makefile | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index 407b35c..f149a36 100644
--- a/Makefile
+++ b/Makefile
@@ -194,6 +194,9 @@ all::
# memory allocators with the nedmalloc allocator written by Niall Douglas.
#
# Define NO_REGEX if you have no or inferior regex support in your C library.
+#
+# Define JSMIN to point to JavaScript minifier that functions as
+# a filter to have gitweb.js minified.
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
@$(SHELL_PATH) ./GIT-VERSION-GEN
@@ -246,6 +249,9 @@ lib = lib
# DESTDIR=
pathsep = :
+# JavaScript minifier invocation that can function as filter
+JSMIN =
+
# default configuration for gitweb
GITWEB_CONFIG = gitweb_config.perl
GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
@@ -261,7 +267,11 @@ GITWEB_HOMETEXT = indextext.html
GITWEB_CSS = gitweb.css
GITWEB_LOGO = git-logo.png
GITWEB_FAVICON = git-favicon.png
+ifdef JSMIN
+GITWEB_JS = gitweb.min.js
+else
GITWEB_JS = gitweb.js
+endif
GITWEB_SITE_HEADER =
GITWEB_SITE_FOOTER =
@@ -1374,8 +1384,13 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
chmod +x $@+ && \
mv $@+ $@
+ifdef JSMIN
+OTHER_PROGRAMS += gitweb/gitweb.cgi gitweb/gitweb.min.js
+gitweb/gitweb.cgi: gitweb/gitweb.perl gitweb/gitweb.min.js
+else
OTHER_PROGRAMS += gitweb/gitweb.cgi
gitweb/gitweb.cgi: gitweb/gitweb.perl
+endif
$(QUIET_GEN)$(RM) $@ $@+ && \
sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
-e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
@@ -1426,6 +1441,11 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh
mv $@+ $@
endif # NO_PERL
+ifdef JSMIN
+gitweb/gitweb.min.js: gitweb/gitweb.js
+ $(QUIET_GEN)$(JSMIN) <$< >$@
+endif # JSMIN
+
configure: configure.ac
$(QUIET_GEN)$(RM) $@ $<+ && \
sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
--
1.6.3.3
next prev parent reply other threads:[~2009-09-01 11:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-01 11:39 [PATCH 0/5] gitweb: Incremental blame series (1 Sep 09) Jakub Narebski
2009-09-01 11:39 ` [PATCHv2 1/5] gitweb: Add optional "time to generate page" info in footer Jakub Narebski
2009-09-01 11:39 ` [PATCHv5 2/5] gitweb: Incremental blame (using JavaScript) Jakub Narebski
2009-09-01 11:39 ` [PATCHv1 3/5] gitweb: Colorize 'blame_incremental' view during processing Jakub Narebski
2009-09-01 11:39 ` [PATCHv3/RFC 4/5] gitweb: Create links leading to 'blame_incremental' using JavaScript Jakub Narebski
2009-09-01 11:39 ` Jakub Narebski [this message]
2009-11-05 20:33 ` Petr Baudis
2009-11-06 18:05 ` Jakub Narebski
2009-11-12 8:05 ` Junio C Hamano
2009-11-12 9:22 ` Jakub Narebski
2009-11-05 20:22 ` [PATCHv5 2/5] gitweb: Incremental blame (using JavaScript) Petr Baudis
2009-11-07 11:04 ` Jakub Narebski
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=1251805160-5303-6-git-send-email-jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=frekui@gmail.com \
--cc=git@vger.kernel.org \
--cc=giuseppe.bilotta@gmail.com \
--cc=ltuikov@yahoo.com \
--cc=mkoegler@auto.tuwien.ac.at \
--cc=pasky@suse.cz \
/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;
as well as URLs for NNTP newsgroup(s).