git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] instaweb: use minified gitweb.js if available

From
Mark Rada <marada@uwaterloo.ca>
Date
Mar 19, 2010, 06:02 UTC
Message-ID
<4BA3138F.1010201@mailservices.uwaterloo.ca>
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: Johannes Sixt
Message 1 of 3 in “instaweb: use minified gitweb.js if available”
  1. instaweb: use minified gitweb.js if availableMark Rada, Mar 19, 2010
  2. Johannes SixtMar 19, 2010
  3. Mark RadaMar 19, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.