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

Re: [PATCHv5 2/6] Gitweb: add support for minifying gitweb.css

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 13, 2010, 22:30 UTC
Message-ID
<201004140030.47222.jnareb@gmail.com>
In-Reply-To
<4BC4D3F0.5020107@hashpling.org>
On Tue, 13 April 2010, Charles Bailey wrote:
Show 33 quoted lines
> On 01/04/2010 06:36, Mark Rada wrote:
> > @@ -84,13 +92,14 @@ endif
> >
> >   all:: gitweb.cgi
> >
> > +FILES = gitweb.cgi
> >   ifdef JSMIN
> > -FILES=gitweb.cgi gitweb.min.js
> > -gitweb.cgi: gitweb.perl gitweb.min.js
> > -else # !JSMIN
> > -FILES=gitweb.cgi
> > -gitweb.cgi: gitweb.perl
> > -endif # JSMIN
> > +FILES += gitweb.min.js
> > +endif
> > +ifdef CSSMIN
> > +FILES += gitweb.min.css
> > +endif
> > +gitweb.cgi: gitweb.perl $(GITWEB_JS) $(GITWEB_CSS)
> >
> 
> I have a question about this last line of the patch. Are GITWEB_JS and 
> GITWEB_CSS supposed to be a source path or a URI?
> 
> The documentation for install (and my previous assumption) was that they 
> represented the path on the target web server. I'm used to overriding 
> them so that gitweb.cgi can live in my /cgi-bin directory, but the 
> static files are served from /gitweb which is readable but not executable.
> 
> After this patch I had to removed $(GITWEB_JS) and $(GITWEB_CSS) from 
> the list of dependencies for gitweb.cgi otherwise make failed.
> 
> Have I got the wrong end of the stick?
Thanks a lot for noticing this bug.

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.

If I remember correctly the original patch, before adding required support for minified gitweb.js and gitweb.css to git-instaweb script, and before support for CSS minification had

   ifdef JSMIN
   gitweb.cgi: gitweb.perl gitweb.min.js
   else
   gitweb.cgi: gitweb.perl
   endif
which should probably be replaced in current situation by
   ifdef JSMIN
   gitweb.cgi : gitweb.min.js
   endif
   ifdef CSSMIN
   gitweb.cgi : gitweb.min.css
   endif
just adding prerequisites to gitweb.css target in gitweb/Makefile

I guess that support for adding minifiction support to git-instaweb would need to be more complicated. Perhaps

  $(notdir $(GITWEB_JS))   # Makefile function
or
  $(basename $GITWEB_JS)   # shell command
But I guess that it wouldn't work for all cases...
-- 
Jakub Narebski
Poland
Previous: Charles BaileyNext: Mark Rada
Message 4 of 15 in “[PATCHv5 2/6] Gitweb: add support for minifying gitweb.css”
  1. Mark RadaApr 1, 2010
  2. Jakub NarebskiApr 1, 2010
  3. Charles BaileyApr 13, 2010
  4. Jakub NarebskiApr 13, 2010
  5. Mark RadaApr 14, 2010
  6. Jakub NarebskiApr 14, 2010
  7. Mark RadaApr 14, 2010
  8. Jakub NarebskiApr 14, 2010
  9. Junio C HamanoApr 14, 2010
  10. Charles BaileyApr 15, 2010
  11. Jakub NarebskiApr 15, 2010
  12. Junio C HamanoApr 15, 2010
  13. Jakub NarebskiApr 15, 2010
  14. Mark RadaApr 15, 2010
  15. Junio C HamanoApr 15, 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.