{"thread":{"id":"17648","subject":"[PATCHv3 1/3 (resend)] gitweb: Modularized git_get_project_description to be more generic","startedAt":"2008-12-03T23:24:12Z","lastAt":"2009-02-08T12:34:42Z","messageCount":3,"participants":["Sebastien Cevey","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"103722","messageId":"87zlgxp595.wl%seb@cine7.net","threadId":"17648","inReplyTo":null,"subject":"[PATCHv3 1/3 (resend)] gitweb: Modularized git_get_project_description to be more generic","fromName":"Sebastien Cevey","fromEmail":"seb@cine7.net","sentAt":"2008-12-03T23:24:12Z","receivedAt":"2008-12-03T23:24:12Z","isPatch":false,"sender":{"key":"seb@cine7.net","avatar":"https://avatars.githubusercontent.com/u/36964?v=4"},"body":"Introduce a git_get_file_or_project_config utility function to\nretrieve a repository variable either from a plain text file in the\n$GIT_DIR or else from 'gitweb.$variable' in the repository config\n(e.g. 'description').\n\nSigned-off-by: Sebastien Cevey <seb@cine7.net>\n---\n\nSending this patch again. It has been rebased onto 621f1b so it should\napply cleanly on the current git master branch.\n\n gitweb/gitweb.perl |   24 ++++++++++++++++--------\n 1 files changed, 16 insertions(+), 8 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex f27dbb6..e2550d5 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2024,18 +2024,26 @@ sub git_get_path_by_hash {\n ## ......................................................................\n ## git utility functions, directly accessing git repository\n \n-sub git_get_project_description {\n-\tmy $path = shift;\n+# get the value of a config variable either from a file with the same\n+# name in the repository, or the gitweb.$name value in the repository\n+# config file.\n+sub git_get_file_or_project_config {\n+\tmy ($name, $path) = @_;\n \n \t$git_dir = \"$projectroot/$path\";\n-\topen my $fd, \"$git_dir/description\"\n-\t\tor return git_get_project_config('description');\n-\tmy $descr = <$fd>;\n+\topen my $fd, \"$git_dir/$name\"\n+\t\tor return git_get_project_config($name);\n+\tmy $conf = <$fd>;\n \tclose $fd;\n-\tif (defined $descr) {\n-\t\tchomp $descr;\n+\tif (defined $conf) {\n+\t\tchomp $conf;\n \t}\n-\treturn $descr;\n+\treturn $conf;\n+}\n+\n+sub git_get_project_description {\n+\tmy $path = shift;\n+\treturn git_get_file_or_project_config('description', $path);\n }\n \n sub git_get_project_ctags {\n-- \n1.5.6.5\n"},{"id":"103728","messageId":"200902081210.49328.jnareb@gmail.com","threadId":"17648","inReplyTo":"87zlgxp595.wl%seb@cine7.net","subject":"Re: [PATCHv3 1/3 (resend)] gitweb: Modularized git_get_project_description to be more generic","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-02-08T11:10:48Z","receivedAt":"2009-02-08T11:10:48Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Sebastien Cevey wrote:\n\n[...]\n> Sending this patch again. It has been rebased onto 621f1b so it should\n> apply cleanly on the current git master branch.\n\nThanks a lot.\n\nDue to changes to gitweb, while first patch in (earlier version of) \nseries applies cleanly, second patch didn't, and git could not find\nbase to fall back to 3-way merge (because second patch is based on\nstate after first patch, and situation after first patch changed).\nIt is much easier to rebase series if youhave them as commits, and\nnot as series of emails.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"103738","messageId":"200902081334.42780.jnareb@gmail.com","threadId":"17648","inReplyTo":"87tz75p3ej.wl%seb@cine7.net","subject":"Re: [PATCHv3 1/3 (resend)] gitweb: Modularized git_get_project_description to be more generic","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-02-08T12:34:42Z","receivedAt":"2009-02-08T12:34:42Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Dnia niedziela 8. lutego 2009 12:35, Sébastien Cevey napisał:\n> At Sun, 8 Feb 2009 12:10:48 +0100, Jakub Narebski wrote:\n> \n> > Due to changes to gitweb, while first patch in (earlier version of) \n> > series applies cleanly, second patch didn't, and git could not find\n> > base to fall back to 3-way merge (because second patch is based on\n> > state after first patch, and situation after first patch changed).\n> > It is much easier to rebase series if youhave them as commits, and\n> > not as series of emails.\n> \n> Sure, I'll make sure of being rebased onto git master HEAD (or should\n> I rebase onto another development branch?) next time.  But is this\n> resend properly merging and working for you?\n\nThey got imported correctly, at least.\n\nThanks again!\n\n-- \nJakub Narebski\nPoland\n"}]}