{"thread":{"id":"32075","subject":"[PATCH] gitweb: add readme to overview page","startedAt":"2012-11-11T15:32:42Z","lastAt":"2012-11-30T01:11:43Z","messageCount":3,"participants":["Heinrich Schuchardt","Xypron"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"202868","messageId":"1352647962-21910-1-git-send-email-xypron.glpk@gmx.de","threadId":"32075","inReplyTo":null,"subject":"[PATCH] gitweb: add readme to overview page","fromName":"Heinrich Schuchardt","fromEmail":"xypron.glpk@gmx.de","sentAt":"2012-11-11T15:32:42Z","receivedAt":"2012-11-11T15:32:42Z","isPatch":true,"sender":{"key":"xypron.glpk@gmx.de","avatar":"https://gravatar.com/avatar/ecfc545fcbe89519e2ffdf4eccf04756d830b2a7a26780b6f5b3d5d569d1d362?d=mp&s=160"},"body":"For repositories it is possible to maintain a README.html which will\nbe shown on the summary page. This is not possible for the server\nroot.\n\nGerman law requires to provide contact data on the web server. This\ndata could easily be entered in the overview page using a README.html.\n\nFurthermore it is possible to put the repositories not directly into\nthe root directory but into a subdirectory. Here also a README.html\nwould be helpful to indicate what the subdirectory is about.\n\nThe patch introduces README.html functionality for the root directory\nand all subdirectories.\n\nSigned-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>\n---\n gitweb/gitweb.perl |   12 ++++++++++++\n 1 file changed, 12 insertions(+)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 10ed9e5..30cd028 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -6369,6 +6369,18 @@ sub git_project_list {\n \t}\n \n \tgit_project_search_form($searchtext, $search_use_regexp);\n+    # If XSS prevention is on, we don't include README.html.\n+    # TODO: Allow a readme in some safe format.\n+\tmy $path = \"/\";\n+\tif (defined $project_filter) {\n+\t    $path .= $project_filter;\n+\t}\n+    if (!$prevent_xss && -s \"$projectroot$path/README.html\") {\n+        print \"<div class=\\\"title\\\">readme</div>\\n\" .\n+              \"<div class=\\\"readme\\\">\\n\";\n+        insert_file(\"$projectroot$path/README.html\");\n+        print \"\\n</div>\\n\"; # class=\"readme\"\n+    }\n \tgit_project_list_body(\\@list, $order);\n \tgit_footer_html();\n }\n-- \n1.7.10.4\n"},{"id":"204299","messageId":"50B7E1FD.8060001@gmx.de","threadId":"32075","inReplyTo":"1352647962-21910-1-git-send-email-xypron.glpk@gmx.de","subject":"Re: [PATCH] gitweb: add readme to overview page","fromName":"Xypron","fromEmail":"xypron.glpk@gmx.de","sentAt":"2012-11-29T22:30:21Z","receivedAt":"2012-11-29T22:30:21Z","isPatch":true,"sender":{"key":"xypron.glpk@gmx.de","avatar":"https://gravatar.com/avatar/ecfc545fcbe89519e2ffdf4eccf04756d830b2a7a26780b6f5b3d5d569d1d362?d=mp&s=160"},"body":"Hello Junio,\n\nthank you for your comment in message\n<7vip9ak971.fsf@alter.siamese.dyndns.org>\nthat message <1352652039-31453-1-git-send-email-xypron.glpk@gmx.de>\nlost the thread context.\n\nAs already described I would be happy if a README.html could be added to\nthe overview page of gitweb.\n\nPlease, find below an updated patch. Compared to the first version of my\npatch it avoids a warning concerning doubled slashes in filenames and adds\na subtitle \"projects\" between the README and the project list.\n\nBest regards\n\nHeinrich Schuchardt\n\nSubject: [PATCH] gitweb: add readme to overview page\n\nFor repositories it is possible to maintain a README.html which will\nbe shown on the summary page. This is not possible for the server\nroot.\n\nGerman law requires to provide contact data on the web server. This\ndata could easily be entered in the overview page using a README.html.\n\nFurthermore it is possible to put the repositories not directly into\nthe root directory but into a subdirectory. Here also a README.html\nwould be helpful to indicate what the subdirectory is about.\n\nThe patch introduces README.html functionality for the root directory\nand all subdirectories.\n\nSigned-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>\n---\n gitweb/gitweb.perl |   13 +++++++++++++\n 1 file changed, 13 insertions(+)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex e8812fa..618b0d8 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -6368,6 +6368,19 @@ sub git_project_list {\n \t}\n \n \tgit_project_search_form($searchtext, $search_use_regexp);\n+\t# If XSS prevention is on, we don't include README.html.\n+\t# TODO: Allow a readme in some safe format.\n+\tmy $path = \"\";\n+\tif (defined $project_filter) {\n+\t\t$path = \"/$project_filter\";\n+\t}\n+\tif (!$prevent_xss && -s \"$projectroot$path/README.html\") {\n+\t\tprint \"<div class=\\\"title\\\">readme</div>\\n\" .\n+\t\t\"<div class=\\\"readme\\\">\\n\";\n+\t\tinsert_file(\"$projectroot$path/README.html\");\n+\t\tprint \"\\n</div>\\n\"; # class=\"readme\"\n+\t}\n+\tprint \"<div class=\\\"title\\\">projects</div>\\n\";\n \tgit_project_list_body(\\@list, $order);\n \tgit_footer_html();\n }\n-- \n1.7.10.4\n"},{"id":"204305","messageId":"50B807CF.1040803@gmx.de","threadId":"32075","inReplyTo":"50B7E1FD.8060001@gmx.de","subject":"Re: [PATCH] gitweb: add readme to overview page","fromName":"Xypron","fromEmail":"xypron.glpk@gmx.de","sentAt":"2012-11-30T01:11:43Z","receivedAt":"2012-11-30T01:11:43Z","isPatch":true,"sender":{"key":"xypron.glpk@gmx.de","avatar":"https://gravatar.com/avatar/ecfc545fcbe89519e2ffdf4eccf04756d830b2a7a26780b6f5b3d5d569d1d362?d=mp&s=160"},"body":"The following setting provides the same feature\n\n# html text to include at home page\n$home_text = \"indextext.html\";\n\nSorry for the noise.\n\nBest regards\n\nHeinrich Schuchardt\n\nOn 29.11.2012 23:30, Xypron wrote:\n> Hello Junio,\n> \n> thank you for your comment in message\n> <7vip9ak971.fsf@alter.siamese.dyndns.org>\n> that message <1352652039-31453-1-git-send-email-xypron.glpk@gmx.de>\n> lost the thread context.\n> \n> As already described I would be happy if a README.html could be added to\n> the overview page of gitweb.\n> \n> Please, find below an updated patch. Compared to the first version of my\n> patch it avoids a warning concerning doubled slashes in filenames and adds\n> a subtitle \"projects\" between the README and the project list.\n> \n> Best regards\n> \n> Heinrich Schuchardt\n> \n> Subject: [PATCH] gitweb: add readme to overview page\n> \n> For repositories it is possible to maintain a README.html which will\n> be shown on the summary page. This is not possible for the server\n> root.\n> \n> German law requires to provide contact data on the web server. This\n> data could easily be entered in the overview page using a README.html.\n> \n> Furthermore it is possible to put the repositories not directly into\n> the root directory but into a subdirectory. Here also a README.html\n> would be helpful to indicate what the subdirectory is about.\n> \n> The patch introduces README.html functionality for the root directory\n> and all subdirectories.\n> \n> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>\n> ---\n>  gitweb/gitweb.perl |   13 +++++++++++++\n>  1 file changed, 13 insertions(+)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index e8812fa..618b0d8 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -6368,6 +6368,19 @@ sub git_project_list {\n>  \t}\n>  \n>  \tgit_project_search_form($searchtext, $search_use_regexp);\n> +\t# If XSS prevention is on, we don't include README.html.\n> +\t# TODO: Allow a readme in some safe format.\n> +\tmy $path = \"\";\n> +\tif (defined $project_filter) {\n> +\t\t$path = \"/$project_filter\";\n> +\t}\n> +\tif (!$prevent_xss && -s \"$projectroot$path/README.html\") {\n> +\t\tprint \"<div class=\\\"title\\\">readme</div>\\n\" .\n> +\t\t\"<div class=\\\"readme\\\">\\n\";\n> +\t\tinsert_file(\"$projectroot$path/README.html\");\n> +\t\tprint \"\\n</div>\\n\"; # class=\"readme\"\n> +\t}\n> +\tprint \"<div class=\\\"title\\\">projects</div>\\n\";\n>  \tgit_project_list_body(\\@list, $order);\n>  \tgit_footer_html();\n>  }\n"}]}