git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: "Devin Doucette" <devin@doucette.cc>
Cc: git@vger.kernel.org, "Petr Baudis" <petr.baudis@novartis.com>
Subject: Re: [PATCH] gitweb: Fix export check in git_get_projects_list
Date: Mon, 29 Dec 2008 13:29:25 +0100	[thread overview]
Message-ID: <200812291329.28701.jnareb@gmail.com> (raw)
In-Reply-To: <200812280312.02615.jnareb@gmail.com>

On Sun, 28 Dec 2008, Jakub Narebski wrote:
> On Sat, 27 Dec 2008, Devin Doucette wrote:

> > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> > index 8f574c7..99f71b4 100755
> > --- a/gitweb/gitweb.perl
> > +++ b/gitweb/gitweb.perl
> > @@ -2147,8 +2147,9 @@ sub git_get_projects_list {
> > 
> >  				my $subdir = substr($File::Find::name, $pfxlen + 1);
> >  				# we check related file in $projectroot
> > -				if (check_export_ok("$projectroot/$filter/$subdir")) {
> > -					push @list, { path => ($filter ? "$filter/" : '') . $subdir };
> > +				my $path = ($filter ? "$filter/" : '') . $subdir;
> 
> Nice and clear, but wouldn't be better to use slightly more effective
> 
> +				my $path = $filter ? "$filter/$subdir" : $subdir;
> 
> Or even, taking care of the case when $filter eq '0'
> 
> +				my $path = defined $filter && $filter ne '' ? "$filter/$subdir" : $subdir;

Err, actually with "$filter ||= '';" earlier in git_get_projects_list
this is not necessary, and is not an improvement.
 
-- 
Jakub Narebski
Poland

      parent reply	other threads:[~2008-12-29 12:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-27  9:39 [PATCH] gitweb: Fix export check in git_get_projects_list Devin Doucette
2008-12-28  2:12 ` Jakub Narebski
2008-12-28  6:54   ` Junio C Hamano
2008-12-29 12:29   ` Jakub Narebski [this message]

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=200812291329.28701.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=devin@doucette.cc \
    --cc=git@vger.kernel.org \
    --cc=petr.baudis@novartis.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).