git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Bruno Cesar Ribas <ribas@c3sl.ufpr.br>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Git Managment for C3SL <git@git.c3sl.ufpr.br>
Subject: Re: [PATCH] gitweb: Use the config file to set repository owner's name.
Date: Fri, 8 Feb 2008 16:33:54 +0100	[thread overview]
Message-ID: <200802081633.55934.jnareb@gmail.com> (raw)
In-Reply-To: <20080208143027.GA707@c3sl.ufpr.br>

I have joined the two emails to reply only once.

On Fri, 8 Feb 2008, Bruno Cesar Ribas wrote:
> On Fri, Feb 08, 2008 at 02:55:33AM -0800, Jakub Narebski wrote:
>> Bruno Ribas <ribas@c3sl.ufpr.br> writes:
>>> 
>>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
>>> index 8ef2735..e8a43b7 100755
>>> --- a/gitweb/gitweb.perl
>>> +++ b/gitweb/gitweb.perl
>>> @@ -1767,7 +1767,12 @@ sub git_get_project_owner {
>>>       if (exists $gitweb_project_owner->{$project}) {
>>>               $owner = $gitweb_project_owner->{$project};
>>>       }
>>> -     if (!defined $owner) {
>>> +
>>> +     if (!defined $owner){
>>> +             $owner = git_get_project_config('owner');
>>> +     }
>>> +
>>> +     if (!$owner) {
>>>               $owner = get_file_owner("$projectroot/$project");
>>>       }

Another comment: why did you change from checking of "!defined $owner"
to checking "!$owner"? git_get_project_config('owner') returns undef
if gitweb.owner is not defined. With checking for defined we can avoid
false positives of owner being "0" (in practice I think this does not
matter) or "" (this could happen if somebody doesn't want for project
to have owner shown).

>> First, I think the empty lines added are not needed.
> 
> I made those empty lines because original code had same empty lines
> above, I just let it to have same pattern, but I can remove. Should I
> remove?!

The idea was for empty lines to separate blocks of code: variables 
declaration, initialization, finding an owner, and return value.
So I think that empty lines are not needed here. There were no empty 
lines between check for owner in the structure populated by 
git_get_project_list_from_file() and checking filesystem stat for 
project directory owner.

By the way, the git_get_project_list_from_file() interface is a bit 
strange...

> I that last 3lines should be inside the block that we call
> git_get_project_config, don't you think?

No. I think using "if (!defined $foo) { maybe define foo }..."
sequence is a good flow.

> I'll resend [...] with $git_dir set.

And with signoff corrected, I assume?

Please try to check if the code works with and without gitweb.owner set 
before sending new version of the patch...
-- 
Jakub Narebski
Poland

  reply	other threads:[~2008-02-08 15:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08  4:41 Adding gitweb.owner, last shot Bruno Ribas
2008-02-08  4:41 ` [PATCH] gitweb: Use the config file to set repository owner's name Bruno Ribas
2008-02-08  4:41   ` [PATCH] gitweb: Update gitweb/README to include the new per-repository gitweb.owner Bruno Ribas
2008-02-08 10:55   ` [PATCH] gitweb: Use the config file to set repository owner's name Jakub Narebski
2008-02-08 13:53     ` Bruno Cesar Ribas
2008-02-08 14:30       ` Bruno Cesar Ribas
2008-02-08 15:33         ` Jakub Narebski [this message]
2008-02-08 16:07           ` Bruno Cesar Ribas
2008-02-08  7:38 ` Adding gitweb.owner, last shot Junio C Hamano
2008-02-08 13:49   ` Bruno Cesar Ribas
2008-02-08 10:34 ` Jakub Narebski
2008-02-08 13:51   ` Bruno Cesar Ribas
  -- strict thread matches above, loose matches on Subject: below --
2008-02-08 16:38 git.owner, hope everything is fine Bruno Ribas
2008-02-08 16:38 ` [PATCH] gitweb: Use the config file to set repository owner's name Bruno Ribas
2008-02-13  0:52   ` Bruno Cesar Ribas
2008-02-13  1:05     ` Junio C Hamano

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=200802081633.55934.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@git.c3sl.ufpr.br \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ribas@c3sl.ufpr.br \
    /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).