Made final adjustments and hope it is OK now.
threads / discuss / 11970
git.owner, hope everything is fine
Subject: git.owner, hope everything is fine
[PATCH] gitweb: Use the config file to set repository owner's name.
Now gitweb checks if gitweb.owner exists before trying to get filesystem's owner.
Allow to use configuration variable gitweb.owner set the repository owner, it checks the gitweb.owner, if not set it uses filesystem directory's owner.
Useful when we don't want to maintain project list file, and all repository directories have to have the same owner (for example when the same SSH account is shared for all projects, using ssh_acl to control access instead).
Signed-off-by: Bruno Ribas <ribas@c3sl.ufpr.br> --- gitweb/gitweb.perl | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 8ef2735..c8fe22a 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1759,6 +1759,7 @@ sub git_get_project_owner { my $owner; return undef unless $project; + $git_dir = "$projectroot/$project"; if (!defined $gitweb_project_owner) { git_get_project_list_from_file(); @@ -1767,8 +1768,11 @@ sub git_get_project_owner { if (exists $gitweb_project_owner->{$project}) { $owner = $gitweb_project_owner->{$project}; } + if (!defined $owner){ + $owner = git_get_project_config('owner'); + } if (!defined $owner) { - $owner = get_file_owner("$projectroot/$project"); + $owner = get_file_owner("$git_dir"); } return $owner;
-- 1.5.4.24.gce08d
[PATCH] gitweb: Update gitweb/README to include the new per-repository gitweb.owner
Signed-off-by: Bruno Ribas <ribas@c3sl.ufpr.br> --- gitweb/README | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/gitweb/README b/gitweb/README index 4c8bedf..2163071 100644 --- a/gitweb/README +++ b/gitweb/README @@ -233,6 +233,10 @@ You can use the following files in repository: Displayed in the project summary page. You can use multiple-valued gitweb.url repository configuration variable for that, but the file takes precendence. + * gitweb.owner + You can use the gitweb.owner repository configuration variable to set + repository's owner. It is displayed in the project list and summary + page. If it's not set, filesystem directory's owner is used. * various gitweb.* config variables (in config) Read description of %feature hash for detailed list, and some descriptions.
-- 1.5.4.24.gce08d
Re: [PATCH] gitweb: Use the config file to set repository owner's name.
Was it forgotten ? 8^)
On Fri, Feb 08, 2008 at 02:38:03PM -0200, Bruno Ribas wrote:
Show 43 quoted lines
> Now gitweb checks if gitweb.owner exists before trying to get filesystem's
> owner.
>
> Allow to use configuration variable gitweb.owner set the repository owner,
> it checks the gitweb.owner, if not set it uses filesystem directory's owner.
>
> Useful when we don't want to maintain project list file, and all
> repository directories have to have the same owner (for example when the
> same SSH account is shared for all projects, using ssh_acl to control
> access instead).
>
> Signed-off-by: Bruno Ribas <ribas@c3sl.ufpr.br>
> ---
> gitweb/gitweb.perl | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 8ef2735..c8fe22a 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -1759,6 +1759,7 @@ sub git_get_project_owner {
> my $owner;
>
> return undef unless $project;
> + $git_dir = "$projectroot/$project";
>
> if (!defined $gitweb_project_owner) {
> git_get_project_list_from_file();
> @@ -1767,8 +1768,11 @@ sub git_get_project_owner {
> if (exists $gitweb_project_owner->{$project}) {
> $owner = $gitweb_project_owner->{$project};
> }
> + if (!defined $owner){
> + $owner = git_get_project_config('owner');
> + }
> if (!defined $owner) {
> - $owner = get_file_owner("$projectroot/$project");
> + $owner = get_file_owner("$git_dir");
> }
>
> return $owner;
> --
> 1.5.4.24.gce08d-- Bruno Ribas - ribas@c3sl.ufpr.br http://web.inf.ufpr.br/ribas C3SL: http://www.c3sl.ufpr.br
Re: [PATCH] gitweb: Use the config file to set repository owner's name.
Bruno Cesar Ribas <ribas@c3sl.ufpr.br> writes:
> Was it forgotten ? 8^)
No, I have it on one topic, and I personally do not see an issue with it, but I haven't merged it to 'pu' nor 'next' yet. I thought Jakub wanted to give Pasky the first refusal right, so I've been waiting for a few days.