git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb: Fix export check in git_get_projects_list

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 29, 2008, 12:29 UTC
Message-ID
<200812291329.28701.jnareb@gmail.com>
In-Reply-To
<200812280312.02615.jnareb@gmail.com>
On Sun, 28 Dec 2008, Jakub Narebski wrote:
> On Sat, 27 Dec 2008, Devin Doucette wrote:
Show 19 quoted lines
> > 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
Previous: Junio C Hamano
Message 4 of 4 in “gitweb: Fix export check in git_get_projects_list”
  1. gitweb: Fix export check in git_get_projects_listDevin Doucette, Dec 27, 2008
  2. Jakub NarebskiDec 28, 2008
  3. Junio C HamanoDec 28, 2008
  4. Jakub NarebskiDec 29, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.