{"thread":{"id":"28738","subject":"[PATCH] gitweb: fix regression when filtering out forks","startedAt":"2011-10-21T19:04:21Z","lastAt":"2011-10-21T20:51:18Z","messageCount":2,"participants":["Julien Muchembled","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"178140","messageId":"1319223861-10803-1-git-send-email-jm@jmuchemb.eu","threadId":"28738","inReplyTo":null,"subject":"[PATCH] gitweb: fix regression when filtering out forks","fromName":"Julien Muchembled","fromEmail":"jm@jmuchemb.eu","sentAt":"2011-10-21T19:04:21Z","receivedAt":"2011-10-21T19:04:21Z","isPatch":true,"sender":{"key":"jm@jmuchemb.eu","avatar":null},"body":"This fixes a condition in filter_forks_from_projects_list that failed if\nprocess directory was different from project root: in such case, the subroutine\nwas a no-op and forks were not detected.\n\nSigned-off-by: Julien Muchembled <jm@jmuchemb.eu>\n---\n gitweb/gitweb.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 70a576a..206e2a6 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2875,7 +2875,7 @@ sub filter_forks_from_projects_list {\n \t\t$path =~ s/\\.git$//;      # forks of 'repo.git' are in 'repo/' directory\n \t\tnext if ($path =~ m!/$!); # skip non-bare repositories, e.g. 'repo/.git'\n \t\tnext unless ($path);      # skip '.git' repository: tests, git-instaweb\n-\t\tnext unless (-d $path);   # containing directory exists\n+\t\tnext unless (-d \"$projectroot/$path\"); # containing directory exists\n \t\t$pr->{'forks'} = [];      # there can be 0 or more forks of project\n \n \t\t# add to trie\n-- \n1.7.7.731.g3af63.dirty\n"},{"id":"178147","messageId":"201110212251.18810.jnareb@gmail.com","threadId":"28738","inReplyTo":"1319223861-10803-1-git-send-email-jm@jmuchemb.eu","subject":"Re: [PATCH] gitweb: fix regression when filtering out forks","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-10-21T20:51:18Z","receivedAt":"2011-10-21T20:51:18Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Fri, 21 Oct 2011, Julien Muchembled wrote:\n\n> This fixes a condition in filter_forks_from_projects_list that failed if\n> process directory was different from project root: in such case, the subroutine\n> was a no-op and forks were not detected.\n> \n> Signed-off-by: Julien Muchembled <jm@jmuchemb.eu>\n\nThanks.\n\nI am embarrassed that I missed this; in the test I have added $projectroot\n_is_ current directory for script.  Anyway I have tested this in running\nlocal installation on testsuite, and it now works (i.e. hide forks under\n\"+\" character, where it would not before - gitweb shown every project).\n\nTested-by: Jakub Narebski <jnareb@gmail.com>\n\n> ---\n>  gitweb/gitweb.perl |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 70a576a..206e2a6 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -2875,7 +2875,7 @@ sub filter_forks_from_projects_list {\n>  \t\t$path =~ s/\\.git$//;      # forks of 'repo.git' are in 'repo/' directory\n>  \t\tnext if ($path =~ m!/$!); # skip non-bare repositories, e.g. 'repo/.git'\n>  \t\tnext unless ($path);      # skip '.git' repository: tests, git-instaweb\n> -\t\tnext unless (-d $path);   # containing directory exists\n> +\t\tnext unless (-d \"$projectroot/$path\"); # containing directory exists\n>  \t\t$pr->{'forks'} = [];      # there can be 0 or more forks of project\n>  \n>  \t\t# add to trie\n> -- \n\n-- \nJakub Narebski\nPoland\n"}]}