{"thread":{"id":"5137","subject":"[PATCH 4/4] gitweb: No periods for error messages","startedAt":"2006-08-04T22:16:02Z","lastAt":"2006-08-05T07:03:17Z","messageCount":4,"participants":["Luben Tuikov","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"24766","messageId":"20060804221602.98727.qmail@web31813.mail.mud.yahoo.com","threadId":"5137","inReplyTo":null,"subject":"[PATCH 4/4] gitweb: No periods for error messages","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-08-04T22:16:02Z","receivedAt":"2006-08-04T22:16:02Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>\n---\n gitweb/gitweb.perl |   88 ++++++++++++++++++++++++++--------------------------\n 1 files changed, 44 insertions(+), 44 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 723823a..3731f4e 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -76,7 +76,7 @@ our $action = $cgi->param('a');\n if (defined $action) {\n \tif ($action =~ m/[^0-9a-zA-Z\\.\\-_]/) {\n \t\tundef $action;\n-\t\tdie_error(undef, \"Invalid action parameter.\");\n+\t\tdie_error(undef, \"Invalid action parameter\");\n \t}\n \tif ($action eq \"opml\") {\n \t\tgit_opml();\n@@ -89,15 +89,15 @@ if (defined $project) {\n \t$project =~ s|^/||; $project =~ s|/$||;\n \t$project = validate_input($project);\n \tif (!defined($project)) {\n-\t\tdie_error(undef, \"Invalid project parameter.\");\n+\t\tdie_error(undef, \"Invalid project parameter\");\n \t}\n \tif (!(-d \"$projectroot/$project\")) {\n \t\tundef $project;\n-\t\tdie_error(undef, \"No such directory.\");\n+\t\tdie_error(undef, \"No such directory\");\n \t}\n \tif (!(-e \"$projectroot/$project/HEAD\")) {\n \t\tundef $project;\n-\t\tdie_error(undef, \"No such project.\");\n+\t\tdie_error(undef, \"No such project\");\n \t}\n \t$rss_link = \"<link rel=\\\"alternate\\\" title=\\\"\" . esc_param($project) . \" log\\\" href=\\\"\" .\n \t            \"$my_uri?\" . esc_param(\"p=$project;a=rss\") . \"\\\" type=\\\"application/rss+xml\\\"/>\";\n@@ -111,7 +111,7 @@ our $file_name = $cgi->param('f');\n if (defined $file_name) {\n \t$file_name = validate_input($file_name);\n \tif (!defined($file_name)) {\n-\t\tdie_error(undef, \"Invalid file parameter.\");\n+\t\tdie_error(undef, \"Invalid file parameter\");\n \t}\n }\n \n@@ -119,7 +119,7 @@ our $hash = $cgi->param('h');\n if (defined $hash) {\n \t$hash = validate_input($hash);\n \tif (!defined($hash)) {\n-\t\tdie_error(undef, \"Invalid hash parameter.\");\n+\t\tdie_error(undef, \"Invalid hash parameter\");\n \t}\n }\n \n@@ -127,7 +127,7 @@ our $hash_parent = $cgi->param('hp');\n if (defined $hash_parent) {\n \t$hash_parent = validate_input($hash_parent);\n \tif (!defined($hash_parent)) {\n-\t\tdie_error(undef, \"Invalid hash parent parameter.\");\n+\t\tdie_error(undef, \"Invalid hash parent parameter\");\n \t}\n }\n \n@@ -135,7 +135,7 @@ our $hash_base = $cgi->param('hb');\n if (defined $hash_base) {\n \t$hash_base = validate_input($hash_base);\n \tif (!defined($hash_base)) {\n-\t\tdie_error(undef, \"Invalid hash base parameter.\");\n+\t\tdie_error(undef, \"Invalid hash base parameter\");\n \t}\n }\n \n@@ -143,7 +143,7 @@ our $page = $cgi->param('pg');\n if (defined $page) {\n \tif ($page =~ m/[^0-9]$/) {\n \t\tundef $page;\n-\t\tdie_error(undef, \"Invalid page parameter.\");\n+\t\tdie_error(undef, \"Invalid page parameter\");\n \t}\n }\n \n@@ -151,7 +151,7 @@ our $searchtext = $cgi->param('s');\n if (defined $searchtext) {\n \tif ($searchtext =~ m/[^a-zA-Z0-9_\\.\\/\\-\\+\\:\\@ ]/) {\n \t\tundef $searchtext;\n-\t\tdie_error(undef, \"Invalid search parameter.\");\n+\t\tdie_error(undef, \"Invalid search parameter\");\n \t}\n \t$searchtext = quotemeta $searchtext;\n }\n@@ -181,7 +181,7 @@ my %actions = (\n $action = 'summary' if (!defined($action));\n if (!defined($actions{$action})) {\n \tundef $action;\n-\tdie_error(undef, \"Unknown action.\");\n+\tdie_error(undef, \"Unknown action\");\n }\n $actions{$action}->();\n exit;\n@@ -427,7 +427,7 @@ sub git_get_hash_by_path {\n \tmy $tree = $base;\n \n \topen my $fd, \"-|\", $GIT, \"ls-tree\", $base, \"--\", $path\n-\t\tor die_error(undef, \"Open git-ls-tree failed.\");\n+\t\tor die_error(undef, \"Open git-ls-tree failed\");\n \tmy $line = <$fd>;\n \tclose $fd or return undef;\n \n@@ -1274,13 +1274,13 @@ ## actions\n sub git_project_list {\n \tmy $order = $cgi->param('o');\n \tif (defined $order && $order !~ m/project|descr|owner|age/) {\n-\t\tdie_error(undef, \"Invalid order parameter '$order'.\");\n+\t\tdie_error(undef, \"Invalid order parameter '$order'\");\n \t}\n \n \tmy @list = git_read_projects();\n \tmy @projects;\n \tif (!@list) {\n-\t\tdie_error(undef, \"No projects found.\");\n+\t\tdie_error(undef, \"No projects found\");\n \t}\n \tforeach my $pr (@list) {\n \t\tmy $head = git_read_head($pr->{'path'});\n@@ -1414,7 +1414,7 @@ sub git_summary {\n \t      \"</table>\\n\";\n \n \topen my $fd, \"-|\", $GIT, \"rev-list\", \"--max-count=17\", git_read_head($project)\n-\t\tor die_error(undef, \"Open git-rev-list failed.\");\n+\t\tor die_error(undef, \"Open git-rev-list failed\");\n \tmy @revlist = map { chomp; $_ } <$fd>;\n \tclose $fd;\n \tgit_header_div('shortlog');\n@@ -1470,7 +1470,7 @@ sub git_tag {\n sub git_blame2 {\n \tmy $fd;\n \tmy $ftype;\n-\tdie_error(undef, \"Permission denied.\") if (!git_get_project_config_bool ('blame'));\n+\tdie_error(undef, \"Permission denied\") if (!git_get_project_config_bool ('blame'));\n \tdie_error('404 Not Found', \"File name not defined\") if (!$file_name);\n \t$hash_base ||= git_read_head($project);\n \tdie_error(undef, \"Reading commit failed\") unless ($hash_base);\n@@ -1485,7 +1485,7 @@ sub git_blame2 {\n \t\tdie_error(\"400 Bad Request\", \"object is not a blob\");\n \t}\n \topen ($fd, \"-|\", $GIT, \"blame\", '-l', $file_name, $hash_base)\n-\t\tor die_error(undef, \"Open git-blame failed.\");\n+\t\tor die_error(undef, \"Open git-blame failed\");\n \tgit_header_html();\n \tmy $formats_nav =\n \t\t$cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name\")}, \"blob\") .\n@@ -1528,18 +1528,18 @@ sub git_blame2 {\n \n sub git_blame {\n \tmy $fd;\n-\tdie_error('403 Permission denied', \"Permission denied.\") if (!git_get_project_config_bool ('blame'));\n+\tdie_error('403 Permission denied', \"Permission denied\") if (!git_get_project_config_bool ('blame'));\n \tdie_error('404 Not Found', \"What file will it be, master?\") if (!$file_name);\n \t$hash_base ||= git_read_head($project);\n-\tdie_error(undef, \"Reading commit failed.\") unless ($hash_base);\n+\tdie_error(undef, \"Reading commit failed\") unless ($hash_base);\n \tmy %co = git_read_commit($hash_base)\n-\t\tor die_error(undef, \"Reading commit failed.\");\n+\t\tor die_error(undef, \"Reading commit failed\");\n \tif (!defined $hash) {\n \t\t$hash = git_get_hash_by_path($hash_base, $file_name, \"blob\")\n-\t\t\tor die_error(undef, \"Error lookup file.\");\n+\t\t\tor die_error(undef, \"Error lookup file\");\n \t}\n \topen ($fd, \"-|\", $GIT, \"annotate\", '-l', '-t', '-r', $file_name, $hash_base)\n-\t\tor die_error(undef, \"Open git-annotate failed.\");\n+\t\tor die_error(undef, \"Open git-annotate failed\");\n \tgit_header_html();\n \tmy $formats_nav =\n \t\t$cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name\")}, \"blob\") .\n@@ -1649,9 +1649,9 @@ sub git_blob_plain {\n \t\tif (defined $file_name) {\n \t\t\tmy $base = $hash_base || git_read_head($project);\n \t\t\t$hash = git_get_hash_by_path($base, $file_name, \"blob\")\n-\t\t\t\tor die_error(undef, \"Error lookup file.\");\n+\t\t\t\tor die_error(undef, \"Error lookup file\");\n \t\t} else {\n-\t\t\tdie_error(undef, \"No file name defined.\");\n+\t\t\tdie_error(undef, \"No file name defined\");\n \t\t}\n \t}\n \tmy $type = shift;\n@@ -1682,14 +1682,14 @@ sub git_blob {\n \t\tif (defined $file_name) {\n \t\t\tmy $base = $hash_base || git_read_head($project);\n \t\t\t$hash = git_get_hash_by_path($base, $file_name, \"blob\")\n-\t\t\t\tor die_error(undef, \"Error lookup file.\");\n+\t\t\t\tor die_error(undef, \"Error lookup file\");\n \t\t} else {\n-\t\t\tdie_error(undef, \"No file name defined.\");\n+\t\t\tdie_error(undef, \"No file name defined\");\n \t\t}\n \t}\n \tmy $have_blame = git_get_project_config_bool ('blame');\n \topen my $fd, \"-|\", $GIT, \"cat-file\", \"blob\", $hash\n-\t\tor die_error(undef, \"Couldn't cat $file_name, $hash.\");\n+\t\tor die_error(undef, \"Couldn't cat $file_name, $hash\");\n \tmy $mimetype = git_blob_plain_mimetype($fd, $file_name);\n \tif ($mimetype !~ m/^text\\//) {\n \t\tclose $fd;\n@@ -1747,9 +1747,9 @@ sub git_tree {\n \t}\n \t$/ = \"\\0\";\n \topen my $fd, \"-|\", $GIT, \"ls-tree\", '-z', $hash\n-\t\tor die_error(undef, \"Open git-ls-tree failed.\");\n+\t\tor die_error(undef, \"Open git-ls-tree failed\");\n \tmy @entries = map { chomp; $_ } <$fd>;\n-\tclose $fd or die_error(undef, \"Reading tree failed.\");\n+\tclose $fd or die_error(undef, \"Reading tree failed\");\n \t$/ = \"\\n\";\n \n \tmy $refs = read_info_ref();\n@@ -1828,7 +1828,7 @@ sub git_log {\n \n \tmy $limit = sprintf(\"--max-count=%i\", (100 * ($page+1)));\n \topen my $fd, \"-|\", $GIT, \"rev-list\", $limit, $hash\n-\t\tor die_error(undef, \"Open git-rev-list failed.\");\n+\t\tor die_error(undef, \"Open git-rev-list failed\");\n \tmy @revlist = map { chomp; $_ } <$fd>;\n \tclose $fd;\n \n@@ -1889,7 +1889,7 @@ sub git_log {\n sub git_commit {\n \tmy %co = git_read_commit($hash);\n \tif (!%co) {\n-\t\tdie_error(undef, \"Unknown commit object.\");\n+\t\tdie_error(undef, \"Unknown commit object\");\n \t}\n \tmy %ad = date_str($co{'author_epoch'}, $co{'author_tz'});\n \tmy %cd = date_str($co{'committer_epoch'}, $co{'committer_tz'});\n@@ -1899,9 +1899,9 @@ sub git_commit {\n \t\t$parent = \"--root\";\n \t}\n \topen my $fd, \"-|\", $GIT, \"diff-tree\", '-r', '-M', $parent, $hash\n-\t\tor die_error(undef, \"Open git-diff-tree failed.\");\n+\t\tor die_error(undef, \"Open git-diff-tree failed\");\n \tmy @difftree = map { chomp; $_ } <$fd>;\n-\tclose $fd or die_error(undef, \"Reading git-diff-tree failed.\");\n+\tclose $fd or die_error(undef, \"Reading git-diff-tree failed\");\n \n \t# non-textual hash id's can be cached\n \tmy $expires;\n@@ -2117,15 +2117,15 @@ sub git_commitdiff {\n \tmkdir($git_temp, 0700);\n \tmy %co = git_read_commit($hash);\n \tif (!%co) {\n-\t\tdie_error(undef, \"Unknown commit object.\");\n+\t\tdie_error(undef, \"Unknown commit object\");\n \t}\n \tif (!defined $hash_parent) {\n \t\t$hash_parent = $co{'parent'};\n \t}\n \topen my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\n-\t\tor die_error(undef, \"Open git-diff-tree failed.\");\n+\t\tor die_error(undef, \"Open git-diff-tree failed\");\n \tmy @difftree = map { chomp; $_ } <$fd>;\n-\tclose $fd or die_error(undef, \"Reading diff-tree failed.\");\n+\tclose $fd or die_error(undef, \"Reading diff-tree failed\");\n \n \t# non-textual hash id's can be cached\n \tmy $expires;\n@@ -2205,9 +2205,9 @@ sub git_commitdiff {\n sub git_commitdiff_plain {\n \tmkdir($git_temp, 0700);\n \topen my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\n-\t\tor die_error(undef, \"Open git-diff-tree failed.\");\n+\t\tor die_error(undef, \"Open git-diff-tree failed\");\n \tmy @difftree = map { chomp; $_ } <$fd>;\n-\tclose $fd or die_error(undef, \"Reading diff-tree failed.\");\n+\tclose $fd or die_error(undef, \"Reading diff-tree failed\");\n \n \t# try to figure out the next tag after this commit\n \tmy $tagname;\n@@ -2265,7 +2265,7 @@ sub git_history {\n \tmy $ftype;\n \tmy %co = git_read_commit($hash_base);\n \tif (!%co) {\n-\t\tdie_error(undef, \"Unknown commit object.\");\n+\t\tdie_error(undef, \"Unknown commit object\");\n \t}\n \tmy $refs = read_info_ref();\n \tgit_header_html();\n@@ -2323,14 +2323,14 @@ sub git_history {\n \n sub git_search {\n \tif (!defined $searchtext) {\n-\t\tdie_error(\"\", \"Text field empty.\");\n+\t\tdie_error(\"\", \"Text field empty\");\n \t}\n \tif (!defined $hash) {\n \t\t$hash = git_read_head($project);\n \t}\n \tmy %co = git_read_commit($hash);\n \tif (!%co) {\n-\t\tdie_error(undef, \"Unknown commit object.\");\n+\t\tdie_error(undef, \"Unknown commit object\");\n \t}\n \t# pickaxe may take all resources of your box and run for several minutes\n \t# with every query - so decide by yourself how public you make this feature :)\n@@ -2468,7 +2468,7 @@ sub git_shortlog {\n \n \tmy $limit = sprintf(\"--max-count=%i\", (100 * ($page+1)));\n \topen my $fd, \"-|\", $GIT, \"rev-list\", $limit, $hash\n-\t\tor die_error(undef, \"Open git-rev-list failed.\");\n+\t\tor die_error(undef, \"Open git-rev-list failed\");\n \tmy @revlist = map { chomp; $_ } <$fd>;\n \tclose $fd;\n \n@@ -2496,9 +2496,9 @@ ## feeds (RSS, OPML)\n sub git_rss {\n \t# http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ\n \topen my $fd, \"-|\", $GIT, \"rev-list\", \"--max-count=150\", git_read_head($project)\n-\t\tor die_error(undef, \"Open git-rev-list failed.\");\n+\t\tor die_error(undef, \"Open git-rev-list failed\");\n \tmy @revlist = map { chomp; $_ } <$fd>;\n-\tclose $fd or die_error(undef, \"Reading rev-list failed.\");\n+\tclose $fd or die_error(undef, \"Reading rev-list failed\");\n \tprint $cgi->header(-type => 'text/xml', -charset => 'utf-8');\n \tprint \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\".\n \t      \"<rss version=\\\"2.0\\\" xmlns:content=\\\"http://purl.org/rss/1.0/modules/content/\\\">\\n\";\n-- \n1.4.2.rc3.g6df3\n\n"},{"id":"24782","messageId":"7vpsfgghi2.fsf@assigned-by-dhcp.cox.net","threadId":"5137","inReplyTo":"20060804221602.98727.qmail@web31813.mail.mud.yahoo.com","subject":"Re: [PATCH 4/4] gitweb: No periods for error messages","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-05T00:20:53Z","receivedAt":"2006-08-05T00:20:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This and Jakub's [1/5] seem to be going the opposite way.  I\ntend to prefer ending each sentence with a full stop.\n"},{"id":"24786","messageId":"20060805010307.17651.qmail@web31807.mail.mud.yahoo.com","threadId":"5137","inReplyTo":"7vpsfgghi2.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 4/4] gitweb: No periods for error messages","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-08-05T01:03:07Z","receivedAt":"2006-08-05T01:03:07Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Junio C Hamano <junkio@cox.net> wrote:\n\n> This and Jakub's [1/5] seem to be going the opposite way.\n\nNot quite.  They both do the same thing, except his patch\ndoes it only half way: \n  - no full stop for error messages ending with some kind\n    of variable expansion.\n  - full stop for static error messages.\n\n> I tend to prefer ending each sentence with a full stop.\n\nI've never seen this in, among other things,\n  - kernel messages\n  - errno messages\n  - web server messages\n  - RFC text describing error messages, (web services),\n  - etc.\n\nI was going for was consistency.  I'd say apply Jacob's [6/5].\n\n   Luben\n"},{"id":"24803","messageId":"7vwt9nekay.fsf@assigned-by-dhcp.cox.net","threadId":"5137","inReplyTo":"20060805010307.17651.qmail@web31807.mail.mud.yahoo.com","subject":"Re: [PATCH 4/4] gitweb: No periods for error messages","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-05T07:03:17Z","receivedAt":"2006-08-05T07:03:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Luben Tuikov <ltuikov@yahoo.com> writes:\n\n> --- Junio C Hamano <junkio@cox.net> wrote:\n>\n>> I tend to prefer ending each sentence with a full stop.\n>\n> I've never seen this in, among other things,\n>   - kernel messages\n>   - errno messages\n>   - web server messages\n>   - RFC text describing error messages, (web services),\n>   - etc.\n\nComparing\n\n\tgit grep \\( -e die --or -e die \\) --and -e '\\.\"' -- '*.c'\n\nand\n\n\tgit grep \\( -e die --or -e die \\) --and --not -e '\\.\"' -- '*.c'\n\ntells me that we omit periods, mostly.\n\n> I was going for was consistency.  I'd say apply Jacob's [6/5].\n\nWell, [6/5] is on top of [1/5] which had the problem of\nparroting unsanitized user input, so I'd rather use a clean\npatch that does only this error message cleanups.\n"}]}