git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Matt McCutchen <matt@mattmccutchen.net>
Cc: git@vger.kernel.org, Petr Baudis <pasky@suse.cz>
Subject: Re: [PATCH 1/2] gitweb: allow access to forks with strict_export
Date: Sat, 13 Dec 2008 13:53:26 -0800 (PST)	[thread overview]
Message-ID: <m3prjvg2st.fsf@localhost.localdomain> (raw)
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.

> 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>

> ---
>  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

  reply	other threads:[~2008-12-13 21:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-13 21:16 [PATCH 1/2] gitweb: allow access to forks with strict_export Matt McCutchen
2008-12-13 21:53 ` Jakub Narebski [this message]
2008-12-13 22:31   ` Junio C Hamano
2008-12-13 22:51     ` Jakub Narebski
2008-12-14  2:06       ` Matt McCutchen
2008-12-20  0:35         ` Jakub Narebski
2008-12-14  1:51     ` Matt McCutchen

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=m3prjvg2st.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=matt@mattmccutchen.net \
    --cc=pasky@suse.cz \
    /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).