From: Mark Rada <marada@uwaterloo.ca>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Jakub Narebski <jnareb@gmail.com>
Subject: [PATCH] instaweb: use minified gitweb.js if available
Date: Fri, 19 Mar 2010 02:02:55 -0400 [thread overview]
Message-ID: <4BA3138F.1010201@mailservices.uwaterloo.ca> (raw)
Makes git-instaweb use gitweb.min.js if it was generated.
Signed-off-by: Mark Rada <marada@uwaterloo.ca>
---
Makefile | 13 +++++++------
git-instaweb.sh | 1 +
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 7c616f8..1677928 100644
--- a/Makefile
+++ b/Makefile
@@ -1551,12 +1551,12 @@ gitweb:
$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all
ifdef JSMIN
-OTHER_PROGRAMS += gitweb/gitweb.cgi gitweb/gitweb.min.js
-gitweb/gitweb.cgi: gitweb/gitweb.perl gitweb/gitweb.min.js
+GITWEB_JS=gitweb/gitweb.min.js
else
-OTHER_PROGRAMS += gitweb/gitweb.cgi
-gitweb/gitweb.cgi: gitweb/gitweb.perl
+GITWEB_JS=gitweb/gitweb.js
endif
+OTHER_PROGRAMS += gitweb/gitweb.cgi $(GITWEB_JS)
+gitweb/gitweb.cgi: gitweb/gitweb.perl $(GITWEB_PROGRAMS)
$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@)
ifdef JSMIN
@@ -1574,12 +1574,13 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.
-e '/@@GITWEB_CGI@@/d' \
-e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
-e '/@@GITWEB_CSS@@/d' \
- -e '/@@GITWEB_JS@@/r gitweb/gitweb.js' \
+ -e '/@@GITWEB_JS@@/r $(GITWEB_JS)' \
-e '/@@GITWEB_JS@@/d' \
-e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
$@.sh > $@+ && \
chmod +x $@+ && \
- mv $@+ $@
+ mv $@+ $@ && \
+ sed -i '' -e 's/min\.js/js/' $@
else # NO_PERL
$(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh
$(QUIET_GEN)$(RM) $@ $@+ && \
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 6a65f25..72f8c39 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -397,6 +397,7 @@ EOFGITWEB
gitweb_js () {
cat > "$1" <<\EOFGITWEB
@@GITWEB_JS@@
+
EOFGITWEB
}
-- 1.7.0.1.300.gd855a
next reply other threads:[~2010-03-19 7:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-19 6:02 Mark Rada [this message]
2010-03-19 7:36 ` [PATCH] instaweb: use minified gitweb.js if available Johannes Sixt
2010-03-19 14:07 ` Mark Rada
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=4BA3138F.1010201@mailservices.uwaterloo.ca \
--to=marada@uwaterloo.ca \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jnareb@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.