Re: [PATCH 6/6] GITWEB - Separate defaults from main file

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jakub Narebski
Date: Friday, December 11, 2009 - 3:53 pm

On Fri, 11 Dec 2009, J.H. wrote:


To be more exact you have to know that you have to drop _generated files_,
which means (for this version of patch) gitweb.cgi and gitweb_defaults.pl
(or whatever the generated file with config variables would be named).


ATTENTION!

Your changes would make stop working all gitweb tests.  Currently they
do some magic with generated gitweb config file "$(pwd)/gitweb_config.perl"
set via GITWEB_CONFIG configuration variable to be able to run
_unprocessed_ gitweb/gitweb.perl (without any substitutions).  This
allow to run tests on "live" version of gitweb.

After your changes it would be no longer possible, at least not if we
want to be sure that we test the same version of gitweb as gitweb_defaults.

It would probably mean that we need to move to testing built version,
i.e. gitweb.cgi, not gitweb.perl


Maybe I wasn't entirely clean.  I meant that the committed source file
should perhaps have *.in extension to denote that it is to be processed
via variable substitution, so it would be

  committed file: gitweb/gitweb_defaults.pl.in
  generated file: gitweb/gitweb_defaults.pl
 
or whatever name (*.pm?) we agree on.


I was not asking about that, but about

+	    $(patsubst %.cgi,%.perl,$(patsubst %.pl, %.perl, $@)) >$@+ && \

vs

+	    $(patsubst %.cgi,%.perl,$(patsubst %.pl,%.perl,$@)) >$@+ && \

But after thinking about it a bit, and consulting make documentation
(in particular definition of $@ variable) this rule shouldn't work at all.

`$@'
     The file name of the target of the rule.  If the target is an
     archive member, then `$@' is the name of the archive file.  In a
     pattern rule that has multiple targets (*note Introduction to
     Pattern Rules: Pattern Intro.), `$@' is the name of whichever
     target caused the rule's commands to be run.
 
What we need is to run pattern substitution for _two_ files, perhaps
using the for loop.

Also I think the order of substitutions would be better to be reversed:

    $(patsubst %.pl,%.perl,$(patsubst %.cgi,%.perl,$FILE)) >$FILE+

This way the gitweb_defaults file can even have *.perl extension


O.K.

But Makefile would be (slightly) simpler if replacements were needed only
for single file of two.
 
[...]

In my opinion it actually *makes worse*.  I am not sure if gitweb would
work if the variables are undefined, and you would lose 'undeclared 
variable' warning.
 

This header should probably be modified, at least stating what the file
is for.


See comment above about pre-declaring variables actually making it
worse wrt checking.


Errr... what you are talking about here?

-- 
Jakub Narebski
Poland
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/6] Gitweb caching changes v2, John 'Warthog9' Hawley, (Thu Dec 10, 4:45 pm)
[PATCH 1/6] GITWEB - Load Checking, John 'Warthog9' Hawley, (Thu Dec 10, 4:45 pm)
[PATCH 2/6] GITWEB - Missmatching git w/ gitweb, John 'Warthog9' Hawley, (Thu Dec 10, 4:45 pm)
[PATCH 3/6] GITWEB - Add git:// link to summary pages, John 'Warthog9' Hawley, (Thu Dec 10, 4:45 pm)
[PATCH 4/6] GITWEB - Makefile changes, John 'Warthog9' Hawley, (Thu Dec 10, 4:45 pm)
[PATCH 6/6] GITWEB - Separate defaults from main file, John 'Warthog9' Hawley, (Thu Dec 10, 4:45 pm)
Re: [PATCH 0/6] Gitweb caching changes v2, Sverre Rabbelier, (Thu Dec 10, 4:53 pm)
Re: [PATCH 1/6] GITWEB - Load Checking, Sverre Rabbelier, (Thu Dec 10, 4:54 pm)
Re: [PATCH 1/6] GITWEB - Load Checking, Jakub Narebski, (Thu Dec 10, 5:52 pm)
Re: [PATCH 1/6] GITWEB - Load Checking, Junio C Hamano, (Thu Dec 10, 6:10 pm)
Re: [PATCH 1/6] GITWEB - Load Checking, J.H., (Thu Dec 10, 7:19 pm)
Re: [PATCH 1/6] GITWEB - Load Checking, Junio C Hamano, (Thu Dec 10, 7:50 pm)
Re: [PATCH 1/6] GITWEB - Load Checking, J.H., (Thu Dec 10, 7:58 pm)
Re: [PATCH 1/6] GITWEB - Load Checking, J.H., (Thu Dec 10, 8:07 pm)
Re: [PATCH 1/6] GITWEB - Load Checking, Junio C Hamano, (Thu Dec 10, 8:09 pm)
Re: [PATCH 1/6] GITWEB - Load Checking, Jakub Narebski, (Fri Dec 11, 3:09 am)
Re: [PATCH 2/6] GITWEB - Missmatching git w/ gitweb, Jakub Narebski, (Fri Dec 11, 3:52 am)
Re: [PATCH 2/6] GITWEB - Missmatching git w/ gitweb, Johannes Schindelin, (Fri Dec 11, 5:49 am)
Re: [PATCH 3/6] GITWEB - Add git:// link to summary pages, Johannes Schindelin, (Fri Dec 11, 5:52 am)
Re: [PATCH 3/6] GITWEB - Add git:// link to summary pages, Jakub Narebski, (Fri Dec 11, 6:44 am)
Re: [PATCH 1/6] GITWEB - Load Checking, Mihamina Rakotomandimby, (Fri Dec 11, 6:53 am)
Re: [PATCH 4/6] GITWEB - Makefile changes, Jakub Narebski, (Fri Dec 11, 7:28 am)
Re: [PATCH 6/6] GITWEB - Separate defaults from main file, Jakub Narebski, (Fri Dec 11, 8:46 am)
Re: [PATCH 0/6] Gitweb caching changes v2, Jakub Narebski, (Fri Dec 11, 8:51 am)
Re: [PATCH 4/6] GITWEB - Makefile changes, J.H., (Fri Dec 11, 9:22 am)
Re: [PATCH 4/6] GITWEB - Makefile changes, Jakub Narebski, (Fri Dec 11, 9:41 am)
Re: [PATCH 0/6] Gitweb caching changes v2, Jakub Narebski, (Fri Dec 11, 11:01 am)
Re: [PATCH 0/6] Gitweb caching changes v2, J.H., (Fri Dec 11, 11:26 am)
Re: [PATCH 6/6] GITWEB - Separate defaults from main file, Jakub Narebski, (Fri Dec 11, 3:53 pm)
Re: [PATCH 0/6] Gitweb caching changes v2, Jakub Narebski, (Fri Dec 11, 6:37 pm)
Re: [PATCH 6/6] GITWEB - Separate defaults from main file, Junio C Hamano, (Tue Dec 15, 6:22 pm)
Re: [PATCH 6/6] GITWEB - Separate defaults from main file, Jakub Narebski, (Tue Dec 15, 7:22 pm)
Re: [PATCH 6/6] GITWEB - Separate defaults from main file, Jakub Narebski, (Wed Dec 16, 12:52 pm)
[PATCHv2 1/6] gitweb: Load checking, Jakub Narebski, (Fri Dec 18, 9:36 am)
[RFC/PATCHv2 2/6] gitweb: Add option to force version match, Jakub Narebski, (Fri Dec 18, 12:18 pm)
[PATCH/RFCv2 4/6] gitweb: Makefile improvements, Jakub Narebski, (Sat Dec 19, 6:32 am)