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

Re: [PATCH 1/2] gitweb: allow access to forks with strict_export

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 13, 2008, 21:53 UTC
Message-ID
<m3prjvg2st.fsf@localhost.localdomain>
In-Reply-To
<1229203014.31181.7.camel@mattlaptop2.local>
Matt McCutchen <matt@mattmccutchen.net> writes:
CC-ed Petr Baudis, author of forks support in gitweb.
Show 8 quoted lines
> git_get_projects_list excludes forks in order to unclutter the main
> project list, but this caused the strict_export check, which also relies
> on git_get_project_list, to incorrectly fail for forks.  This patch adds
> an argument so git_get_projects_list knows when it is being called for a
> strict_export check (as opposed to a user-visible project list) and
> doesn't exclude the forks.
> 
> Signed-off-by: Matt McCutchen <matt@mattmccutchen.net>
Looks good for me.
Acked-by: Jakub Narebski <jnareb@gmail.com>
Show 38 quoted lines
> ---
>  gitweb/gitweb.perl |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 86511cf..5357bcc 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -1144,7 +1144,8 @@ sub untabify {
>  
>  sub project_in_list {
>  	my $project = shift;
> -	my @list = git_get_projects_list();
> +	# Tell git_get_projects_list to include forks.
> +	my @list = git_get_projects_list(undef, 1);
>  	return @list && scalar(grep { $_->{'path'} eq $project } @list);
>  }
>  
> @@ -2128,13 +2129,13 @@ sub git_get_project_url_list {
>  }
>  
>  sub git_get_projects_list {
> -	my ($filter) = @_;
> +	my ($filter, $for_strict_export) = @_;
>  	my @list;
>  
>  	$filter ||= '';
>  	$filter =~ s/\.git$//;
>  
> -	my $check_forks = gitweb_check_feature('forks');
> +	my $check_forks = !$for_strict_export && gitweb_check_feature('forks');
>  
>  	if (-d $projects_list) {
>  		# search in directory
> -- 
> 1.6.1.rc2.27.gc7114
> 
> 
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Matt McCutchenNext: Junio C Hamano
Message 2 of 7 in “gitweb: allow access to forks with strict_export”
  1. 1/2 gitweb: allow access to forks with strict_exportMatt McCutchen, Dec 13, 2008
  2. Jakub NarebskiDec 13, 2008
  3. Junio C HamanoDec 13, 2008
  4. Jakub NarebskiDec 13, 2008
  5. Matt McCutchenDec 14, 2008
  6. Jakub NarebskiDec 20, 2008
  7. Matt McCutchenDec 14, 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.