* [PATCHv5 4/6] instaweb: add minification awareness
@ 2010-04-01 5:36 Mark Rada
2010-04-01 11:09 ` Jakub Narebski
0 siblings, 1 reply; 3+ messages in thread
From: Mark Rada @ 2010-04-01 5:36 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jakub Narebski
This patch will cause git-instaweb to use the minified version of gitweb
support files (e.g. CSS and JavaScript) if they were generated.
Without minification awareness, generating the minified version of
gitweb's support files will generate a broken instaweb script since the
copy of gitweb.cgi will look for gitweb.min.* which will not exist.
Signed-off-by: Mark Rada <marada@uwaterloo.ca>
---
No changes since previous revision.
Makefile | 12 ++++++++++--
git-instaweb.sh | 6 ++++--
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index ef1a232..c97021f 100644
--- a/Makefile
+++ b/Makefile
@@ -1565,9 +1565,15 @@ gitweb:
ifdef JSMIN
GITWEB_PROGRAMS += gitweb/gitweb.min.js
+GITWEB_JS = gitweb/gitweb.min.js
+else
+GITWEB_JS = gitweb/gitweb.js
endif
ifdef CSSMIN
GITWEB_PROGRAMS += gitweb/gitweb.min.css
+GITWEB_CSS = gitweb/gitweb.min.css
+else
+GITWEB_CSS = gitweb/gitweb.css
endif
OTHER_PROGRAMS += gitweb/gitweb.cgi $(GITWEB_PROGRAMS)
gitweb/gitweb.cgi: gitweb/gitweb.perl $(GITWEB_PROGRAMS)
@@ -1590,11 +1596,13 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
-e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \
-e '/@@GITWEB_CGI@@/d' \
- -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
+ -e '/@@GITWEB_CSS@@/r $(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' \
+ -e 's|@@GITWEB_CSS_NAME@@|$(GITWEB_CSS)|' \
+ -e 's|@@GITWEB_JS_NAME@@|$(GITWEB_JS)|' \
$@.sh > $@+ && \
chmod +x $@+ && \
mv $@+ $@
diff --git a/git-instaweb.sh b/git-instaweb.sh
index 6a65f25..d4941a9 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -391,18 +391,20 @@ EOFGITWEB
gitweb_css () {
cat > "$1" <<\EOFGITWEB
@@GITWEB_CSS@@
+
EOFGITWEB
}
gitweb_js () {
cat > "$1" <<\EOFGITWEB
@@GITWEB_JS@@
+
EOFGITWEB
}
gitweb_cgi "$GIT_DIR/gitweb/gitweb.cgi"
-gitweb_css "$GIT_DIR/gitweb/gitweb.css"
-gitweb_js "$GIT_DIR/gitweb/gitweb.js"
+gitweb_css "$GIT_DIR/@@GITWEB_CSS_NAME@@"
+gitweb_js "$GIT_DIR/@@GITWEB_JS_NAME@@"
case "$httpd" in
*lighttpd*)
--
1.7.0.3.519.g7e0613
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCHv5 4/6] instaweb: add minification awareness
2010-04-01 5:36 [PATCHv5 4/6] instaweb: add minification awareness Mark Rada
@ 2010-04-01 11:09 ` Jakub Narebski
2010-04-01 20:50 ` Eric Wong
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Narebski @ 2010-04-01 11:09 UTC (permalink / raw)
To: Mark Rada; +Cc: git, Junio C Hamano, Eric Wong
On Thu, 1 Apr 2010, Mark Rada wrote:
> This patch will cause git-instaweb to use the minified version of gitweb
> support files (e.g. CSS and JavaScript) if they were generated.
I was not sure if git-instaweb should use minified files or not, and
that is why I didn't add support for this to git-instaweb generation.
But I forgot that git-instaweb uses gitweb.cgi... which in turn can
use minified versions of gitweb support files.
>
> Without minification awareness, generating the minified version of
> gitweb's support files will generate a broken instaweb script since the
> copy of gitweb.cgi will look for gitweb.min.* which will not exist.
Good catch!
>
> Signed-off-by: Mark Rada <marada@uwaterloo.ca>
CC-ed Eric Wong, original author of git-instaweb.sh script.
> ---
>
> No changes since previous revision.
>
>
> Makefile | 12 ++++++++++--
> git-instaweb.sh | 6 ++++--
> 2 files changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index ef1a232..c97021f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1565,9 +1565,15 @@ gitweb:
>
> ifdef JSMIN
> GITWEB_PROGRAMS += gitweb/gitweb.min.js
> +GITWEB_JS = gitweb/gitweb.min.js
> +else
> +GITWEB_JS = gitweb/gitweb.js
> endif
> ifdef CSSMIN
> GITWEB_PROGRAMS += gitweb/gitweb.min.css
> +GITWEB_CSS = gitweb/gitweb.min.css
> +else
> +GITWEB_CSS = gitweb/gitweb.css
> endif
> OTHER_PROGRAMS += gitweb/gitweb.cgi $(GITWEB_PROGRAMS)
> gitweb/gitweb.cgi: gitweb/gitweb.perl $(GITWEB_PROGRAMS)
> @@ -1590,11 +1596,13 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.
> -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
> -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \
> -e '/@@GITWEB_CGI@@/d' \
> - -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
> + -e '/@@GITWEB_CSS@@/r $(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' \
> + -e 's|@@GITWEB_CSS_NAME@@|$(GITWEB_CSS)|' \
> + -e 's|@@GITWEB_JS_NAME@@|$(GITWEB_JS)|' \
> $@.sh > $@+ && \
> chmod +x $@+ && \
> mv $@+ $@
> diff --git a/git-instaweb.sh b/git-instaweb.sh
> index 6a65f25..d4941a9 100755
> --- a/git-instaweb.sh
> +++ b/git-instaweb.sh
> @@ -391,18 +391,20 @@ EOFGITWEB
> gitweb_css () {
> cat > "$1" <<\EOFGITWEB
> @@GITWEB_CSS@@
> +
> EOFGITWEB
> }
>
> gitweb_js () {
> cat > "$1" <<\EOFGITWEB
> @@GITWEB_JS@@
> +
> EOFGITWEB
> }
>
> gitweb_cgi "$GIT_DIR/gitweb/gitweb.cgi"
> -gitweb_css "$GIT_DIR/gitweb/gitweb.css"
> -gitweb_js "$GIT_DIR/gitweb/gitweb.js"
> +gitweb_css "$GIT_DIR/@@GITWEB_CSS_NAME@@"
> +gitweb_js "$GIT_DIR/@@GITWEB_JS_NAME@@"
>
> case "$httpd" in
> *lighttpd*)
> --
> 1.7.0.3.519.g7e0613
>
>
--
Jakub Narebski
Poland
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCHv5 4/6] instaweb: add minification awareness
2010-04-01 11:09 ` Jakub Narebski
@ 2010-04-01 20:50 ` Eric Wong
0 siblings, 0 replies; 3+ messages in thread
From: Eric Wong @ 2010-04-01 20:50 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Mark Rada, git, Junio C Hamano
Jakub Narebski <jnareb@gmail.com> wrote:
> On Thu, 1 Apr 2010, Mark Rada wrote:
>
> > This patch will cause git-instaweb to use the minified version of gitweb
> > support files (e.g. CSS and JavaScript) if they were generated.
>
> I was not sure if git-instaweb should use minified files or not, and
> that is why I didn't add support for this to git-instaweb generation.
> But I forgot that git-instaweb uses gitweb.cgi... which in turn can
> use minified versions of gitweb support files.
It can make distro installation footprints smaller, which would
be appreciated.
> > Without minification awareness, generating the minified version of
> > gitweb's support files will generate a broken instaweb script since the
> > copy of gitweb.cgi will look for gitweb.min.* which will not exist.
>
> Good catch!
> >
> > Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Thanks Jakub and Mark,
Acked-by: Eric Wong <normalperson@yhbt.net>
--
Eric Wong
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-04-01 20:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-01 5:36 [PATCHv5 4/6] instaweb: add minification awareness Mark Rada
2010-04-01 11:09 ` Jakub Narebski
2010-04-01 20:50 ` Eric Wong
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).