{"thread":{"id":"24773","subject":"[RFC] Splitting gitweb and build-time configuration variables","startedAt":"2010-08-17T18:15:36Z","lastAt":"2010-08-18T08:05:48Z","messageCount":3,"participants":["Jakub Narebski","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"148300","messageId":"201008172015.37353.jnareb@gmail.com","threadId":"24773","inReplyTo":null,"subject":"[RFC] Splitting gitweb and build-time configuration variables","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-08-17T18:15:36Z","receivedAt":"2010-08-17T18:15:36Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"I am planning on picking up and resubmitting \"splitting gitweb\" series,\nwhich was created by Pavan as a prerequisite for adding write and admin\nsupport to gitweb (\"Splitting gitweb and developing write \nfunctionalities (Integrated web client for git)\" GSoC 2010 project).\n\nThere is a question what to do about gitweb configuration variables \nwhich are set during build time, like e.g.:\n\n  # URI of stylesheets\n  our @stylesheets = (\"++GITWEB_CSS++\");\n\nor\n\n  # core git executable to use\n  # this can just be \"git\" if your webserver has a sensible PATH\n  our $GIT = \"++GIT_BINDIR++/git\";\n\n\nI think it was agreed that _setting_ these variables would be left in \ngitweb.perl, to have one single place which gathers all such variables, \nand to have gitweb/Makefile to munge (transform) only a single file.\n\nSo those variables would be _declared_ in appropriate gitweb module \n(Gitweb::Git aka Gitweb::Command, Gitweb::Config, Gitweb::Util etc.)\nbut would be _defined_ (set to value) in gitweb.perl.  The final goal is \nto have gitweb.perl consist only of loading modules, build-time \nconfiguration, and starting gitweb (calling run() or similarly named \nsubroutine or method).\n\nThe question is where *description* of those build time configuration \nvariables should be (see the above examples).  Should it be:\n\n1. Description of build-time configuration variable is in the module\n   that defines it, and each block of variables coming from the same\n   module would have notice where one can find description of those\n   variables, like in original patches by Pavan, e.g.:\n\n     # Only configuration variables with build-time overridable\n     # defaults are listed below. The complete set of variables\n     # with their descriptions is listed in Gitweb::Config.\n\nor\n\n2. Description of build-time configuration variables is in gitweb.perl,\n   and in each module there is comment that full description of those\n   variables can be found there, e.g. (proposal):\n\n     # Values of those variables are set during build time in \n     # gitweb/gitweb.perl (main script).  You can find their description\n     # there.\n\nor perhaps\n\n3. Duplicate description of those variables, to have it both in\n   appropriate module and in gitweb.perl\n\n\nWhat do you think about it?\n\n-- \nJakub Narebski\nPoland\n"},{"id":"148334","messageId":"20100818030321.GB21185@burratino","threadId":"24773","inReplyTo":"201008172015.37353.jnareb@gmail.com","subject":"Re: [RFC] Splitting gitweb and build-time configuration variables","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-18T03:03:21Z","receivedAt":"2010-08-18T03:03:21Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jakub Narebski wrote:\n\n> 1. Description of build-time configuration variable is in the module\n>    that defines it, and each block of variables coming from the same\n>    module would have notice where one can find description of those\n>    variables\n[...]\n> 2. Description of build-time configuration variables is in gitweb.perl,\n>    and in each module there is comment that full description of those\n>    variables can be found there, e.g. (proposal):\n> \n>      # Values of those variables are set during build time in \n>      # gitweb/gitweb.perl (main script).  You can find their description\n>      # there.\n[...]\n> 3. Duplicate description of those variables\n\nWith #2, a person reading the Makefile can grep for some particular\nsubstitution (++GITWEB_PROJECTROOT++) and quickly find the name and\ndescription of the variable it is used for.  If there were a 1:1\ncorrespondence between the variables in gitweb.perl and the Makefile,\nI would even suggest moving the description to the Makefile.\n\nIn practice, I suspect the run-time configuration is more important to\npeople.  That is already fairly well documented in gitweb/README.\n\nJust my two cents,\nJonathan\n"},{"id":"148342","messageId":"201008181005.49524.jnareb@gmail.com","threadId":"24773","inReplyTo":"20100818030321.GB21185@burratino","subject":"Re: [RFC] Splitting gitweb and build-time configuration variables","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-08-18T08:05:48Z","receivedAt":"2010-08-18T08:05:48Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Wed, 18 Aug 2010, Jonathan Nieder wrote:\n> Jakub Narebski wrote:\n> \n> > 1. Description of build-time configuration variable is in the module\n> >    that defines it, and each block of variables coming from the same\n> >    module would have notice where one can find description of those\n> >    variables\n> [...]\n> > 2. Description of build-time configuration variables is in gitweb.perl,\n> >    and in each module there is comment that full description of those\n> >    variables can be found there, e.g. (proposal):\n> > \n> >      # Values of those variables are set during build time in \n> >      # gitweb/gitweb.perl (main script).  You can find their description\n> >      # there.\n> [...]\n> > 3. Duplicate description of those variables\n> \n> With #2, a person reading the Makefile can grep for some particular\n> substitution (++GITWEB_PROJECTROOT++) and quickly find the name and\n> description of the variable it is used for.  If there were a 1:1\n> correspondence between the variables in gitweb.perl and the Makefile,\n> I would even suggest moving the description to the Makefile.\n\nThere is a bit of difference between Perl variables in gitweb.perl and\nmake build-time variables in gitweb/Makefile, namely:\n\n  our $GIT = \"++GIT_BINDIR++/git\";\n\n  our $site_name = \"++GITWEB_SITENAME++\"\n                 || ($ENV{'SERVER_NAME'} || \"Untitled\") . \" Git\";\n\n  our @stylesheets = (\"++GITWEB_CSS++\");\n\n  our @git_base_url_list = grep { $_ ne '' } (\"++GITWEB_BASE_URL++\");\n\n  our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || \"++GITWEB_CONFIG++\";\n  our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'}\n                            || \"++GITWEB_CONFIG_SYSTEM++\";\n\nPerl variables can be overriden in run-time configuration (testsuite\nuses this to test _source_ version i.e. gitweb.perl rather than \ngenerated gitweb.cgi), so they have to be described anyway.\n\nI think that adding description of make variables to gitweb/Makefile,\nsimilar to what main Makefile does, would be a good idea, though I don't\nlike that it leads to some duplication.\n\n> \n> In practice, I suspect the run-time configuration is more important to\n> people.  That is already fairly well documented in gitweb/README.\n\nBuild-time configuration is also described in gitweb/README, in more\ndetail.\n\n-- \nJakub Narebski\nPoland\n"}]}