{"thread":{"id":"11778","subject":"[PATCH] Added sub get_owner_file which checks if there's a file with project owner name","startedAt":"2008-01-29T03:36:06Z","lastAt":"2008-02-01T19:10:39Z","messageCount":12,"participants":["Bruno Ribas","Jakub Narebski","Bruno Cesar Ribas","Nagy Balázs","Robin Rosenberg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"66802","messageId":"1201577766-11601-1-git-send-email-ribas@c3sl.ufpr.br","threadId":"11778","inReplyTo":null,"subject":"[PATCH] Added sub get_owner_file which checks if there's a file with project owner name","fromName":"Bruno Ribas","fromEmail":"ribas@c3sl.ufpr.br","sentAt":"2008-01-29T03:36:06Z","receivedAt":"2008-01-29T03:36:06Z","isPatch":true,"sender":{"key":"ribas@c3sl.ufpr.br","avatar":null},"body":"This file ($projectroot/$project/owner) is good to have when we don't want to\nmaintain a project  list AND when we share same SSH account for all projects,\nusing ssh_acl for example.\n\nSigned-off-by: Bruno Ribas <ribas@c3sl.ufpr.br>\n---\n gitweb/gitweb.perl |   14 ++++++++++++++\n 1 files changed, 14 insertions(+), 0 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 6256641..fac5f78 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1754,6 +1754,15 @@ sub git_get_project_list_from_file {\n \t}\n }\n \n+sub get_owner_file {\n+    my $owner_file = shift;\n+\n+\topen my $fd, \"$owner_file\" or return undef;\n+\tmy $owner = <$fd>;\n+\tclose $fd;\n+\treturn to_utf8($owner);\n+}\n+\n sub git_get_project_owner {\n \tmy $project = shift;\n \tmy $owner;\n@@ -1767,6 +1776,11 @@ sub git_get_project_owner {\n \tif (exists $gitweb_project_owner->{$project}) {\n \t\t$owner = $gitweb_project_owner->{$project};\n \t}\n+\n+    if ( -f \"$projectroot/$project/owner\" ) {\n+        $owner = get_owner_file(\"$projectroot/$project/owner\");\n+    }\n+\n \tif (!defined $owner) {\n \t\t$owner = get_file_owner(\"$projectroot/$project\");\n \t}\n-- \n1.5.3.8\n"},{"id":"66833","messageId":"m3lk6898kg.fsf@localhost.localdomain","threadId":"11778","inReplyTo":"1201577766-11601-1-git-send-email-ribas@c3sl.ufpr.br","subject":"Re: [PATCH] Added sub get_owner_file which checks if there's a file with project owner name","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-01-29T11:26:31Z","receivedAt":"2008-01-29T11:26:31Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Bruno Ribas <ribas@c3sl.ufpr.br> writes:\n\n> This file ($projectroot/$project/owner) is good to have when we don't want to\n> maintain a project  list AND when we share same SSH account for all projects,\n> using ssh_acl for example.\n>\n> Signed-off-by: Bruno Ribas <ribas@c3sl.ufpr.br>\n\nThis explanation is a bit too complicated; it explains farther\nreasons, instead of immediate ones: you don't want to maintain project\nlist file, and all repository directories have to have the same owner\n(for example when the same SSH account is shared for all projects,\nusing ssh_acl to control access instead).\n\nBesides with new faster config reader we probably would want to allow\nto use config file to set owner, instead of adding yet another file to\nthe repo area; see commit 0e121a2cd42d28bc4034feedf8a13c5a91f85bd3\n  \"gitweb: Use config file for repository description and URLs\"\nThis would have the advantage that you could use system config\n(/etc/gitconfig) to set fallback owner instead of relying on\nfilesystem.  I'm not sure what should be the preference, though:\ngitweb.owner, then $GIT_DIR/owner, or vice versa?  I guess that\nreading $GIT_DIR/owner should take preference, as it is needed also\nfor projects list page, where ordinary we didn't read individual\nrepositories configuration.\n\nI guess that it is meant to be post 1.5.4, isn't it?\n\n> ---\n>  gitweb/gitweb.perl |   14 ++++++++++++++\n>  1 files changed, 14 insertions(+), 0 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 6256641..fac5f78 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -1754,6 +1754,15 @@ sub git_get_project_list_from_file {\n>  \t}\n>  }\n>  \n> +sub get_owner_file {\n> +    my $owner_file = shift;\n\nHere you use spaces instead of tabs in indent.\n\n> +\n> +\topen my $fd, \"$owner_file\" or return undef;\n\n\topen my $fd, $owner_file or return undef;\n\nwould be simpler.\n\n> +\tmy $owner = <$fd>;\n> +\tclose $fd;\n> +\treturn to_utf8($owner);\n> +}\n\nI wonder if we should just bite the bullet and replace all such by\ngeneric subroutine called e.g. read_singleline_file, or something like\nthat.  Or perhaps not, if we want to read alternatively from config,\nwith different config variable key names and different preferences of\nfile/config priority...\n\n> +\n>  sub git_get_project_owner {\n>  \tmy $project = shift;\n>  \tmy $owner;\n> @@ -1767,6 +1776,11 @@ sub git_get_project_owner {\n>  \tif (exists $gitweb_project_owner->{$project}) {\n>  \t\t$owner = $gitweb_project_owner->{$project};\n>  \t}\n> +\n> +    if ( -f \"$projectroot/$project/owner\" ) {\n> +        $owner = get_owner_file(\"$projectroot/$project/owner\");\n> +    }\n> +\n\nHere you use spaces. I think that you can lose spaces around condition\nin the above 'if'.\n\n>  \tif (!defined $owner) {\n>  \t\t$owner = get_file_owner(\"$projectroot/$project\");\n>  \t}\n> -- \n> 1.5.3.8\n\nI hope that doesn't mean that this patch is based on v1.5.3.8\ngitweb...\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"66836","messageId":"20080129142550.GA25312@c3sl.ufpr.br","threadId":"11778","inReplyTo":"m3lk6898kg.fsf@localhost.localdomain","subject":"Re: [PATCH] Added sub get_owner_file which checks if there's a file with project owner name","fromName":"Bruno Cesar Ribas","fromEmail":"ribas@c3sl.ufpr.br","sentAt":"2008-01-29T14:25:50Z","receivedAt":"2008-01-29T14:25:50Z","isPatch":true,"sender":{"key":"ribas@c3sl.ufpr.br","avatar":null},"body":"On Tue, Jan 29, 2008 at 03:26:31AM -0800, Jakub Narebski wrote:\n> Bruno Ribas <ribas@c3sl.ufpr.br> writes:\n> \n> > This file ($projectroot/$project/owner) is good to have when we don't want to\n> > maintain a project  list AND when we share same SSH account for all projects,\n> > using ssh_acl for example.\n> >\n> > Signed-off-by: Bruno Ribas <ribas@c3sl.ufpr.br>\n> \n> This explanation is a bit too complicated; it explains farther\n> reasons, instead of immediate ones: you don't want to maintain project\n> list file, and all repository directories have to have the same owner\n> (for example when the same SSH account is shared for all projects,\n> using ssh_acl to control access instead).\n\nI'm sorry about this complicated explanation.\n\n> \n> Besides with new faster config reader we probably would want to allow\n> to use config file to set owner, instead of adding yet another file to\n> the repo area; see commit 0e121a2cd42d28bc4034feedf8a13c5a91f85bd3\n>   \"gitweb: Use config file for repository description and URLs\"\n> This would have the advantage that you could use system config\n> (/etc/gitconfig) to set fallback owner instead of relying on\n> filesystem.  I'm not sure what should be the preference, though:\n> gitweb.owner, then $GIT_DIR/owner, or vice versa?  I guess that\n> reading $GIT_DIR/owner should take preference, as it is needed also\n> for projects list page, where ordinary we didn't read individual\n> repositories configuration.\n\nReading $GIT_DIR/owner would be the preference, Maybe it can generate project\nlist page faster when machine have high IO waits (WA).\n\nHaving gitweb.owner is good too, but as you said I don't need to read\nindividual repositories configuration.\n\nHaving another file at the repo area is not a problem (my say). Sometimes\nhaving files appears to be more organized than having everything in one file\n(my say again).\n\nI even made another patch about cloneURL, instead of looking for inside files\nand stuff, i made gitweb.conf a variable that says:\n- If i have a prefix path for HTTP,SSH,GIT[protocol]\nThen if this variable is set gitweb only mounts... like\nHTTPPREFIX=\"http://git.c3sl.ufpr.br/pub/scm\"\nand gitweb sets it to $HTTPREFIX/$project\n\nI made this because I don't want to set each project it's clone URL, so this \nmakes thing easier! What do you think?\n\n\n\n> \n> I guess that it is meant to be post 1.5.4, isn't it?\n> \n> > ---\n> >  gitweb/gitweb.perl |   14 ++++++++++++++\n> >  1 files changed, 14 insertions(+), 0 deletions(-)\n> > \n> > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> > index 6256641..fac5f78 100755\n> > --- a/gitweb/gitweb.perl\n> > +++ b/gitweb/gitweb.perl\n> > @@ -1754,6 +1754,15 @@ sub git_get_project_list_from_file {\n> >  \t}\n> >  }\n> >  \n> > +sub get_owner_file {\n> > +    my $owner_file = shift;\n> \n> Here you use spaces instead of tabs in indent.\n> \n> > +\n> > +\topen my $fd, \"$owner_file\" or return undef;\n> \n> \topen my $fd, $owner_file or return undef;\n> \n> would be simpler.\n> \n> > +\tmy $owner = <$fd>;\n> > +\tclose $fd;\n> > +\treturn to_utf8($owner);\n> > +}\n> \n> I wonder if we should just bite the bullet and replace all such by\n> generic subroutine called e.g. read_singleline_file, or something like\n> that.  Or perhaps not, if we want to read alternatively from config,\n> with different config variable key names and different preferences of\n> file/config priority...\n> \n> > +\n> >  sub git_get_project_owner {\n> >  \tmy $project = shift;\n> >  \tmy $owner;\n> > @@ -1767,6 +1776,11 @@ sub git_get_project_owner {\n> >  \tif (exists $gitweb_project_owner->{$project}) {\n> >  \t\t$owner = $gitweb_project_owner->{$project};\n> >  \t}\n> > +\n> > +    if ( -f \"$projectroot/$project/owner\" ) {\n> > +        $owner = get_owner_file(\"$projectroot/$project/owner\");\n> > +    }\n> > +\n> \n> Here you use spaces. I think that you can lose spaces around condition\n> in the above 'if'.\n> \n> >  \tif (!defined $owner) {\n> >  \t\t$owner = get_file_owner(\"$projectroot/$project\");\n> >  \t}\n> > -- \n> > 1.5.3.8\n> \n> I hope that doesn't mean that this patch is based on v1.5.3.8\n> gitweb...\n> \n> -- \n> Jakub Narebski\n> Poland\n> ShadeHawk on #git\n\n-- \nBruno Ribas - ribas@c3sl.ufpr.br\nhttp://web.inf.ufpr.br/ribas\nC3SL: http://www.c3sl.ufpr.br \n"},{"id":"66838","messageId":"200801291628.21026.jnareb@gmail.com","threadId":"11778","inReplyTo":"20080129142550.GA25312@c3sl.ufpr.br","subject":"Re: [PATCH] Added sub get_owner_file which checks if there's a file with project owner name","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-01-29T15:28:19Z","receivedAt":"2008-01-29T15:28:19Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Tue, 29 Jan 2008, Bruno Cesar Ribas wrote:\n> On Tue, Jan 29, 2008 at 03:26:31AM -0800, Jakub Narebski wrote:\n>> Bruno Ribas <ribas@c3sl.ufpr.br> writes:\n>> \n>>> This file ($projectroot/$project/owner) is good to have when we don't want to\n>>> maintain a project  list AND when we share same SSH account for all projects,\n>>> using ssh_acl for example.\n>>>\n>>> Signed-off-by: Bruno Ribas <ribas@c3sl.ufpr.br>\n>> \n>> This explanation is a bit too complicated; it explains farther\n>> reasons, instead of immediate ones: you don't want to maintain project\n>> list file, and all repository directories have to have the same owner\n>> (for example when the same SSH account is shared for all projects,\n>> using ssh_acl to control access instead).\n> \n> I'm sorry about this complicated explanation.\n\nIt is not [that] bad description, but it could be better. Also, 80 columns\nword wrap is good, but 72-76 would be even better :-)\n\n>> Besides with new faster config reader we probably would want to allow\n>> to use config file to set owner, instead of adding yet another file to\n>> the repo area; see commit 0e121a2cd42d28bc4034feedf8a13c5a91f85bd3\n>>   \"gitweb: Use config file for repository description and URLs\"\n>> This would have the advantage that you could use system config\n>> (/etc/gitconfig) to set fallback owner instead of relying on\n>> filesystem.  I'm not sure what should be the preference, though:\n>> gitweb.owner, then $GIT_DIR/owner, or vice versa?  I guess that\n>> reading $GIT_DIR/owner should take preference, as it is needed also\n>> for projects list page, where ordinary we didn't read individual\n>> repositories configuration.\n> \n> Reading $GIT_DIR/owner would be the preference, Maybe it can generate project\n> list page faster when machine have high IO waits (WA).\n\nYes, I also think so. Two file reads (description + owner) should be\nstill faster than one running git-config, and parsing its output.\n\nBut I think if IO matters it is better to generate projects list; you\ncan even use gitweb for that, or you can simply add a line with URL\nescaped project name (project path) relative to $projectroot, separated\nby space from the URL escaped (URI-encoded) project owner.  See also\n\"Gitweb repositories\" section in gitweb/INSTALL.  Adding projects is\nrare event.\n \n> Having gitweb.owner is good too, but as you said I don't need to read\n> individual repositories configuration.\n> \n> Having another file at the repo area is not a problem (my say). Sometimes\n> having files appears to be more organized than having everything in one file\n> (my say again).\n\nBy the way, I have forgot to ask you to add description of new 'owner'\nfile to \"Per-repository gitweb configuration\" section in gitweb/README\n\n> I even made another patch about cloneURL, instead of looking for inside files\n> and stuff, i made gitweb.conf a variable that says:\n> - If i have a prefix path for HTTP,SSH,GIT[protocol]\n> Then if this variable is set gitweb only mounts... like\n> HTTPPREFIX=\"http://git.c3sl.ufpr.br/pub/scm\"\n> and gitweb sets it to $HTTPREFIX/$project\n> \n> I made this because I don't want to set each project it's clone URL, so this \n> makes thing easier! What do you think?\n\nI hope that this hack predates latest improvements to gitweb/README,\nas you have just reimplemented GITWEB_BASE_URL build configuration\nvariable (only single base URL), and @git_base_url_list, which you\ncan set in gitweb config file (by default gitweb_config.perl).\n \nIf you have read current code carefully, you should notice that\ncurrently gitweb generates URLs for repository in the following way:\n\n 1. Per repository configuration:\n    a. $projectroot/$project/cloneurl (one line perl URL)\n    b. multivalued gitweb.url configuration variable in project config\n 2. Global gitweb configuration\n    a. $prefix/$project for each $prefix element in @git_base_url_list,\n       which is set in gitweb_config.perl\n 3. Build time defaults\n    a. Single value in @git_base_url_list set using GITWEB_BASE_URL\n       build configuration variable\n 4. Otherwise it is not set (it is empty).\n\n-- \nJakub Narebski\nPoland\n"},{"id":"66841","messageId":"20080129172216.GA17875@c3sl.ufpr.br","threadId":"11778","inReplyTo":"200801291628.21026.jnareb@gmail.com","subject":"Re: [PATCH] Added sub get_owner_file which checks if there's a file with project owner name","fromName":"Bruno Cesar Ribas","fromEmail":"ribas@c3sl.ufpr.br","sentAt":"2008-01-29T17:22:16Z","receivedAt":"2008-01-29T17:22:16Z","isPatch":true,"sender":{"key":"ribas@c3sl.ufpr.br","avatar":null},"body":"On Tue, Jan 29, 2008 at 04:28:19PM +0100, Jakub Narebski wrote:\n> On Tue, 29 Jan 2008, Bruno Cesar Ribas wrote:\n> > On Tue, Jan 29, 2008 at 03:26:31AM -0800, Jakub Narebski wrote:\n> >> Bruno Ribas <ribas@c3sl.ufpr.br> writes:\n> >> \n> >>> This file ($projectroot/$project/owner) is good to have when we don't want to\n> >>> maintain a project  list AND when we share same SSH account for all projects,\n> >>> using ssh_acl for example.\n> >>>\n> >>> Signed-off-by: Bruno Ribas <ribas@c3sl.ufpr.br>\n> >> \n> >> This explanation is a bit too complicated; it explains farther\n> >> reasons, instead of immediate ones: you don't want to maintain project\n> >> list file, and all repository directories have to have the same owner\n> >> (for example when the same SSH account is shared for all projects,\n> >> using ssh_acl to control access instead).\n> > \n> > I'm sorry about this complicated explanation.\n> \n> It is not [that] bad description, but it could be better. Also, 80 columns\n> word wrap is good, but 72-76 would be even better :-)\n> \n> >> Besides with new faster config reader we probably would want to allow\n> >> to use config file to set owner, instead of adding yet another file to\n> >> the repo area; see commit 0e121a2cd42d28bc4034feedf8a13c5a91f85bd3\n> >>   \"gitweb: Use config file for repository description and URLs\"\n> >> This would have the advantage that you could use system config\n> >> (/etc/gitconfig) to set fallback owner instead of relying on\n> >> filesystem.  I'm not sure what should be the preference, though:\n> >> gitweb.owner, then $GIT_DIR/owner, or vice versa?  I guess that\n> >> reading $GIT_DIR/owner should take preference, as it is needed also\n> >> for projects list page, where ordinary we didn't read individual\n> >> repositories configuration.\n> > \n> > Reading $GIT_DIR/owner would be the preference, Maybe it can generate project\n> > list page faster when machine have high IO waits (WA).\n> \n> Yes, I also think so. Two file reads (description + owner) should be\n> still faster than one running git-config, and parsing its output.\n> \n> But I think if IO matters it is better to generate projects list; you\n> can even use gitweb for that, or you can simply add a line with URL\n> escaped project name (project path) relative to $projectroot, separated\n> by space from the URL escaped (URI-encoded) project owner.  See also\n> \"Gitweb repositories\" section in gitweb/INSTALL.  Adding projects is\n> rare event.\n>  \n> > Having gitweb.owner is good too, but as you said I don't need to read\n> > individual repositories configuration.\n> > \n> > Having another file at the repo area is not a problem (my say). Sometimes\n> > having files appears to be more organized than having everything in one file\n> > (my say again).\n> \n> By the way, I have forgot to ask you to add description of new 'owner'\n> file to \"Per-repository gitweb configuration\" section in gitweb/README\n\nI'm on the way to add description of 'owner' file, before commint should I\nimplement gitweb.owner too? then that README comes with two way of seting\nowner. Or let only owner file for now?\n\n> \n> > I even made another patch about cloneURL, instead of looking for inside files\n> > and stuff, i made gitweb.conf a variable that says:\n> > - If i have a prefix path for HTTP,SSH,GIT[protocol]\n> > Then if this variable is set gitweb only mounts... like\n> > HTTPPREFIX=\"http://git.c3sl.ufpr.br/pub/scm\"\n> > and gitweb sets it to $HTTPREFIX/$project\n> > \n> > I made this because I don't want to set each project it's clone URL, so this \n> > makes thing easier! What do you think?\n> \n> I hope that this hack predates latest improvements to gitweb/README,\n> as you have just reimplemented GITWEB_BASE_URL build configuration\n> variable (only single base URL), and @git_base_url_list, which you\n> can set in gitweb config file (by default gitweb_config.perl).\n\nOk, I'll check recent version of gitweb and i'll send this commit if relevant\n=)\n\n>  \n> If you have read current code carefully, you should notice that\n> currently gitweb generates URLs for repository in the following way:\n> \n>  1. Per repository configuration:\n>     a. $projectroot/$project/cloneurl (one line perl URL)\n>     b. multivalued gitweb.url configuration variable in project config\n>  2. Global gitweb configuration\n>     a. $prefix/$project for each $prefix element in @git_base_url_list,\n>        which is set in gitweb_config.perl\n>  3. Build time defaults\n>     a. Single value in @git_base_url_list set using GITWEB_BASE_URL\n>        build configuration variable\n>  4. Otherwise it is not set (it is empty).\n> \n> -- \n> Jakub Narebski\n> Poland\n\n-- \nBruno Ribas - ribas@c3sl.ufpr.br\nhttp://web.inf.ufpr.br/ribas\nC3SL: http://www.c3sl.ufpr.br \n"},{"id":"66844","messageId":"200801291927.01461.jnareb@gmail.com","threadId":"11778","inReplyTo":"20080129172216.GA17875@c3sl.ufpr.br","subject":"Re: [PATCH] Added sub get_owner_file which checks if there's a file with project owner name","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-01-29T18:27:00Z","receivedAt":"2008-01-29T18:27:00Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Tue, 29 Jan 2008, Bruno Cesar Ribas wrote:\n> On Tue, Jan 29, 2008 at 04:28:19PM +0100, Jakub Narebski wrote:\n\n[cut]\n\nBy the way, can I ask you to remove the parts of quoted email you\ndo not reply to? It means leave only those parts you answer. It makes\nfollowing the flow of discussion easier. TIA.\n \n>> By the way, I have forgot to ask you to add description of new 'owner'\n>> file to \"Per-repository gitweb configuration\" section in gitweb/README\n> \n> I'm on the way to add description of 'owner' file, before commint should I\n> implement gitweb.owner too? then that README comes with two way of seting\n> owner. Or let only owner file for now?\n\nIf you add also implementation of gitweb.owner support (following\nfor example git_get_project_description), then mention it in\ndescription of 'owner' file in gitweb/README. If you don't, just\nexplain about 'owner'.\n\nRelevant fragment of gitweb/README you can follow:\n\n * description (or gitweb.description)\n   Short (shortened by default to 25 characters in the projects list page)\n   single line description of a project (of a repository). Plain text file;\n   HTML will be escaped. By default set to\n     Unnamed repository; edit this file to name it for gitweb.\n   from the template during creating repository. You can use\n   gitweb.description repo configuration variable, but the file takes\n   precendence.\n\nDescribe format, fallback to gitweb.owner, then fallback to directory\nowner (filesystem).\n\n>>> I even made another patch about cloneURL, instead of looking for inside files\n>>> and stuff, i made gitweb.conf a variable that says:\n>>> - If i have a prefix path for HTTP,SSH,GIT[protocol]\n>>> Then if this variable is set gitweb only mounts... like\n>>> HTTPPREFIX=\"http://git.c3sl.ufpr.br/pub/scm\"\n>>> and gitweb sets it to $HTTPREFIX/$project\n>>> \n>>> I made this because I don't want to set each project it's clone URL, so this \n>>> makes thing easier! What do you think?\n>> \n>> I hope that this hack predates latest improvements to gitweb/README,\n>> as you have just reimplemented GITWEB_BASE_URL build configuration\n>> variable (only single base URL), and @git_base_url_list, which you\n>> can set in gitweb config file (by default gitweb_config.perl).\n> \n> Ok, I'll check recent version of gitweb and i'll send this commit\n> if relevant =)\n\nI think the change described above doesn't add any new functionality.\n\n[cut]\n-- \nJakub Narebski\nPoland\n"},{"id":"66852","messageId":"479F925A.5020401@iksz.hu","threadId":"11778","inReplyTo":"200801291628.21026.jnareb@gmail.com","subject":"Re: [PATCH] Added sub get_owner_file which checks if there's a file with project owner name","fromName":"Nagy Balázs","fromEmail":"js@iksz.hu","sentAt":"2008-01-29T20:53:46Z","receivedAt":"2008-01-29T20:53:46Z","isPatch":true,"sender":{"key":"js@iksz.hu","avatar":"https://gravatar.com/avatar/8e618db1f4a022c12a6f0cd5a9632663f61afd781108fdf32f2433589b1901b8?d=mp&s=160"},"body":"Hi,\n\nJakub Narebski wrote:\n> But I think if IO matters it is better to generate projects list; you\n> can even use gitweb for that, or you can simply add a line with URL\n> escaped project name (project path) relative to $projectroot, separated\n> by space from the URL escaped (URI-encoded) project owner.  See also\n> \"Gitweb repositories\" section in gitweb/INSTALL.  Adding projects is\n> rare event.\n>   \nAre you talking about I/O of an all-in CGI script?  We can tune the \nperformance of this script, but changing the GIT_DIR structure just \nbecause of a simple script is a bit overkill to me.\n\nWhat if this script creates the $projects_list file, for example when \nthe $projectroot's mtime changes?  We can even hold mtime info for every \nproject's config file.\n\nRegards:\n-- \nBalazs Nagy\n"},{"id":"66857","messageId":"200801292236.19630.jnareb@gmail.com","threadId":"11778","inReplyTo":"479F925A.5020401@iksz.hu","subject":"Re: [PATCH] Added sub get_owner_file which checks if there's a file with project owner name","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-01-29T21:36:18Z","receivedAt":"2008-01-29T21:36:18Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Nagy Balázs wrote:\n> Jakub Narebski wrote:\n\n>> But I think if IO matters it is better to generate projects list; you\n>> can even use gitweb for that, or you can simply add a line with URL\n>> escaped project name (project path) relative to $projectroot, separated\n>> by space from the URL escaped (URI-encoded) project owner.  See also\n>> \"Gitweb repositories\" section in gitweb/INSTALL.  Adding projects is\n>> rare event.\n>>   \n> Are you talking about I/O of an all-in CGI script?  \n\nI am talking there between I/O difference between situation\n(configuration) when $projects_list is a directory (default),\nor is a file. If $projects_list is a directory, gitweb scans\ndirectory structure to find git repositories, which for large\nnumber of repositories might take time, even with filesystem\ncache, and with depth of searching bound by $project_maxdepth.\nAdd to that finding symbolic name of the owner of repository\ndirectory, or (with the patch) reading a file per repo with repo\nowner.\n\nReading and pasing single text file avoids this; it is faster.\nBut for small repos it is easier to scan directory, and difference\nin performance is not much.\n\n> We can tune the  \n> performance of this script, but changing the GIT_DIR structure just \n> because of a simple script is a bit overkill to me.\n> \n> What if this script creates the $projects_list file, for example when \n> the $projectroot's mtime changes?  We can even hold mtime info for every \n> project's config file.\n\nI don't understand what you wanted to say here. $projects_list file\nlists only project path (project name) and project owner.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"66916","messageId":"47A09ED2.6070407@iksz.hu","threadId":"11778","inReplyTo":"200801292236.19630.jnareb@gmail.com","subject":"Re: [PATCH] Added sub get_owner_file which checks if there's a file with project owner name","fromName":"Nagy Balázs","fromEmail":"js@iksz.hu","sentAt":"2008-01-30T15:59:14Z","receivedAt":"2008-01-30T15:59:14Z","isPatch":true,"sender":{"key":"js@iksz.hu","avatar":"https://gravatar.com/avatar/8e618db1f4a022c12a6f0cd5a9632663f61afd781108fdf32f2433589b1901b8?d=mp&s=160"},"body":"Jakub Narebski wrote:\n> Nagy Balázs wrote:\n>   \n>> Are you talking about I/O of an all-in CGI script?  \n>>     \n>\n> I am talking there between I/O difference between situation\n> (configuration) when $projects_list is a directory (default),\n> or is a file. If $projects_list is a directory, gitweb scans\n> directory structure to find git repositories, which for large\n> number of repositories might take time, even with filesystem\n> cache, and with depth of searching bound by $project_maxdepth.\n> Add to that finding symbolic name of the owner of repository\n> directory, or (with the patch) reading a file per repo with repo\n> owner.\n>   \nWe have two configurable options here: $projectroot and $projects_list.  \nIf $projects_list is a directory, we'll end up using a directory to get \nproject list info, and using another one to actually handle the \nprojects.  In small repo area it's safe to have $projects_list empty.  \nThis is why I reference $projects_list as a file.\n\nIf $projects_list is a file, we'll rely on a file which was generated \nsome time ago and can't reflect the latest changes of $projectroot (but \nsee below).\n>> We can tune the  \n>> performance of this script, but changing the GIT_DIR structure just \n>> because of a simple script is a bit overkill to me.\n>>\n>> What if this script creates the $projects_list file, for example when \n>> the $projectroot's mtime changes?  We can even hold mtime info for every \n>> project's config file.\n>>     \n>\n> I don't understand what you wanted to say here. $projects_list file\n> lists only project path (project name) and project owner.\n>   \nI mean it would be better to add this kind of metadata like description \nand owner's shoesize to config instead of a raw file.  I understand row \nfiles are easier to read but reading a single cache file adn doing some \nstat()s are much easier.  I can think of $project_lists as a cache file \nname, which can be maintained by gitweb.cgi, and these mtime values \ncould be saved to $project_list to verify entries' validity.\n\nAll we have to do is to maintain $project_list to be up to date.  The \nbest would be to have a separate projectlist maintainer script which \nhandles two scenarios:\n\n1| repo addition/deletion\n2| repo config changes\n\nI don't have solution for the first scenario which would be a speed \nimprovement in gitweb.cgi, this is why I suggest to put $project_list \nupdater to a separate script.  The second scenario could be handled by \ngitweb.cgi though, but it would be mere code duplication.\n\nRegards:\n-- \nBalazs Nagy\n"},{"id":"67029","messageId":"200802011418.59862.jnareb@gmail.com","threadId":"11778","inReplyTo":"47A09ED2.6070407@iksz.hu","subject":"Re: [PATCH] Added sub get_owner_file which checks if there's a file with project owner name","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-02-01T13:18:57Z","receivedAt":"2008-02-01T13:18:57Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Wed, 30 Jan 2008, Nagy Balázs wrote:\n> Jakub Narebski wrote:\n>> Nagy Balázs wrote:\n>>   \n>>> Are you talking about I/O of an all-in CGI script?  \n>>>     \n>>\n>> I am talking there between I/O difference between situation\n>> (configuration) when $projects_list is a directory (default),\n>> or is a file. If $projects_list is a directory, gitweb scans\n>> directory structure to find git repositories, which for large\n>> number of repositories might take time, even with filesystem\n>> cache, and with depth of searching bound by $project_maxdepth.\n>> Add to that finding symbolic name of the owner of repository\n>> directory, or (with the patch) reading a file per repo with repo\n>> owner.\n>>   \n> We have two configurable options here: $projectroot and $projects_list.  \n> If $projects_list is a directory, we'll end up using a directory to get \n> project list info, and using another one to actually handle the \n> projects.  In small repo area it's safe to have $projects_list empty.  \n> This is why I reference $projects_list as a file.\n\nBesides the fact that using $projects_list file can speed up generating\n'projects_list' page, it can also be used to either just restrict\nvisibility of certain projects (some projects will be not visible\nin the projects list page, but will be still available when provided\nwith project name), or restrict/refuse access (if GITWEB_STRICT_EXPORT\naka $strict_export is true, only files shown in projects list page\nwould be available to browse; it can be further restricted using\n\"export-ok\" mechanism).\n\nYou can use $projects_list pointing to directory with symlinks to\nselected repositories residing under $projectroot for that. So it\nis not only $projects_list a file, or $projects_list undef (and fallback\nto $projectroot and $projects_list as directory). $projects_list as\na directory different from $projectroot has sense in some cases too.\n\n> If $projects_list is a file, we'll rely on a file which was generated \n> some time ago and can't reflect the latest changes of $projectroot (but \n> see below).\n\nCreating projects is a rare event. You cannot do this remotely with git\ntools only. So I think it would be not very difficult and not very\nsuprising to use some script to add new project, script which would\nensure proper project configuration, perhaps setup proper SSH keys, and\nregenerate $projects_list file if it is what gitweb is using.\n\n[...]\n>>> What if this script creates the $projects_list file, for example when \n>>> the $projectroot's mtime changes?  We can even hold mtime info for every \n>>> project's config file.\n>>>     \n>>\n>> I don't understand what you wanted to say here. $projects_list file\n>> lists only project path (project name) and project owner.\n>>   \n> I mean it would be better to add this kind of metadata like description \n> and owner's shoesize to config instead of a raw file.  I understand row \n> files are easier to read but reading a single cache file adn doing some \n> stat()s are much easier.  I can think of $project_lists as a cache file \n> name, which can be maintained by gitweb.cgi, and these mtime values \n> could be saved to $project_list to verify entries' validity.\n\nErr... I think that having some kind of cache for 'projects_list' page\nis a separate issue than using $projects_list file for a list\n(and owners) of projects.\n\nBesides I'd rather opt for the other side of spectrum: instead of\ngitweb checking for freshness of a 'cache', regenerate the cache\nor just delete it when you know that contents change: from a script\nadding a repository, from a script renaming or changing description\nor an owner of repository, from a script deleting repository or\nremoving it from a list, from a post-update / post-receive hook if\nthe cached info includes last change, etc.\n \n> All we have to do is to maintain $project_list to be up to date.  The \n> best would be to have a separate projectlist maintainer script which \n> handles two scenarios:\n> \n> 1| repo addition/deletion\n> 2| repo config changes\n> \n> I don't have solution for the first scenario which would be a speed \n> improvement in gitweb.cgi, this is why I suggest to put $project_list \n> updater to a separate script.  The second scenario could be handled by \n> gitweb.cgi though, but it would be mere code duplication.\n\nI was thinking about gitconfig file, but with limited syntax to be\neasily parseable from Perl, like git-cvsserver does, put in $projectroot,\ne.g. $projectroot/gitconfig, which would contain parts of repo config\nrelevant to 'projects_list' page.  It would use gitweb.<repo>.<key>\nsyntax, where <key> is one of owner, description, and perhaps url.\n\nOr we could put it in gitweb_config.perl file, in the form of parsed\nconfig hash... well, it should be fairly easy to combine those two\napproaches with current code: use %config hash, and fill it from\n$projectroot/gitconfig if not set.\n\nOf course you would have the usual danger when dealing with data\nduplication, naley that they would get out of sync. And usual danger\ndealing with caches, that the validating needed and other system\ncaches would make it perform *worse* than without cache.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"67035","messageId":"47A3449E.6070102@iksz.hu","threadId":"11778","inReplyTo":"200802011418.59862.jnareb@gmail.com","subject":"Re: [PATCH] Added sub get_owner_file which checks if there's a file with project owner name","fromName":"Nagy Balázs","fromEmail":"js@iksz.hu","sentAt":"2008-02-01T16:11:10Z","receivedAt":"2008-02-01T16:11:10Z","isPatch":true,"sender":{"key":"js@iksz.hu","avatar":"https://gravatar.com/avatar/8e618db1f4a022c12a6f0cd5a9632663f61afd781108fdf32f2433589b1901b8?d=mp&s=160"},"body":"Jakob Narebski wrote:\n> Besides I'd rather opt for the other side of spectrum: instead of\n> gitweb checking for freshness of a 'cache', regenerate the cache\n> or just delete it when you know that contents change: from a script\n> adding a repository, from a script renaming or changing description\n> or an owner of repository, from a script deleting repository or\n> removing it from a list, from a post-update / post-receive hook if\n> the cached info includes last change, etc.\n>   \n[...]\n\n> I was thinking about gitconfig file, but with limited syntax to be\n> easily parseable from Perl, like git-cvsserver does, put in $projectroot,\n> e.g. $projectroot/gitconfig, which would contain parts of repo config\n> relevant to 'projects_list' page.  It would use gitweb.<repo>.<key>\n> syntax, where <key> is one of owner, description, and perhaps url.\n>\n> Or we could put it in gitweb_config.perl file, in the form of parsed\n> config hash... well, it should be fairly easy to combine those two\n> approaches with current code: use %config hash, and fill it from\n> $projectroot/gitconfig if not set.\n>\n> Of course you would have the usual danger when dealing with data\n> duplication, naley that they would get out of sync. And usual danger\n> dealing with caches, that the validating needed and other system\n> caches would make it perform *worse* than without cache.\nWell, I came from ClearCase world, were registry service holds all \nvob/view (repo) stuff.  What if we implement more or less the same \nhere?  I mean if you have a lot of public git repos, or at least common \nfor a couple of people, we could store all the fundamental data (local \nstorage path, share URL) of a group of repos in a single database.  We \ncould call them depots.  Moreover, we could use this as the source of \ngit clone, God forbid, even remotely (some kind of git config \ndepot.url=https://user:pass@git.example.org/depot.cgi/depotname).  I \ncould continue but I'm afraid I'll run out of oxygen :)\n\nI'm thinking of something similar:\n\n$ git depot # not the actual usage info, but to show all the parameters\nUsage: git depot create [-d | --description=<descr>] <depot> <path>\n       git depot remove [-f | --force] <depot>\n       git depot modify [-d | --description=<descr> ]\n         [-p | --path=<base path>] [-n | --name=<depot>] <depot>\n       git depot list\n       git depot add [-a | --access=public|private] [-o | --owner=<owner>]\n         <depot>[:<name>] <path>\n       git depot update [-a | --access=public|private]\n         [-o | --owner=<owner>] [-p | --path=<path>] <depot>:<name>\n       git depot delete <depot>:<name>\n       git depot show [-a | --all] [-l | --long] <depot>\n$ git depot list\npublic /pub/scm \"Public repository\"\n$ git depot show public\npublic:git /pub/scm/git.git (public, owner: \"Junio C Hamano \\\n<gitster@pobox.com>\", description: \"The core git plumbing\")\npublic:linux/kernel/torvalds/linux-2.6 \\\n/pub/scm/linux/kernel/torvalds/linux-2.6.git (owner: \\\n\"Linus Torvalds <torvalds@linux-foundation.org>, description: \\\n\"Linus' Kernel Tree\")\n$ git depot show --long public:git\nRepository: public:git\n  Path: /pub/scm/git.git\n  Clone URL: git://git.kernel.org/pub/scm/git.git\n  Clone URL: http://www.kernel.org/pub/scm/git/git.git\n  Access: public\n  Owner: Junio C Hamano <gitster@pobox.com>\n  Description: The core git plumbing\n--\n# Access: private means only git depot show -a shows it\n$ mkdir ~/git; cd ~/git\n$ git clone public:git\n...\n$ git clone . public:git/mygit\n...\n\nI'd add some kind of cloneURL setter too, but the basic idea is this.\n\nRegards:\n-- \nBalazs Nagy\n"},{"id":"67040","messageId":"200802012010.40739.robin.rosenberg.lists@dewire.com","threadId":"11778","inReplyTo":"47A3449E.6070102@iksz.hu","subject":"Re: [PATCH] Added sub get_owner_file which checks if there's a file with project owner name","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2008-02-01T19:10:39Z","receivedAt":"2008-02-01T19:10:39Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"fredagen den 1 februari 2008 skrev Nagy Balázs:\n> Well, I came from ClearCase world, were registry service holds all \n> vob/view (repo) stuff.  What if we implement more or less the same \n> here?  I mean if you have a lot of public git repos, or at least common \n> for a couple of people, we could store all the fundamental data (local \n> storage path, share URL) of a group of repos in a single database.  We \n> could call them depots.  Moreover, we could use this as the source of \n> git clone, God forbid, even remotely (some kind of git config \n> depot.url=https://user:pass@git.example.org/depot.cgi/depotname).  I \n> could continue but I'm afraid I'll run out of oxygen :)\n\nI'll fill in: LDAP.\n\n-- robin\n"}]}