All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Charles Bailey <charles@hashpling.org>,
	Mark Rada <marada@uwaterloo.ca>,
	git@vger.kernel.org
Subject: Re: [PATCHv5 2/6] Gitweb: add support for minifying gitweb.css
Date: Thu, 15 Apr 2010 02:25:41 +0200	[thread overview]
Message-ID: <201004150225.42101.jnareb@gmail.com> (raw)
In-Reply-To: <7viq7tmvsb.fsf@alter.siamese.dyndns.org>

On Thu, 15 Apr 2010, Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>> On Tue, 13 April 2010, Charles Bailey wrote:
>>> On 01/04/2010 06:36, Mark Rada wrote:
>>>> @@ -84,13 +92,14 @@ endif
>>>>
>>>>   all:: gitweb.cgi
>>>>
>>>> +FILES = gitweb.cgi
>>>>   ifdef JSMIN
>>>> +FILES += gitweb.min.js
>>>> +endif
>>>> +ifdef CSSMIN
>>>> +FILES += gitweb.min.css
>>>> +endif
>>>> +gitweb.cgi: gitweb.perl $(GITWEB_JS) $(GITWEB_CSS)
>>
>> GITWEB_JS and GITWEB_CSS were originally meant to be URI to file with
>> gitweb JavaScript code and default gitweb stylesheet,... but during work
>> on minification of JavaScript code and CSS file it somehow got confused
>> to mean source path.
> 
> I am not touching instaweb part, but this would fix the build/clean side
> of the things, no?

Close, see below.

> 
> -->8 --
> gitweb: simplify gitweb.min.* generation and clean-up rules
> 
> GITWEB_CSS and GITWEB_JS are meant to be "what URI should the installed
> cgi script use to refer to the stylesheet and JavaScript", never "this is
> the name of the file we are building".
> 
> Lose incorrect assignment to them.

Actually the assignment was intended to provide correct *default* values
for GITWEB_CSS and GITWEB_JS, so that if e.g. JSMIN is defined gitweb,
in absence of build time configuration, would link gitweb.min.js instead
of gitweb.js.

> 
> While we are at it, lose FILES that is used only for "clean" target in a
> misguided way.  "make clean" should try to remove all the potential build
> artifacts regardless of a minor configuration change.  Instead of trying
> to remove only the build product "make clean" would have created if it
> were run without "clean", explicitly list the three potential build
> products for removal.

Good.

> 
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  gitweb/Makefile |   15 ++++-----------
>  1 files changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/gitweb/Makefile b/gitweb/Makefile
> index ffee4bd..1787633 100644
> --- a/gitweb/Makefile
> +++ b/gitweb/Makefile
> @@ -80,16 +80,7 @@ endif
>  
>  all:: gitweb.cgi
>  
> -FILES = gitweb.cgi
> -ifdef JSMIN
> -FILES += gitweb.min.js
> -GITWEB_JS = gitweb.min.js
> -endif
> -ifdef CSSMIN
> -FILES += gitweb.min.css
> -GITWEB_CSS = gitweb.min.css
> -endif

I wonder about removing assigmnet to GITWEB_JS and GITWEB_CSS.  Without
it "make gitweb" (in top dir) would create gitweb/gitweb.cgi and 
gitweb/gitweb.min.js etc.... but generated gitweb/gitweb.cgi would
refer to gitweb.js, not gitweb.min.js.  Unless of course one provides
values for GITWEB_JS during build time.

> -gitweb.cgi: gitweb.perl $(GITWEB_JS) $(GITWEB_CSS)
> +gitweb.cgi: gitweb.perl
>  
>  gitweb.cgi:
>  	$(QUIET_GEN)$(RM) $@ $@+ && \
> @@ -118,16 +109,18 @@ gitweb.cgi:
>  	mv $@+ $@
>  
>  ifdef JSMIN
> +all:: gitweb.min.js
>  gitweb.min.js: gitweb.js
>  	$(QUIET_GEN)$(JSMIN) <$<>$@
>  endif # JSMIN
>  
>  ifdef CSSMIN
> +all:: gitweb.min.css
>  gitweb.min.css: gitweb.css
>  	$(QUIET_GEN)$(CSSMIN) <$>$@
>  endif

That makes gitweb.cgi not depend on gitweb.min.js, not gitweb.min.css.
It might be right... and I think the rightness or wrongness might be
tied with values of GITWEB>JS and GITWEB_CSS.

>  
>  clean:
> -	$(RM) $(FILES)
> +	$(RM) gitweb.cgi gitweb.min.css gitweb.min.js
>  
>  .PHONY: all clean .FORCE-GIT-VERSION-FILE
> 

-- 
Jakub Narebski
Poland

  parent reply	other threads:[~2010-04-15  0:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-01  5:36 [PATCHv5 2/6] Gitweb: add support for minifying gitweb.css Mark Rada
2010-04-01  8:51 ` Jakub Narebski
2010-04-13 20:28 ` Charles Bailey
2010-04-13 22:30   ` Jakub Narebski
2010-04-14  5:40     ` Mark Rada
2010-04-14 17:22       ` Jakub Narebski
2010-04-14 19:17         ` Mark Rada
2010-04-14 20:04           ` Jakub Narebski
2010-04-14 23:58     ` Junio C Hamano
2010-04-15  0:18       ` Charles Bailey
2010-04-15  0:25       ` Jakub Narebski [this message]
2010-04-15  0:46         ` Junio C Hamano
2010-04-15  1:02           ` Jakub Narebski
2010-04-15  1:21             ` Mark Rada
2010-04-15  1:42           ` Junio C Hamano

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=201004150225.42101.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=charles@hashpling.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=marada@uwaterloo.ca \
    /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.