Re: [PATCH] gitweb: fill in gitweb configuration by Makefile
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:35
- Luben Tuikov [off-list ref] writes:
-- Martin Waitz [off-list ref] wrote:quoted
Generate gitweb/gitweb.cgi to reduce the need to patch gitweb.cgi by the end user. The GIT installation directory and version are already known by the Makefile, they can be inserted directly into gitweb. All other gitweb configuration parameters can now be specified by providing GITWEB_* variables while building GIT. These are described in gitweb/README.NACK. I don't like it. While this method works, it is too much effort to have to run make to do this, plus it pollutes your tree.
I do not quite agree with this reasoning. With that definition
of "polluting your tree", all build of git-*.{sh,perl,py} are
polluting your tree. If compile/install time customization is
handier I do not have problem doing it that way.
Instead, what you can do is make gitweb.cgi read a text file from . which has those variables defined.
I think there was a discussion on having a configuration file for gitweb (not per-repository .git/config but installation wide configuration file). If I recall correctly, the killer argument against it was that you would need to bootstrap the process by somehow telling gitweb.cgi where to read from that configuration file, and if you are going to customize gitweb.cgi before installation for the site that way, then giving a bit more configuration in gitweb.cgi (like Martin did in the patch we are discussion) is simpler.
- no need to run make to build "gitweb.cgi" or "gitweb.pl" whatever
you call it,
- no need to pollute your tree with site defined variables,
- simple copy (cp) would install a working version, instead of
the current cp + patch with local settings method.
While I agree all of these "no need to" makes things slightly
simpler, I do not think it is such a big deal -- we are building
git-*.{sh,perl,py,c} anyway.