From: Jakub Narebski <jnareb@gmail.com>
To: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Cc: git@vger.kernel.org, Christian Couder <chriscool@tuxfamily.org>,
Petr Baudis <pasky@ucw.cz>
Subject: Re: [RFC/PATCH 1/4] gitweb: Move subroutines to Gitweb::Config module
Date: Tue, 8 Jun 2010 14:46:20 +0200 [thread overview]
Message-ID: <201006081446.22587.jnareb@gmail.com> (raw)
In-Reply-To: <1275943844-24991-1-git-send-email-pavan.sss1991@gmail.com>
A few generic comments about this whole series.
First, when you are sending larger patch series (and I think this series
of 4 patches qualify), you should provide cover letter, [RFC/PATCH 0/4]
in this case, describing the series. git-format-patch has --cover-letter
option to make it easier to write such cover letters. I could then write
generic comments about whole series as comments to cover letter...
Second, all those commits about splitting gitweb should perhaps be
reorganized (rebased). Currently you have 'create Gitweb::Config',
'create Gitweb::Git', 'move subs to Gitweb::Config'; if Gitweb::Git
was created before Gitweb::Config, you would not need two commits
to create Gitweb::Config (to be exact even more than two, as not all
subroutines are moved, as you write yourself).
Third, and I think most important, is that the whole splitting gitweb into
modules series seems to alck direction, some underlying architecture
design. For example Gitweb::HTML, Gitweb::HTML::Link, Gitweb::HTML::String
seems to me too detailed, too fine-grained modules.
It was not visible at first, because Gitweb::Config, Gitweb::Request and to
a bit lesser extent Gitweb::Git fell out naturally. But should there be
for example Gitweb::Escape module, or should its functionality be a part of
Gitweb::Util? Those issues needs to be addressed. Perhaps they were
discussed with this GSoC project mentors (via IRC, private email, IM), but
we don't know what is the intended architecture design of gitweb.
Should we try for Model-Viewer-Controller pattern without backing MVC
(micro)framework? (One of design decisions for gitweb was have it working
out of the box if Perl and git are installed, without requiring to install
extra modules; but now we can install extra Perl modules e.g. from CPAN
under lib/...). How should we organize gitweb code into packages
(modules)?
Perhaps having gitweb.perl, Gitweb::Git, Gitweb::Config, Gitweb::Request,
Gitweb::Util and Gitweb would be enough? Should it be Gitweb::HTML or
Gitweb::View? Etc., etc.,...
That is a very important question.
On Mon, 7 June 2010, Pavan Kumar Sunkara wrote:
> Subject: [RFC/PATCH 1/4] gitweb: Move subroutines to Gitweb::Config module
>
This summary doesn't tell us much. What subroutines, or what kind of
subroutines were moved to Gitweb::Config? Why they were moved, and why
they weren't there from beginning (perhaps it would be better to simply
reorder patches, to have creation of Gitweb::Git before creation of
Gitweb::Config)? Why can they be moved now?
Not all of those questions can be answered in summary (subject line for
email), but it should tell us what this commit is about.
> Subroutines moved:
> gitweb_get_feature
> gitweb_check_feature
> filter_snapshot_fmts
> configure_gitweb_features
I can find which subroutines were moved from the patch itself. What
I cannot find without good commit message is _why_ do you feel they
belong in Gitweb::Config (unless it is obvious), and why they can be
moved now and why they could not be moved earlier.
>
> Subroutines yet to move: (Contains not yet packaged subs & vars)
> feature_bool
> feature_avatar
> feature_snapshot
> feature_patches
Why they can't be moved; what is missing? That is the question that commit
message should answer, or at least hint about / point the direction.
>
> Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
> ---
> diff --git a/gitweb/lib/Gitweb/Config.pm b/gitweb/lib/Gitweb/Config.pm
> index fdab9f7..3810fda 100644
> --- a/gitweb/lib/Gitweb/Config.pm
> +++ b/gitweb/lib/Gitweb/Config.pm
> @@ -10,13 +10,16 @@ use strict;
> use warnings;
> use Exporter qw(import);
>
> -our @EXPORT = qw(evaluate_gitweb_config $version $projectroot $project_maxdepth $mimetypes_file
> +our @EXPORT = qw(evaluate_gitweb_config gitweb_check_feature gitweb_get_feature configure_gitweb_features
> + filter_snapshot_fmts $version $projectroot $project_maxdepth $mimetypes_file $git_avatar
> $projects_list @git_base_url_list $export_ok $strict_export $home_link_str $site_name
> $site_header $site_footer $home_text @stylesheets $stylesheet $logo $favicon $javascript
> $GITWEB_CONFIG $GITWEB_CONFIG_SYSTEM $logo_url $logo_label $export_auth_hook
> $projects_list_description_width $default_projects_order $default_blob_plain_mimetype
> $default_text_plain_charset $fallback_encoding @diff_opts $prevent_xss $maxload
> - %avatar_size %known_snapshot_formats %known_snapshot_format_aliases %feature);
> + %avatar_size %known_snapshot_formats %feature @snapshot_fmts);
I think it would be better to have exported subroutines separated from
exported variables at least in that exported variables should begin on new
line. This way it would be easier to see what was added, and (sometimes)
what was removed.
I had to look carefully to notice that you have removed the
%known_snapshot_format_aliases variable. This was not mentioned in the
commit message. There was no reason for removing it given in the commit
message (probably it was removed because it is internal to gitweb, and is
used only for backward compatibility with older configs... but it might be
not so internal, and might be useful and should be exported).
> +
> +use Gitweb::Git qw($git_dir);
O.K.
> +sub gitweb_get_feature {
[...]
> + # project specific override is possible only if we have project
> + if (!$override || !defined $git_dir) {
> + return @defaults;
> + }
Note that '!defined $git_dir' is a bit of hack, to check whether we are in
git repository and if we can run per-repository config. This probably
could be solved better... but I don't mean that you would have to solve it.
It can be left for later.
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2010-06-08 12:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-07 20:50 [RFC/PATCH 1/4] gitweb: Move subroutines to Gitweb::Config module Pavan Kumar Sunkara
2010-06-07 20:50 ` [RFC/PATCH 2/4] gitweb: Create Gitweb::HTML::Link module Pavan Kumar Sunkara
2010-06-07 20:50 ` [RFC/PATCH 3/4] gitweb: Create Gitweb::HTML module Pavan Kumar Sunkara
2010-06-07 20:50 ` [RFC/PATCH 4/4] gitweb: Create Gitweb::HTML::String module Pavan Kumar Sunkara
2010-06-07 20:58 ` Pavan Kumar Sunkara
2010-06-08 12:46 ` Jakub Narebski [this message]
2010-06-08 13:50 ` [RFC/PATCH 1/4] gitweb: Move subroutines to Gitweb::Config module Ævar Arnfjörð Bjarmason
2010-06-12 1:01 ` Jakub Narebski
2010-06-12 1:22 ` Ævar Arnfjörð Bjarmason
2010-06-12 1:41 ` Jakub Narebski
2010-06-08 14:13 ` Petr Baudis
2010-06-08 19:22 ` Pavan Kumar Sunkara
2010-06-08 19:55 ` Petr Baudis
2010-06-08 20:24 ` Pavan Kumar Sunkara
2010-06-08 20:50 ` Petr Baudis
2010-06-08 23:38 ` Jakub Narebski
2010-06-09 13:13 ` Jakub Narebski
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=201006081446.22587.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=pasky@ucw.cz \
--cc=pavan.sss1991@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).