{"thread":{"id":"5138","subject":"[PATCH 0/5] Some further gitweb patches","startedAt":"2006-08-04T22:36:06Z","lastAt":"2006-08-05T16:15:30Z","messageCount":26,"participants":["Jakub Narebski","Luben Tuikov","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"24767","messageId":"200608050036.06490.jnareb@gmail.com","threadId":"5138","inReplyTo":null,"subject":"[PATCH 0/5] Some further gitweb patches","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-04T22:36:06Z","receivedAt":"2006-08-04T22:36:06Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Based on 'next' branch, v1.4.2-rc3-g1c4b267\n\nThis is also kind of cleanup series of patches, although it introduces \nminor improvements (patches 1 and 5).\n\nThis series does not include latest Luben Tuikov series...\n-- \nJakub Narebski\nPoland\n"},{"id":"24769","messageId":"200608050038.20534.jnareb@gmail.com","threadId":"5138","inReplyTo":"200608050036.06490.jnareb@gmail.com","subject":"[PATCH 1/5] gitweb: Cleanup input validation and error messages","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-04T22:38:20Z","receivedAt":"2006-08-04T22:38:20Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Clean up input validation, including removing $rss_link variable and\nmaking error messages more explicit.  Expand and uniquify other error\nmessages.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nThis probably conflicts \"[PATCH 4/4] gitweb: No periods for error messages\".\nIt uses periods for error messages which does not end in with some \nvalue of some variable.\n\n gitweb/gitweb.perl |   88 ++++++++++++++++++++++++----------------------------\n 1 files changed, 40 insertions(+), 48 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 58eb5b1..dfc2d09 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -71,13 +71,15 @@ if (! -d $git_temp) {\n \tmkdir($git_temp, 0700) || die_error(\"Couldn't mkdir $git_temp\");\n }\n \n+\n+# ======================================================================\n # input validation and dispatch\n 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 $action\");\n \t}\n+\t# action which does not check rest of parameters\n \tif ($action eq \"opml\") {\n \t\tgit_opml();\n \t\texit;\n@@ -85,22 +87,17 @@ if (defined $action) {\n }\n \n our $project = ($cgi->param('p') || $ENV{'PATH_INFO'});\n-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+$project =~ s|^/||; $project =~ s|/$||;\n+if (defined $project || $project) {\n+\tif (!validate_input($project)) {\n+\t\tdie_error(undef, \"Invalid project parameter $project\");\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 $project\");\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 $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 \t$ENV{'GIT_DIR'} = \"$projectroot/$project\";\n } else {\n \tgit_project_list();\n@@ -109,49 +106,43 @@ if (defined $project) {\n \n 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+\tif (!validate_input($file_name)) {\n+\t\tdie_error(undef, \"Invalid file parameter $file_name\");\n \t}\n }\n \n 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+\tif (!validate_input($hash)) {\n+\t\tdie_error(undef, \"Invalid hash parameter $hash\");\n \t}\n }\n \n 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+\tif (!validate_input($hash_parent)) {\n+\t\tdie_error(undef, \"Invalid hash parent parameter $hash_parent\");\n \t}\n }\n \n 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+\tif (!validate_input($hash_base)) {\n+\t\tdie_error(undef, \"Invalid hash base parameter $hash_base\");\n \t}\n }\n \n 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 $page\");\n \t}\n }\n \n 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 $searchtext\");\n \t}\n \t$searchtext = quotemeta $searchtext;\n }\n@@ -180,8 +171,7 @@ my %actions = (\n \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 $action\");\n }\n $actions{$action}->();\n exit;\n@@ -871,11 +861,13 @@ sub git_header_html {\n <meta name=\"robots\" content=\"index, nofollow\"/>\n <title>$title</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"$stylesheet\"/>\n-$rss_link\n-</head>\n-<body>\n EOF\n-\tprint \"<div class=\\\"page_header\\\">\\n\" .\n+\tprint \"<link rel=\\\"alternate\\\" title=\\\"\" . esc_param($project) . \" log\\\" href=\\\"\" .\n+\t      \"$my_uri?\" . esc_param(\"p=$project;a=rss\") . \"\\\" type=\\\"application/rss+xml\\\"/>\\n\" .\n+\t      \"</head>\\n\";\n+\n+\tprint \"<body>\\n\" .\n+\t      \"<div class=\\\"page_header\\\">\\n\" .\n \t      \"<a href=\\\"http://www.kernel.org/pub/software/scm/git/docs/\\\" title=\\\"git documentation\\\">\" .\n \t      \"<img src=\\\"$logo\\\" width=\\\"72\\\" height=\\\"27\\\" alt=\\\"git\\\" style=\\\"float:right; border-width:0px;\\\"/>\" .\n \t      \"</a>\\n\";\n@@ -1471,18 +1463,18 @@ 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('404 Not Found', \"File name not defined\") if (!$file_name);\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+\tdie_error(undef, \"Couldn't find base commit.\") 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 looking up file\");\n+\t\t\tor die_error(undef, \"Error looking up file $file_name\");\n \t}\n \t$ftype = git_get_type($hash);\n \tif ($ftype !~ \"blob\") {\n-\t\tdie_error(\"400 Bad Request\", \"object is not a blob\");\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@@ -1529,14 +1521,14 @@ sub git_blame2 {\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('404 Not Found', \"What file will it be, master?\") if (!$file_name);\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+\tdie_error(undef, \"Couldn't find base commit.\") unless ($hash_base);\n \tmy %co = git_read_commit($hash_base)\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 $file_name\");\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@@ -1649,7 +1641,7 @@ 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 $file_name\");\n \t\t} else {\n \t\t\tdie_error(undef, \"No file name defined.\");\n \t\t}\n@@ -1682,7 +1674,7 @@ 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 $file_name\");\n \t\t} else {\n \t\t\tdie_error(undef, \"No file name defined.\");\n \t\t}\n@@ -2122,7 +2114,7 @@ sub git_commitdiff {\n \topen my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\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 git-diff-tree failed.\");\n \n \t# non-textual hash id's can be cached\n \tmy $expires;\n@@ -2202,7 +2194,7 @@ sub git_commitdiff_plain {\n \topen my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\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 git-diff-tree failed.\");\n \n \t# try to figure out the next tag after this commit\n \tmy $tagname;\n@@ -2493,7 +2485,7 @@ sub git_rss {\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 \tmy @revlist = map { chomp; $_ } <$fd>;\n-\tclose $fd or die_error(undef, \"Reading rev-list failed.\");\n+\tclose $fd or die_error(undef, \"Reading git-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.1.1\n"},{"id":"24772","messageId":"200608050039.40495.jnareb@gmail.com","threadId":"5138","inReplyTo":"200608050036.06490.jnareb@gmail.com","subject":"[PATCH 2/5] gitweb: Great subroutines renaming","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-04T22:39:39Z","receivedAt":"2006-08-04T22:39:39Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Rename some of subroutines to better reflect what they do.\nSome renames were not performed because subroutine name\nreflects hash key.\n\nSubroutines name guideline:\n* git_ prefix for subroutines related to git commands,\n  or to gitweb actions\n* git_get_ prefix for subroutines calling git command\n  and returning some output\n* git_read_ prefix for subroutines directly accessing git\n  repository files\n* parse_ prefix for subroutines parsing some text, or reading and\n  parsing some text into hash or list\n* format_ prefix for subroutines formatting/post-processing some\n  HTML/text fragment\n* _get_ infix for subroutines which return result\n* _print_ infix for subroutines which print fragment of output\n* _body suffix for subroutines which outputs main part (body)\n  of related action\n* _nav suffix for subroutines related to navigation bars\n* _div suffix for subroutines returning or ptinting div element\n\nRenames:\n- git_get_referencing => format_mark_referencing\n- git_read_head => git_get_head\n- read_info_ref => git_read_info_refs\n- date_str => parse_date\n- git_read_tag => parse_tag\n- git_read_commit => parse_commit\n- git_blob_plain_mimetype => blob_plain_mimetype\n- git_page_nav => git_print_page_nav\n- git_header_div => git_print_header_div\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nI don't follow my own guidelines, not completely.\nI should probably post this patch earlier.\n\n gitweb/gitweb.perl |  232 ++++++++++++++++++++++++++--------------------------\n 1 files changed, 117 insertions(+), 115 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex dfc2d09..d440546 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -21,7 +21,6 @@ our $cgi = new CGI;\n our $version = \"++GIT_VERSION++\";\n our $my_url = $cgi->url();\n our $my_uri = $cgi->url(-absolute => 1);\n-our $rss_link = \"\";\n \n # core git executable to use\n # this can just be \"git\" if your webserver has a sensible PATH\n@@ -347,7 +346,7 @@ sub format_log_line_html {\n }\n \n # format marker of refs pointing to given object\n-sub git_get_referencing {\n+sub format_mark_referencing {\n \tmy ($refs, $id) = @_;\n \n \tif (defined $refs->{$id}) {\n@@ -361,7 +360,7 @@ ## -------------------------------------\n ## git utility subroutines, invoking git commands\n \n # get HEAD ref of given project as hash\n-sub git_read_head {\n+sub git_get_head {\n \tmy $project = shift;\n \tmy $oENV = $ENV{'GIT_DIR'};\n \tmy $retval = undef;\n@@ -496,7 +495,7 @@ sub git_read_projects {\n \treturn @list;\n }\n \n-sub read_info_ref {\n+sub git_read_info_refs {\n \tmy $type = shift || \"\";\n \tmy %refs;\n \t# 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c\trefs/tags/v2.6.11\n@@ -521,7 +520,8 @@ sub read_info_ref {\n ## ----------------------------------------------------------------------\n ## parse to hash functions\n \n-sub date_str {\n+# parse date from epoch and timezone\n+sub parse_date {\n \tmy $epoch = shift;\n \tmy $tz = shift || \"-0000\";\n \n@@ -546,7 +546,8 @@ sub date_str {\n \treturn %date;\n }\n \n-sub git_read_tag {\n+# parse tag given by tag_id\n+sub parse_tag {\n \tmy $tag_id = shift;\n \tmy %tag;\n \tmy @comment;\n@@ -581,7 +582,8 @@ sub git_read_tag {\n \treturn %tag\n }\n \n-sub git_read_commit {\n+# parse commit given by commit_id, with optionally given @commit_lines\n+sub parse_commit {\n \tmy $commit_id = shift;\n \tmy $commit_text = shift;\n \n@@ -701,10 +703,10 @@ sub git_read_refs {\n \t\t$ref_item{'epoch'} = 0;\n \t\t$ref_item{'age'} = \"unknown\";\n \t\tif ($type eq \"tag\") {\n-\t\t\tmy %tag = git_read_tag($ref_id);\n+\t\t\tmy %tag = parse_tag($ref_id);\n \t\t\t$ref_item{'comment'} = $tag{'comment'};\n \t\t\tif ($tag{'type'} eq \"commit\") {\n-\t\t\t\t%co = git_read_commit($tag{'object'});\n+\t\t\t\t%co = parse_commit($tag{'object'});\n \t\t\t\t$ref_item{'epoch'} = $co{'committer_epoch'};\n \t\t\t\t$ref_item{'age'} = $co{'age_string'};\n \t\t\t} elsif (defined($tag{'epoch'})) {\n@@ -716,7 +718,7 @@ sub git_read_refs {\n \t\t\t$ref_item{'name'} = $tag{'name'};\n \t\t\t$ref_item{'refid'} = $tag{'object'};\n \t\t} elsif ($type eq \"commit\"){\n-\t\t\t%co = git_read_commit($ref_id);\n+\t\t\t%co = parse_commit($ref_id);\n \t\t\t$ref_item{'reftype'} = \"commit\";\n \t\t\t$ref_item{'name'} = $ref_file;\n \t\t\t$ref_item{'title'} = $co{'title'};\n@@ -791,7 +793,7 @@ sub mimetype_guess {\n \treturn $mime;\n }\n \n-sub git_blob_plain_mimetype {\n+sub blob_plain_mimetype {\n \tmy $fd = shift;\n \tmy $filename = shift;\n \n@@ -936,7 +938,7 @@ sub die_error {\n ## ----------------------------------------------------------------------\n ## functions printing or outputting HTML: navigation\n \n-sub git_page_nav {\n+sub git_print_page_nav {\n \tmy ($current, $suppress, $head, $treehead, $treebase, $extra) = @_;\n \t$extra = '' if !defined $extra; # pager or formats\n \n@@ -1003,7 +1005,7 @@ sub git_get_paging_nav {\n ## ......................................................................\n ## functions printing or outputting HTML: div\n \n-sub git_header_div {\n+sub git_print_header_div {\n \tmy ($action, $title, $hash, $hash_base) = @_;\n \tmy $rest = '';\n \n@@ -1043,10 +1045,10 @@ sub git_shortlog_body {\n \tmy $alternate = 0;\n \tfor (my $i = $from; $i <= $to; $i++) {\n \t\tmy $commit = $revlist->[$i];\n-\t\t#my $ref = defined $refs ? git_get_referencing($refs, $commit) : '';\n-\t\tmy $ref = git_get_referencing($refs, $commit);\n-\t\tmy %co = git_read_commit($commit);\n-\t\tmy %ad = date_str($co{'author_epoch'});\n+\t\t#my $ref = defined $refs ? format_mark_referencing($refs, $commit) : '';\n+\t\tmy $ref = format_mark_referencing($refs, $commit);\n+\t\tmy %co = parse_commit($commit);\n+\t\tmy %ad = parse_date($co{'author_epoch'});\n \t\tif ($alternate) {\n \t\t\tprint \"<tr class=\\\"dark\\\">\\n\";\n \t\t} else {\n@@ -1275,12 +1277,12 @@ sub git_project_list {\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+\t\tmy $head = git_get_head($pr->{'path'});\n \t\tif (!defined $head) {\n \t\t\tnext;\n \t\t}\n \t\t$ENV{'GIT_DIR'} = \"$projectroot/$pr->{'path'}\";\n-\t\tmy %co = git_read_commit($head);\n+\t\tmy %co = parse_commit($head);\n \t\tif (!%co) {\n \t\t\tnext;\n \t\t}\n@@ -1371,9 +1373,9 @@ sub git_project_list {\n \n sub git_summary {\n \tmy $descr = git_read_description($project) || \"none\";\n-\tmy $head = git_read_head($project);\n-\tmy %co = git_read_commit($head);\n-\tmy %cd = date_str($co{'committer_epoch'}, $co{'committer_tz'});\n+\tmy $head = git_get_head($project);\n+\tmy %co = parse_commit($head);\n+\tmy %cd = parse_date($co{'committer_epoch'}, $co{'committer_tz'});\n \n \tmy $owner;\n \tif (-f $projects_list) {\n@@ -1394,9 +1396,9 @@ sub git_summary {\n \t\t$owner = get_file_owner(\"$projectroot/$project\");\n \t}\n \n-\tmy $refs = read_info_ref();\n+\tmy $refs = git_read_info_refs();\n \tgit_header_html();\n-\tgit_page_nav('summary','', $head);\n+\tgit_print_page_nav('summary','', $head);\n \n \tprint \"<div class=\\\"title\\\">&nbsp;</div>\\n\";\n \tprint \"<table cellspacing=\\\"0\\\">\\n\" .\n@@ -1405,24 +1407,24 @@ sub git_summary {\n \t      \"<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\\n\" .\n \t      \"</table>\\n\";\n \n-\topen my $fd, \"-|\", $GIT, \"rev-list\", \"--max-count=17\", git_read_head($project)\n+\topen my $fd, \"-|\", $GIT, \"rev-list\", \"--max-count=17\", git_get_head($project)\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+\tgit_print_header_div('shortlog');\n \tgit_shortlog_body(\\@revlist, 0, 15, $refs,\n \t                  $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=shortlog\")}, \"...\"));\n \n \tmy $taglist = git_read_refs(\"refs/tags\");\n \tif (defined @$taglist) {\n-\t\tgit_header_div('tags');\n+\t\tgit_print_header_div('tags');\n \t\tgit_tags_body($taglist, 0, 15,\n \t\t              $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=tags\")}, \"...\"));\n \t}\n \n \tmy $headlist = git_read_refs(\"refs/heads\");\n \tif (defined @$headlist) {\n-\t\tgit_header_div('heads');\n+\t\tgit_print_header_div('heads');\n \t\tgit_heads_body($headlist, $head, 0, 15,\n \t\t               $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=heads\")}, \"...\"));\n \t}\n@@ -1431,11 +1433,11 @@ sub git_summary {\n }\n \n sub git_tag {\n-\tmy $head = git_read_head($project);\n+\tmy $head = git_get_head($project);\n \tgit_header_html();\n-\tgit_page_nav('','', $head,undef,$head);\n-\tmy %tag = git_read_tag($hash);\n-\tgit_header_div('commit', esc_html($tag{'name'}), $hash);\n+\tgit_print_page_nav('','', $head,undef,$head);\n+\tmy %tag = parse_tag($hash);\n+\tgit_print_header_div('commit', esc_html($tag{'name'}), $hash);\n \tprint \"<div class=\\\"title_text\\\">\\n\" .\n \t      \"<table cellspacing=\\\"0\\\">\\n\" .\n \t      \"<tr>\\n\" .\n@@ -1444,7 +1446,7 @@ sub git_tag {\n \t      \"<td class=\\\"link\\\">\" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=$tag{'type'};h=$tag{'object'}\")}, $tag{'type'}) . \"</td>\\n\" .\n \t      \"</tr>\\n\";\n \tif (defined($tag{'author'})) {\n-\t\tmy %ad = date_str($tag{'epoch'}, $tag{'tz'});\n+\t\tmy %ad = parse_date($tag{'epoch'}, $tag{'tz'});\n \t\tprint \"<tr><td>author</td><td>\" . esc_html($tag{'author'}) . \"</td></tr>\\n\";\n \t\tprint \"<tr><td></td><td>\" . $ad{'rfc2822'} . sprintf(\" (%02d:%02d %s)\", $ad{'hour_local'}, $ad{'minute_local'}, $ad{'tz_local'}) . \"</td></tr>\\n\";\n \t}\n@@ -1464,9 +1466,9 @@ sub git_blame2 {\n \tmy $ftype;\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+\t$hash_base ||= git_get_head($project);\n \tdie_error(undef, \"Couldn't find base commit.\") unless ($hash_base);\n-\tmy %co = git_read_commit($hash_base)\n+\tmy %co = parse_commit($hash_base)\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@@ -1482,8 +1484,8 @@ sub git_blame2 {\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 \t\t\" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blame;f=$file_name\")}, \"head\");\n-\tgit_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);\n-\tgit_header_div('commit', esc_html($co{'title'}), $hash_base);\n+\tgit_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);\n+\tgit_print_header_div('commit', esc_html($co{'title'}), $hash_base);\n \tgit_print_page_path($file_name, $ftype);\n \tmy @rev_color = (qw(light dark));\n \tmy $num_colors = scalar(@rev_color);\n@@ -1522,9 +1524,9 @@ sub git_blame {\n \tmy $fd;\n \tdie_error('403 Permission denied', \"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+\t$hash_base ||= git_get_head($project);\n \tdie_error(undef, \"Couldn't find base commit.\") unless ($hash_base);\n-\tmy %co = git_read_commit($hash_base)\n+\tmy %co = parse_commit($hash_base)\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@@ -1536,8 +1538,8 @@ sub git_blame {\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 \t\t\" | \" . $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blame;f=$file_name\")}, \"head\");\n-\tgit_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);\n-\tgit_header_div('commit', esc_html($co{'title'}), $hash_base);\n+\tgit_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);\n+\tgit_print_header_div('commit', esc_html($co{'title'}), $hash_base);\n \tgit_print_page_path($file_name, 'blob');\n \tprint \"<div class=\\\"page_body\\\">\\n\";\n \tprint <<HTML;\n@@ -1610,10 +1612,10 @@ HTML\n }\n \n sub git_tags {\n-\tmy $head = git_read_head($project);\n+\tmy $head = git_get_head($project);\n \tgit_header_html();\n-\tgit_page_nav('','', $head,undef,$head);\n-\tgit_header_div('summary', $project);\n+\tgit_print_page_nav('','', $head,undef,$head);\n+\tgit_print_header_div('summary', $project);\n \n \tmy $taglist = git_read_refs(\"refs/tags\");\n \tif (defined @$taglist) {\n@@ -1623,10 +1625,10 @@ sub git_tags {\n }\n \n sub git_heads {\n-\tmy $head = git_read_head($project);\n+\tmy $head = git_get_head($project);\n \tgit_header_html();\n-\tgit_page_nav('','', $head,undef,$head);\n-\tgit_header_div('summary', $project);\n+\tgit_print_page_nav('','', $head,undef,$head);\n+\tgit_print_header_div('summary', $project);\n \n \tmy $taglist = git_read_refs(\"refs/heads\");\n \tmy $alternate = 0;\n@@ -1639,7 +1641,7 @@ sub git_heads {\n sub git_blob_plain {\n \tif (!defined $hash) {\n \t\tif (defined $file_name) {\n-\t\t\tmy $base = $hash_base || git_read_head($project);\n+\t\t\tmy $base = $hash_base || git_get_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 $file_name\");\n \t\t} else {\n@@ -1650,7 +1652,7 @@ sub git_blob_plain {\n \topen my $fd, \"-|\", $GIT, \"cat-file\", \"blob\", $hash\n \t\tor die_error(\"Couldn't cat $file_name, $hash\");\n \n-\t$type ||= git_blob_plain_mimetype($fd, $file_name);\n+\t$type ||= blob_plain_mimetype($fd, $file_name);\n \n \t# save as filename, even when no $file_name is given\n \tmy $save_as = \"$hash\";\n@@ -1672,7 +1674,7 @@ sub git_blob_plain {\n sub git_blob {\n \tif (!defined $hash) {\n \t\tif (defined $file_name) {\n-\t\t\tmy $base = $hash_base || git_read_head($project);\n+\t\t\tmy $base = $hash_base || git_get_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 $file_name\");\n \t\t} else {\n@@ -1682,14 +1684,14 @@ sub git_blob {\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-\tmy $mimetype = git_blob_plain_mimetype($fd, $file_name);\n+\tmy $mimetype = blob_plain_mimetype($fd, $file_name);\n \tif ($mimetype !~ m/^text\\//) {\n \t\tclose $fd;\n \t\treturn git_blob_plain($mimetype);\n \t}\n \tgit_header_html();\n \tmy $formats_nav = '';\n-\tif (defined $hash_base && (my %co = git_read_commit($hash_base))) {\n+\tif (defined $hash_base && (my %co = parse_commit($hash_base))) {\n \t\tif (defined $file_name) {\n \t\t\tif ($have_blame) {\n \t\t\t\t$formats_nav .= $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blame;h=$hash;hb=$hash_base;f=$file_name\")}, \"blame\") . \" | \";\n@@ -1700,8 +1702,8 @@ sub git_blob {\n \t\t} else {\n \t\t\t$formats_nav .= $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob_plain;h=$hash\")}, \"plain\");\n \t\t}\n-\t\tgit_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);\n-\t\tgit_header_div('commit', esc_html($co{'title'}), $hash_base);\n+\t\tgit_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);\n+\t\tgit_print_header_div('commit', esc_html($co{'title'}), $hash_base);\n \t} else {\n \t\tprint \"<div class=\\\"page_nav\\\">\\n\" .\n \t\t      \"<br/><br/></div>\\n\" .\n@@ -1728,7 +1730,7 @@ sub git_blob {\n \n sub git_tree {\n \tif (!defined $hash) {\n-\t\t$hash = git_read_head($project);\n+\t\t$hash = git_get_head($project);\n \t\tif (defined $file_name) {\n \t\t\tmy $base = $hash_base || $hash;\n \t\t\t$hash = git_get_hash_by_path($base, $file_name, \"tree\");\n@@ -1744,15 +1746,15 @@ sub git_tree {\n \tclose $fd or die_error(undef, \"Reading tree failed.\");\n \t$/ = \"\\n\";\n \n-\tmy $refs = read_info_ref();\n-\tmy $ref = git_get_referencing($refs, $hash_base);\n+\tmy $refs = git_read_info_refs();\n+\tmy $ref = format_mark_referencing($refs, $hash_base);\n \tgit_header_html();\n \tmy $base_key = \"\";\n \tmy $base = \"\";\n-\tif (defined $hash_base && (my %co = git_read_commit($hash_base))) {\n+\tif (defined $hash_base && (my %co = parse_commit($hash_base))) {\n \t\t$base_key = \";hb=$hash_base\";\n-\t\tgit_page_nav('tree','', $hash_base);\n-\t\tgit_header_div('commit', esc_html($co{'title'}) . $ref, $hash_base);\n+\t\tgit_print_page_nav('tree','', $hash_base);\n+\t\tgit_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash_base);\n \t} else {\n \t\tprint \"<div class=\\\"page_nav\\\">\\n\";\n \t\tprint \"<br/><br/></div>\\n\";\n@@ -1806,14 +1808,14 @@ #\t\t\t      \" | \" . $cgi->a({-href => \"$my\n }\n \n sub git_log {\n-\tmy $head = git_read_head($project);\n+\tmy $head = git_get_head($project);\n \tif (!defined $hash) {\n \t\t$hash = $head;\n \t}\n \tif (!defined $page) {\n \t\t$page = 0;\n \t}\n-\tmy $refs = read_info_ref();\n+\tmy $refs = git_read_info_refs();\n \n \tmy $limit = sprintf(\"--max-count=%i\", (100 * ($page+1)));\n \topen my $fd, \"-|\", $GIT, \"rev-list\", $limit, $hash\n@@ -1824,24 +1826,24 @@ sub git_log {\n \tmy $paging_nav = git_get_paging_nav('log', $hash, $head, $page, $#revlist);\n \n \tgit_header_html();\n-\tgit_page_nav('log','', $hash,undef,undef, $paging_nav);\n+\tgit_print_page_nav('log','', $hash,undef,undef, $paging_nav);\n \n \tif (!@revlist) {\n-\t\tmy %co = git_read_commit($hash);\n+\t\tmy %co = parse_commit($hash);\n \n-\t\tgit_header_div('summary', $project);\n+\t\tgit_print_header_div('summary', $project);\n \t\tprint \"<div class=\\\"page_body\\\"> Last change $co{'age_string'}.<br/><br/></div>\\n\";\n \t}\n \tfor (my $i = ($page * 100); $i <= $#revlist; $i++) {\n \t\tmy $commit = $revlist[$i];\n-\t\tmy $ref = git_get_referencing($refs, $commit);\n-\t\tmy %co = git_read_commit($commit);\n+\t\tmy $ref = format_mark_referencing($refs, $commit);\n+\t\tmy %co = parse_commit($commit);\n \t\tnext if !%co;\n-\t\tmy %ad = date_str($co{'author_epoch'});\n-\t\tgit_header_div('commit',\n-\t\t\t\t\t\t\t\t\t \"<span class=\\\"age\\\">$co{'age_string'}</span>\" .\n-\t\t\t\t\t\t\t\t\t esc_html($co{'title'}) . $ref,\n-\t\t\t\t\t\t\t\t\t $commit);\n+\t\tmy %ad = parse_date($co{'author_epoch'});\n+\t\tgit_print_header_div('commit',\n+\t\t                     \"<span class=\\\"age\\\">$co{'age_string'}</span>\" .\n+\t\t                     esc_html($co{'title'}) . $ref,\n+\t\t                     $commit);\n \t\tprint \"<div class=\\\"title_text\\\">\\n\" .\n \t\t      \"<div class=\\\"log_link\\\">\\n\" .\n \t\t      $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=commit;h=$commit\")}, \"commit\") .\n@@ -1876,12 +1878,12 @@ sub git_log {\n }\n \n sub git_commit {\n-\tmy %co = git_read_commit($hash);\n+\tmy %co = parse_commit($hash);\n \tif (!%co) {\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+\tmy %ad = parse_date($co{'author_epoch'}, $co{'author_tz'});\n+\tmy %cd = parse_date($co{'committer_epoch'}, $co{'committer_tz'});\n \n \tmy $parent = $co{'parent'};\n \tif (!defined $parent) {\n@@ -1897,22 +1899,22 @@ sub git_commit {\n \tif ($hash =~ m/^[0-9a-fA-F]{40}$/) {\n \t\t$expires = \"+1d\";\n \t}\n-\tmy $refs = read_info_ref();\n-\tmy $ref = git_get_referencing($refs, $co{'id'});\n+\tmy $refs = git_read_info_refs();\n+\tmy $ref = format_mark_referencing($refs, $co{'id'});\n \tmy $formats_nav = '';\n \tif (defined $file_name && defined $co{'parent'}) {\n \t\tmy $parent = $co{'parent'};\n \t\t$formats_nav .= $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blame;hb=$parent;f=$file_name\")}, \"blame\");\n \t}\n \tgit_header_html(undef, $expires);\n-\tgit_page_nav('commit', defined $co{'parent'} ? '' : 'commitdiff',\n-\t\t\t\t\t\t\t $hash, $co{'tree'}, $hash,\n-\t\t\t\t\t\t\t $formats_nav);\n+\tgit_print_page_nav('commit', defined $co{'parent'} ? '' : 'commitdiff',\n+\t                   $hash, $co{'tree'}, $hash,\n+\t                   $formats_nav);\n \n \tif (defined $co{'parent'}) {\n-\t\tgit_header_div('commitdiff', esc_html($co{'title'}) . $ref, $hash);\n+\t\tgit_print_header_div('commitdiff', esc_html($co{'title'}) . $ref, $hash);\n \t} else {\n-\t\tgit_header_div('tree', esc_html($co{'title'}) . $ref, $co{'tree'}, $hash);\n+\t\tgit_print_header_div('tree', esc_html($co{'title'}) . $ref, $co{'tree'}, $hash);\n \t}\n \tprint \"<div class=\\\"title_text\\\">\\n\" .\n \t      \"<table cellspacing=\\\"0\\\">\\n\";\n@@ -2074,11 +2076,11 @@ sub git_commit {\n sub git_blobdiff {\n \tmkdir($git_temp, 0700);\n \tgit_header_html();\n-\tif (defined $hash_base && (my %co = git_read_commit($hash_base))) {\n+\tif (defined $hash_base && (my %co = parse_commit($hash_base))) {\n \t\tmy $formats_nav =\n \t\t\t$cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blobdiff_plain;h=$hash;hp=$hash_parent\")}, \"plain\");\n-\t\tgit_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);\n-\t\tgit_header_div('commit', esc_html($co{'title'}), $hash_base);\n+\t\tgit_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);\n+\t\tgit_print_header_div('commit', esc_html($co{'title'}), $hash_base);\n \t} else {\n \t\tprint \"<div class=\\\"page_nav\\\">\\n\" .\n \t\t      \"<br/><br/></div>\\n\" .\n@@ -2104,7 +2106,7 @@ sub git_blobdiff_plain {\n \n sub git_commitdiff {\n \tmkdir($git_temp, 0700);\n-\tmy %co = git_read_commit($hash);\n+\tmy %co = parse_commit($hash);\n \tif (!%co) {\n \t\tdie_error(undef, \"Unknown commit object.\");\n \t}\n@@ -2121,13 +2123,13 @@ sub git_commitdiff {\n \tif ($hash =~ m/^[0-9a-fA-F]{40}$/) {\n \t\t$expires = \"+1d\";\n \t}\n-\tmy $refs = read_info_ref();\n-\tmy $ref = git_get_referencing($refs, $co{'id'});\n+\tmy $refs = git_read_info_refs();\n+\tmy $ref = format_mark_referencing($refs, $co{'id'});\n \tmy $formats_nav =\n \t\t$cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=commitdiff_plain;h=$hash;hp=$hash_parent\")}, \"plain\");\n \tgit_header_html(undef, $expires);\n-\tgit_page_nav('commitdiff','', $hash,$co{'tree'},$hash, $formats_nav);\n-\tgit_header_div('commit', esc_html($co{'title'}) . $ref, $hash);\n+\tgit_print_page_nav('commitdiff','', $hash,$co{'tree'},$hash, $formats_nav);\n+\tgit_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash);\n \tprint \"<div class=\\\"page_body\\\">\\n\";\n \tmy $comment = $co{'comment'};\n \tmy $empty = 0;\n@@ -2198,7 +2200,7 @@ sub git_commitdiff_plain {\n \n \t# try to figure out the next tag after this commit\n \tmy $tagname;\n-\tmy $refs = read_info_ref(\"tags\");\n+\tmy $refs = git_read_info_refs(\"tags\");\n \topen $fd, \"-|\", $GIT, \"rev-list\", \"HEAD\";\n \tmy @commits = map { chomp; $_ } <$fd>;\n \tclose $fd;\n@@ -2212,8 +2214,8 @@ sub git_commitdiff_plain {\n \t}\n \n \tprint $cgi->header(-type => \"text/plain\", -charset => 'utf-8', '-content-disposition' => \"inline; filename=\\\"git-$hash.patch\\\"\");\n-\tmy %co = git_read_commit($hash);\n-\tmy %ad = date_str($co{'author_epoch'}, $co{'author_tz'});\n+\tmy %co = parse_commit($hash);\n+\tmy %ad = parse_date($co{'author_epoch'}, $co{'author_tz'});\n \tmy $comment = $co{'comment'};\n \tprint \"From: $co{'author'}\\n\" .\n \t      \"Date: $ad{'rfc2822'} ($ad{'tz_local'})\\n\".\n@@ -2247,17 +2249,17 @@ sub git_commitdiff_plain {\n \n sub git_history {\n \tif (!defined $hash_base) {\n-\t\t$hash_base = git_read_head($project);\n+\t\t$hash_base = git_get_head($project);\n \t}\n \tmy $ftype;\n-\tmy %co = git_read_commit($hash_base);\n+\tmy %co = parse_commit($hash_base);\n \tif (!%co) {\n \t\tdie_error(undef, \"Unknown commit object.\");\n \t}\n-\tmy $refs = read_info_ref();\n+\tmy $refs = git_read_info_refs();\n \tgit_header_html();\n-\tgit_page_nav('','', $hash_base,$co{'tree'},$hash_base);\n-\tgit_header_div('commit', esc_html($co{'title'}), $hash_base);\n+\tgit_print_page_nav('','', $hash_base,$co{'tree'},$hash_base);\n+\tgit_print_header_div('commit', esc_html($co{'title'}), $hash_base);\n \tif (!defined $hash && defined $file_name) {\n \t\t$hash = git_get_hash_by_path($hash_base, $file_name);\n \t}\n@@ -2273,11 +2275,11 @@ sub git_history {\n \twhile (my $line = <$fd>) {\n \t\tif ($line =~ m/^([0-9a-fA-F]{40})/){\n \t\t\tmy $commit = $1;\n-\t\t\tmy %co = git_read_commit($commit);\n+\t\t\tmy %co = parse_commit($commit);\n \t\t\tif (!%co) {\n \t\t\t\tnext;\n \t\t\t}\n-\t\t\tmy $ref = git_get_referencing($refs, $commit);\n+\t\t\tmy $ref = format_mark_referencing($refs, $commit);\n \t\t\tif ($alternate) {\n \t\t\t\tprint \"<tr class=\\\"dark\\\">\\n\";\n \t\t\t} else {\n@@ -2313,9 +2315,9 @@ sub git_search {\n \t\tdie_error(\"\", \"Text field empty.\");\n \t}\n \tif (!defined $hash) {\n-\t\t$hash = git_read_head($project);\n+\t\t$hash = git_get_head($project);\n \t}\n-\tmy %co = git_read_commit($hash);\n+\tmy %co = parse_commit($hash);\n \tif (!%co) {\n \t\tdie_error(undef, \"Unknown commit object.\");\n \t}\n@@ -2334,8 +2336,8 @@ sub git_search {\n \t\t$pickaxe_search = 1;\n \t}\n \tgit_header_html();\n-\tgit_page_nav('','', $hash,$co{'tree'},$hash);\n-\tgit_header_div('commit', esc_html($co{'title'}), $hash);\n+\tgit_print_page_nav('','', $hash,$co{'tree'},$hash);\n+\tgit_print_header_div('commit', esc_html($co{'title'}), $hash);\n \n \tprint \"<table cellspacing=\\\"0\\\">\\n\";\n \tmy $alternate = 0;\n@@ -2353,7 +2355,7 @@ sub git_search {\n \t\t\t\tnext;\n \t\t\t}\n \t\t\tmy @commit_lines = split \"\\n\", $commit_text;\n-\t\t\tmy %co = git_read_commit(undef, \\@commit_lines);\n+\t\t\tmy %co = parse_commit(undef, \\@commit_lines);\n \t\t\tif (!%co) {\n \t\t\t\tnext;\n \t\t\t}\n@@ -2434,7 +2436,7 @@ sub git_search {\n \t\t\t\t\tprint \"</td>\\n\" .\n \t\t\t\t\t      \"</tr>\\n\";\n \t\t\t\t}\n-\t\t\t\t%co = git_read_commit($1);\n+\t\t\t\t%co = parse_commit($1);\n \t\t\t}\n \t\t}\n \t\tclose $fd;\n@@ -2444,14 +2446,14 @@ sub git_search {\n }\n \n sub git_shortlog {\n-\tmy $head = git_read_head($project);\n+\tmy $head = git_get_head($project);\n \tif (!defined $hash) {\n \t\t$hash = $head;\n \t}\n \tif (!defined $page) {\n \t\t$page = 0;\n \t}\n-\tmy $refs = read_info_ref();\n+\tmy $refs = git_read_info_refs();\n \n \tmy $limit = sprintf(\"--max-count=%i\", (100 * ($page+1)));\n \topen my $fd, \"-|\", $GIT, \"rev-list\", $limit, $hash\n@@ -2469,8 +2471,8 @@ sub git_shortlog {\n \n \n \tgit_header_html();\n-\tgit_page_nav('shortlog','', $hash,$hash,$hash, $paging_nav);\n-\tgit_header_div('summary', $project);\n+\tgit_print_page_nav('shortlog','', $hash,$hash,$hash, $paging_nav);\n+\tgit_print_header_div('summary', $project);\n \n \tgit_shortlog_body(\\@revlist, ($page * 100), $#revlist, $refs, $next_link);\n \n@@ -2482,7 +2484,7 @@ ## feeds (RSS, OPML)\n \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+\topen my $fd, \"-|\", $GIT, \"rev-list\", \"--max-count=150\", git_get_head($project)\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 git-rev-list failed.\");\n@@ -2497,12 +2499,12 @@ sub git_rss {\n \n \tfor (my $i = 0; $i <= $#revlist; $i++) {\n \t\tmy $commit = $revlist[$i];\n-\t\tmy %co = git_read_commit($commit);\n+\t\tmy %co = parse_commit($commit);\n \t\t# we read 150, we always show 30 and the ones more recent than 48 hours\n \t\tif (($i >= 20) && ((time - $co{'committer_epoch'}) > 48*60*60)) {\n \t\t\tlast;\n \t\t}\n-\t\tmy %cd = date_str($co{'committer_epoch'});\n+\t\tmy %cd = parse_date($co{'committer_epoch'});\n \t\topen $fd, \"-|\", $GIT, \"diff-tree\", '-r', $co{'parent'}, $co{'id'} or next;\n \t\tmy @difftree = map { chomp; $_ } <$fd>;\n \t\tclose $fd or next;\n@@ -2552,12 +2554,12 @@ sub git_opml {\n \n \tforeach my $pr (@list) {\n \t\tmy %proj = %$pr;\n-\t\tmy $head = git_read_head($proj{'path'});\n+\t\tmy $head = git_get_head($proj{'path'});\n \t\tif (!defined $head) {\n \t\t\tnext;\n \t\t}\n \t\t$ENV{'GIT_DIR'} = \"$projectroot/$proj{'path'}\";\n-\t\tmy %co = git_read_commit($head);\n+\t\tmy %co = parse_commit($head);\n \t\tif (!%co) {\n \t\t\tnext;\n \t\t}\n-- \n1.4.1.1\n"},{"id":"24771","messageId":"200608050040.36877.jnareb@gmail.com","threadId":"5138","inReplyTo":"200608050036.06490.jnareb@gmail.com","subject":"[PATCH 3/5] gitweb: Separate ref parsing in git_read_refs into parse_ref","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-04T22:40:36Z","receivedAt":"2006-08-04T22:40:36Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nPure coding style patch.\n\n gitweb/gitweb.perl |   80 +++++++++++++++++++++++++++++-----------------------\n 1 files changed, 45 insertions(+), 35 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex d440546..5b30654 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -677,6 +677,49 @@ sub parse_commit {\n \treturn %co;\n }\n \n+# parse ref from ref_file, given by ref_id, with given type\n+sub parse_ref {\n+\tmy $ref_file = shift;\n+\tmy $ref_id = shift;\n+\tmy $type = shift || git_get_type($ref_id);\n+\tmy %ref_item;\n+\n+\t$ref_item{'type'} = $type;\n+\t$ref_item{'id'} = $ref_id;\n+\t$ref_item{'epoch'} = 0;\n+\t$ref_item{'age'} = \"unknown\";\n+\tif ($type eq \"tag\") {\n+\t\tmy %tag = parse_tag($ref_id);\n+\t\t$ref_item{'comment'} = $tag{'comment'};\n+\t\tif ($tag{'type'} eq \"commit\") {\n+\t\t\tmy %co = parse_commit($tag{'object'});\n+\t\t\t$ref_item{'epoch'} = $co{'committer_epoch'};\n+\t\t\t$ref_item{'age'} = $co{'age_string'};\n+\t\t} elsif (defined($tag{'epoch'})) {\n+\t\t\tmy $age = time - $tag{'epoch'};\n+\t\t\t$ref_item{'epoch'} = $tag{'epoch'};\n+\t\t\t$ref_item{'age'} = age_string($age);\n+\t\t}\n+\t\t$ref_item{'reftype'} = $tag{'type'};\n+\t\t$ref_item{'name'} = $tag{'name'};\n+\t\t$ref_item{'refid'} = $tag{'object'};\n+\t} elsif ($type eq \"commit\"){\n+\t\tmy %co = parse_commit($ref_id);\n+\t\t$ref_item{'reftype'} = \"commit\";\n+\t\t$ref_item{'name'} = $ref_file;\n+\t\t$ref_item{'title'} = $co{'title'};\n+\t\t$ref_item{'refid'} = $ref_id;\n+\t\t$ref_item{'epoch'} = $co{'committer_epoch'};\n+\t\t$ref_item{'age'} = $co{'age_string'};\n+\t} else {\n+\t\t$ref_item{'reftype'} = $type;\n+\t\t$ref_item{'name'} = $ref_file;\n+\t\t$ref_item{'refid'} = $ref_id;\n+\t}\n+\n+\treturn %ref_item;\n+}\n+\n ## ......................................................................\n ## parse to array of hashes functions\n \n@@ -696,44 +739,11 @@ sub git_read_refs {\n \tforeach my $ref_file (@refs) {\n \t\tmy $ref_id = git_read_hash(\"$project/$ref_dir/$ref_file\");\n \t\tmy $type = git_get_type($ref_id) || next;\n-\t\tmy %ref_item;\n-\t\tmy %co;\n-\t\t$ref_item{'type'} = $type;\n-\t\t$ref_item{'id'} = $ref_id;\n-\t\t$ref_item{'epoch'} = 0;\n-\t\t$ref_item{'age'} = \"unknown\";\n-\t\tif ($type eq \"tag\") {\n-\t\t\tmy %tag = parse_tag($ref_id);\n-\t\t\t$ref_item{'comment'} = $tag{'comment'};\n-\t\t\tif ($tag{'type'} eq \"commit\") {\n-\t\t\t\t%co = parse_commit($tag{'object'});\n-\t\t\t\t$ref_item{'epoch'} = $co{'committer_epoch'};\n-\t\t\t\t$ref_item{'age'} = $co{'age_string'};\n-\t\t\t} elsif (defined($tag{'epoch'})) {\n-\t\t\t\tmy $age = time - $tag{'epoch'};\n-\t\t\t\t$ref_item{'epoch'} = $tag{'epoch'};\n-\t\t\t\t$ref_item{'age'} = age_string($age);\n-\t\t\t}\n-\t\t\t$ref_item{'reftype'} = $tag{'type'};\n-\t\t\t$ref_item{'name'} = $tag{'name'};\n-\t\t\t$ref_item{'refid'} = $tag{'object'};\n-\t\t} elsif ($type eq \"commit\"){\n-\t\t\t%co = parse_commit($ref_id);\n-\t\t\t$ref_item{'reftype'} = \"commit\";\n-\t\t\t$ref_item{'name'} = $ref_file;\n-\t\t\t$ref_item{'title'} = $co{'title'};\n-\t\t\t$ref_item{'refid'} = $ref_id;\n-\t\t\t$ref_item{'epoch'} = $co{'committer_epoch'};\n-\t\t\t$ref_item{'age'} = $co{'age_string'};\n-\t\t} else {\n-\t\t\t$ref_item{'reftype'} = $type;\n-\t\t\t$ref_item{'name'} = $ref_file;\n-\t\t\t$ref_item{'refid'} = $ref_id;\n-\t\t}\n+\t\tmy %ref_item = parse_ref($ref_file, $ref_id, $type);\n \n \t\tpush @reflist, \\%ref_item;\n \t}\n-\t# sort tags by age\n+\t# sort refs by age\n \t@reflist = sort {$b->{'epoch'} <=> $a->{'epoch'}} @reflist;\n \treturn \\@reflist;\n }\n-- \n1.4.1.1\n"},{"id":"24770","messageId":"200608050042.30470.jnareb@gmail.com","threadId":"5138","inReplyTo":"200608050036.06490.jnareb@gmail.com","subject":"[PATCH 4/5] gitweb: git_heads cleanup","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-04T22:42:30Z","receivedAt":"2006-08-04T22:42:30Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nLeftover from refactor generation of shortlog, tags and heads body.\n\n gitweb/gitweb.perl |    1 -\n 1 files changed, 0 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 5b30654..9e4822b 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1641,7 +1641,6 @@ sub git_heads {\n \tgit_print_header_div('summary', $project);\n \n \tmy $taglist = git_read_refs(\"refs/heads\");\n-\tmy $alternate = 0;\n \tif (defined @$taglist) {\n \t\tgit_heads_body($taglist, $head);\n \t}\n-- \n1.4.1.1\n"},{"id":"24773","messageId":"200608050043.18420.jnareb@gmail.com","threadId":"5138","inReplyTo":"200608050036.06490.jnareb@gmail.com","subject":"[PATCH 5/5] gitweb: Change appereance of marker of refs pointing to given object","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-04T22:43:18Z","receivedAt":"2006-08-04T22:43:18Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Change default value of $type in git_read_info_refs to correctly show\nfull name of ref (and not only last part) if $type was not set.\n\nRefs are now in separate span elements.  Class was changed from \"tag\"\nto \"ref\", as ref can be head, not only tag.  Currently there is no way\nto distinguish between tags and heads.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.css  |    2 +-\n gitweb/gitweb.perl |   12 ++++++++----\n 2 files changed, 9 insertions(+), 5 deletions(-)\n\ndiff --git a/gitweb/gitweb.css b/gitweb/gitweb.css\nindex 460e728..921b339 100644\n--- a/gitweb/gitweb.css\n+++ b/gitweb/gitweb.css\n@@ -317,7 +317,7 @@ a.rss_logo:hover {\n \tbackground-color: #ee5500;\n }\n \n-span.tag {\n+span.ref {\n \tpadding: 0px 4px;\n \tfont-size: 10px;\n \tfont-weight: normal;\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 9e4822b..e983452 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -350,9 +350,13 @@ sub format_mark_referencing {\n \tmy ($refs, $id) = @_;\n \n \tif (defined $refs->{$id}) {\n-\t\treturn ' <span class=\"tag\">' . esc_html($refs->{$id}) . '</span>';\n+\t\tmy $markers = '';\n+\t\tforeach my $ref (split /:/, $refs->{$id}) {\n+\t\t\t$markers .= ' <span class=\"ref\">' . esc_html($ref) . '</span>';\n+\t\t}\n+\t\treturn $markers;\n \t} else {\n-\t\treturn \"\";\n+\t\treturn '';\n \t}\n }\n \n@@ -496,7 +500,7 @@ sub git_read_projects {\n }\n \n sub git_read_info_refs {\n-\tmy $type = shift || \"\";\n+\tmy $type = shift || \"(?:heads|tags)\";\n \tmy %refs;\n \t# 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c\trefs/tags/v2.6.11\n \t# c39ae07f393806ccf406ef966e9a15afc43cc36a\trefs/tags/v2.6.11^{}\n@@ -507,7 +511,7 @@ sub git_read_info_refs {\n \t\t# e.g. from 'refs/heads/jn/gitweb' it would leave only 'gitweb'\n \t\tif ($line =~ m/^([0-9a-fA-F]{40})\\t.*$type\\/([^\\^]+)/) {\n \t\t\tif (defined $refs{$1}) {\n-\t\t\t\t$refs{$1} .= \" / $2\";\n+\t\t\t\t$refs{$1} .= ':' . $2;\n \t\t\t} else {\n \t\t\t\t$refs{$1} = $2;\n \t\t\t}\n-- \n1.4.1.1\n"},{"id":"24776","messageId":"20060804235414.66496.qmail@web31801.mail.mud.yahoo.com","threadId":"5138","inReplyTo":"200608050038.20534.jnareb@gmail.com","subject":"Re: [PATCH 1/5] gitweb: Cleanup input validation and error messages","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-08-04T23:54:14Z","receivedAt":"2006-08-04T23:54:14Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Jakub Narebski <jnareb@gmail.com> wrote:\n> Clean up input validation, including removing $rss_link variable and\n> making error messages more explicit.  Expand and uniquify other error\n> messages.\n\nCan you fix your patch then?\n\nError messages in general do not end with a period.\n\n    Luben\n\n\n> \n> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n> ---\n> This probably conflicts \"[PATCH 4/4] gitweb: No periods for error messages\".\n> It uses periods for error messages which does not end in with some \n> value of some variable.\n> \n>  gitweb/gitweb.perl |   88 ++++++++++++++++++++++++----------------------------\n>  1 files changed, 40 insertions(+), 48 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 58eb5b1..dfc2d09 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -71,13 +71,15 @@ if (! -d $git_temp) {\n>  \tmkdir($git_temp, 0700) || die_error(\"Couldn't mkdir $git_temp\");\n>  }\n>  \n> +\n> +# ======================================================================\n>  # input validation and dispatch\n>  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 $action\");\n>  \t}\n> +\t# action which does not check rest of parameters\n>  \tif ($action eq \"opml\") {\n>  \t\tgit_opml();\n>  \t\texit;\n> @@ -85,22 +87,17 @@ if (defined $action) {\n>  }\n>  \n>  our $project = ($cgi->param('p') || $ENV{'PATH_INFO'});\n> -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> +$project =~ s|^/||; $project =~ s|/$||;\n> +if (defined $project || $project) {\n> +\tif (!validate_input($project)) {\n> +\t\tdie_error(undef, \"Invalid project parameter $project\");\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 $project\");\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 $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>  \t$ENV{'GIT_DIR'} = \"$projectroot/$project\";\n>  } else {\n>  \tgit_project_list();\n> @@ -109,49 +106,43 @@ if (defined $project) {\n>  \n>  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> +\tif (!validate_input($file_name)) {\n> +\t\tdie_error(undef, \"Invalid file parameter $file_name\");\n>  \t}\n>  }\n>  \n>  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> +\tif (!validate_input($hash)) {\n> +\t\tdie_error(undef, \"Invalid hash parameter $hash\");\n>  \t}\n>  }\n>  \n>  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> +\tif (!validate_input($hash_parent)) {\n> +\t\tdie_error(undef, \"Invalid hash parent parameter $hash_parent\");\n>  \t}\n>  }\n>  \n>  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> +\tif (!validate_input($hash_base)) {\n> +\t\tdie_error(undef, \"Invalid hash base parameter $hash_base\");\n>  \t}\n>  }\n>  \n>  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 $page\");\n>  \t}\n>  }\n>  \n>  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 $searchtext\");\n>  \t}\n>  \t$searchtext = quotemeta $searchtext;\n>  }\n> @@ -180,8 +171,7 @@ my %actions = (\n>  \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 $action\");\n>  }\n>  $actions{$action}->();\n>  exit;\n> @@ -871,11 +861,13 @@ sub git_header_html {\n>  <meta name=\"robots\" content=\"index, nofollow\"/>\n>  <title>$title</title>\n>  <link rel=\"stylesheet\" type=\"text/css\" href=\"$stylesheet\"/>\n> -$rss_link\n> -</head>\n> -<body>\n>  EOF\n> -\tprint \"<div class=\\\"page_header\\\">\\n\" .\n> +\tprint \"<link rel=\\\"alternate\\\" title=\\\"\" . esc_param($project) . \" log\\\" href=\\\"\" .\n> +\t      \"$my_uri?\" . esc_param(\"p=$project;a=rss\") . \"\\\" type=\\\"application/rss+xml\\\"/>\\n\" .\n> +\t      \"</head>\\n\";\n> +\n> +\tprint \"<body>\\n\" .\n> +\t      \"<div class=\\\"page_header\\\">\\n\" .\n>  \t      \"<a href=\\\"http://www.kernel.org/pub/software/scm/git/docs/\\\" title=\\\"git\n> documentation\\\">\" .\n>  \t      \"<img src=\\\"$logo\\\" width=\\\"72\\\" height=\\\"27\\\" alt=\\\"git\\\" style=\\\"float:right;\n> border-width:0px;\\\"/>\" .\n>  \t      \"</a>\\n\";\n> @@ -1471,18 +1463,18 @@ 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('404 Not Found', \"File name not defined\") if (!$file_name);\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> +\tdie_error(undef, \"Couldn't find base commit.\") 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 looking up file\");\n> +\t\t\tor die_error(undef, \"Error looking up file $file_name\");\n>  \t}\n>  \t$ftype = git_get_type($hash);\n>  \tif ($ftype !~ \"blob\") {\n> -\t\tdie_error(\"400 Bad Request\", \"object is not a blob\");\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> @@ -1529,14 +1521,14 @@ sub git_blame2 {\n>  sub git_blame {\n>  \tmy $fd;\n>  \tdie_error('403 Permission denied', \"Permission denied.\") if (!git_get_project_config_bool\n> ('blame'));\n> -\tdie_error('404 Not Found', \"What file will it be, master?\") if (!$file_name);\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> +\tdie_error(undef, \"Couldn't find base commit.\") unless ($hash_base);\n>  \tmy %co = git_read_commit($hash_base)\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 $file_name\");\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> @@ -1649,7 +1641,7 @@ 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 $file_name\");\n>  \t\t} else {\n>  \t\t\tdie_error(undef, \"No file name defined.\");\n>  \t\t}\n> @@ -1682,7 +1674,7 @@ 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 $file_name\");\n>  \t\t} else {\n>  \t\t\tdie_error(undef, \"No file name defined.\");\n>  \t\t}\n> @@ -2122,7 +2114,7 @@ sub git_commitdiff {\n>  \topen my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\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 git-diff-tree failed.\");\n>  \n>  \t# non-textual hash id's can be cached\n>  \tmy $expires;\n> @@ -2202,7 +2194,7 @@ sub git_commitdiff_plain {\n>  \topen my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\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 git-diff-tree failed.\");\n>  \n>  \t# try to figure out the next tag after this commit\n>  \tmy $tagname;\n> @@ -2493,7 +2485,7 @@ sub git_rss {\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>  \tmy @revlist = map { chomp; $_ } <$fd>;\n> -\tclose $fd or die_error(undef, \"Reading rev-list failed.\");\n> +\tclose $fd or die_error(undef, \"Reading git-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> -- \n> 1.4.1.1\n> \n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n"},{"id":"24777","messageId":"20060804235450.33762.qmail@web31804.mail.mud.yahoo.com","threadId":"5138","inReplyTo":"200608050038.20534.jnareb@gmail.com","subject":"Re: [PATCH 1/5] gitweb: Cleanup input validation and error messages","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-08-04T23:54:50Z","receivedAt":"2006-08-04T23:54:50Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Jakub Narebski <jnareb@gmail.com> wrote:\n> Clean up input validation, including removing $rss_link variable and\n> making error messages more explicit.  Expand and uniquify other error\n> messages.\n> \n> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n> ---\n> This probably conflicts \"[PATCH 4/4] gitweb: No periods for error messages\".\n> It uses periods for error messages which does not end in with some \n> value of some variable.\n\nCan you fix your patch then?\nError messages in general do not end with a period.\n\n    Luben\n\n> \n>  gitweb/gitweb.perl |   88 ++++++++++++++++++++++++----------------------------\n>  1 files changed, 40 insertions(+), 48 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 58eb5b1..dfc2d09 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -71,13 +71,15 @@ if (! -d $git_temp) {\n>  \tmkdir($git_temp, 0700) || die_error(\"Couldn't mkdir $git_temp\");\n>  }\n>  \n> +\n> +# ======================================================================\n>  # input validation and dispatch\n>  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 $action\");\n>  \t}\n> +\t# action which does not check rest of parameters\n>  \tif ($action eq \"opml\") {\n>  \t\tgit_opml();\n>  \t\texit;\n> @@ -85,22 +87,17 @@ if (defined $action) {\n>  }\n>  \n>  our $project = ($cgi->param('p') || $ENV{'PATH_INFO'});\n> -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> +$project =~ s|^/||; $project =~ s|/$||;\n> +if (defined $project || $project) {\n> +\tif (!validate_input($project)) {\n> +\t\tdie_error(undef, \"Invalid project parameter $project\");\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 $project\");\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 $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>  \t$ENV{'GIT_DIR'} = \"$projectroot/$project\";\n>  } else {\n>  \tgit_project_list();\n> @@ -109,49 +106,43 @@ if (defined $project) {\n>  \n>  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> +\tif (!validate_input($file_name)) {\n> +\t\tdie_error(undef, \"Invalid file parameter $file_name\");\n>  \t}\n>  }\n>  \n>  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> +\tif (!validate_input($hash)) {\n> +\t\tdie_error(undef, \"Invalid hash parameter $hash\");\n>  \t}\n>  }\n>  \n>  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> +\tif (!validate_input($hash_parent)) {\n> +\t\tdie_error(undef, \"Invalid hash parent parameter $hash_parent\");\n>  \t}\n>  }\n>  \n>  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> +\tif (!validate_input($hash_base)) {\n> +\t\tdie_error(undef, \"Invalid hash base parameter $hash_base\");\n>  \t}\n>  }\n>  \n>  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 $page\");\n>  \t}\n>  }\n>  \n>  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 $searchtext\");\n>  \t}\n>  \t$searchtext = quotemeta $searchtext;\n>  }\n> @@ -180,8 +171,7 @@ my %actions = (\n>  \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 $action\");\n>  }\n>  $actions{$action}->();\n>  exit;\n> @@ -871,11 +861,13 @@ sub git_header_html {\n>  <meta name=\"robots\" content=\"index, nofollow\"/>\n>  <title>$title</title>\n>  <link rel=\"stylesheet\" type=\"text/css\" href=\"$stylesheet\"/>\n> -$rss_link\n> -</head>\n> -<body>\n>  EOF\n> -\tprint \"<div class=\\\"page_header\\\">\\n\" .\n> +\tprint \"<link rel=\\\"alternate\\\" title=\\\"\" . esc_param($project) . \" log\\\" href=\\\"\" .\n> +\t      \"$my_uri?\" . esc_param(\"p=$project;a=rss\") . \"\\\" type=\\\"application/rss+xml\\\"/>\\n\" .\n> +\t      \"</head>\\n\";\n> +\n> +\tprint \"<body>\\n\" .\n> +\t      \"<div class=\\\"page_header\\\">\\n\" .\n>  \t      \"<a href=\\\"http://www.kernel.org/pub/software/scm/git/docs/\\\" title=\\\"git\n> documentation\\\">\" .\n>  \t      \"<img src=\\\"$logo\\\" width=\\\"72\\\" height=\\\"27\\\" alt=\\\"git\\\" style=\\\"float:right;\n> border-width:0px;\\\"/>\" .\n>  \t      \"</a>\\n\";\n> @@ -1471,18 +1463,18 @@ 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('404 Not Found', \"File name not defined\") if (!$file_name);\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> +\tdie_error(undef, \"Couldn't find base commit.\") 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 looking up file\");\n> +\t\t\tor die_error(undef, \"Error looking up file $file_name\");\n>  \t}\n>  \t$ftype = git_get_type($hash);\n>  \tif ($ftype !~ \"blob\") {\n> -\t\tdie_error(\"400 Bad Request\", \"object is not a blob\");\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> @@ -1529,14 +1521,14 @@ sub git_blame2 {\n>  sub git_blame {\n>  \tmy $fd;\n>  \tdie_error('403 Permission denied', \"Permission denied.\") if (!git_get_project_config_bool\n> ('blame'));\n> -\tdie_error('404 Not Found', \"What file will it be, master?\") if (!$file_name);\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> +\tdie_error(undef, \"Couldn't find base commit.\") unless ($hash_base);\n>  \tmy %co = git_read_commit($hash_base)\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 $file_name\");\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> @@ -1649,7 +1641,7 @@ 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 $file_name\");\n>  \t\t} else {\n>  \t\t\tdie_error(undef, \"No file name defined.\");\n>  \t\t}\n> @@ -1682,7 +1674,7 @@ 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 $file_name\");\n>  \t\t} else {\n>  \t\t\tdie_error(undef, \"No file name defined.\");\n>  \t\t}\n> @@ -2122,7 +2114,7 @@ sub git_commitdiff {\n>  \topen my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\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 git-diff-tree failed.\");\n>  \n>  \t# non-textual hash id's can be cached\n>  \tmy $expires;\n> @@ -2202,7 +2194,7 @@ sub git_commitdiff_plain {\n>  \topen my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\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 git-diff-tree failed.\");\n>  \n>  \t# try to figure out the next tag after this commit\n>  \tmy $tagname;\n> @@ -2493,7 +2485,7 @@ sub git_rss {\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>  \tmy @revlist = map { chomp; $_ } <$fd>;\n> -\tclose $fd or die_error(undef, \"Reading rev-list failed.\");\n> +\tclose $fd or die_error(undef, \"Reading git-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> -- \n> 1.4.1.1\n> \n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n"},{"id":"24780","messageId":"eb0n5g$p72$1@sea.gmane.org","threadId":"5138","inReplyTo":"20060804235414.66496.qmail@web31801.mail.mud.yahoo.com","subject":"[PATCH 6/5] gitweb: No periods for error messages","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T00:02:34Z","receivedAt":"2006-08-05T00:02:34Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nLuben Tuikov wrote:\n> --- Jakub Narebski <jnareb@gmail.com> wrote:\n> > Clean up input validation, including removing $rss_link variable and\n> > making error messages more explicit.  Expand and uniquify other error\n> > messages.\n> \n> Can you fix your patch then?\n> \n> Error messages in general do not end with a period.\n\nHere you have the patch, on top of series.\n\n gitweb/gitweb.perl |   66 ++++++++++++++++++++++++++--------------------------\n 1 files changed, 33 insertions(+), 33 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex e983452..4316bd0 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -420,7 +420,7 @@ sub git_get_hash_by_path {\n        my $tree = $base;\n \n        open my $fd, \"-|\", $GIT, \"ls-tree\", $base, \"--\", $path\n-               or die_error(undef, \"Open git-ls-tree failed.\");\n+               or die_error(undef, \"Open git-ls-tree failed\");\n        my $line = <$fd>;\n        close $fd or return undef;\n \n@@ -1282,13 +1282,13 @@ ## actions\n sub git_project_list {\n        my $order = $cgi->param('o');\n        if (defined $order && $order !~ m/project|descr|owner|age/) {\n-               die_error(undef, \"Invalid order parameter '$order'.\");\n+               die_error(undef, \"Invalid order parameter $order\");\n        }\n \n        my @list = git_read_projects();\n        my @projects;\n        if (!@list) {\n-               die_error(undef, \"No projects found.\");\n+               die_error(undef, \"No projects found\");\n        }\n        foreach my $pr (@list) {\n                my $head = git_get_head($pr->{'path'});\n@@ -1422,7 +1422,7 @@ sub git_summary {\n              \"</table>\\n\";\n \n        open my $fd, \"-|\", $GIT, \"rev-list\", \"--max-count=17\", git_get_head($project)\n-               or die_error(undef, \"Open git-rev-list failed.\");\n+               or die_error(undef, \"Open git-rev-list failed\");\n        my @revlist = map { chomp; $_ } <$fd>;\n        close $fd;\n        git_print_header_div('shortlog');\n@@ -1478,22 +1478,22 @@ sub git_tag {\n sub git_blame2 {\n        my $fd;\n        my $ftype;\n-       die_error(undef, \"Permission denied.\") if (!git_get_project_config_bool ('blame'));\n+       die_error(undef, \"Permission denied\") if (!git_get_project_config_bool ('blame'));\n        die_error('404 Not Found', \"File name not defined.\") if (!$file_name);\n        $hash_base ||= git_get_head($project);\n-       die_error(undef, \"Couldn't find base commit.\") unless ($hash_base);\n+       die_error(undef, \"Couldn't find base commit\") unless ($hash_base);\n        my %co = parse_commit($hash_base)\n-               or die_error(undef, \"Reading commit failed.\");\n+               or die_error(undef, \"Reading commit failed\");\n        if (!defined $hash) {\n                $hash = git_get_hash_by_path($hash_base, $file_name, \"blob\")\n                        or die_error(undef, \"Error looking up file $file_name\");\n        }\n        $ftype = git_get_type($hash);\n        if ($ftype !~ \"blob\") {\n-               die_error(\"400 Bad Request\", \"Object is not a blob.\");\n+               die_error(\"400 Bad Request\", \"Object is not a blob\");\n        }\n        open ($fd, \"-|\", $GIT, \"blame\", '-l', $file_name, $hash_base)\n-               or die_error(undef, \"Open git-blame failed.\");\n+               or die_error(undef, \"Open git-blame failed\");\n        git_header_html();\n        my $formats_nav =\n                $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name\")}, \"blob\") .\n@@ -1536,18 +1536,18 @@ sub git_blame2 {\n \n sub git_blame {\n        my $fd;\n-       die_error('403 Permission denied', \"Permission denied.\") if (!git_get_project_config_bool ('blame'));\n-       die_error('404 Not Found', \"File name not defined.\") if (!$file_name);\n+       die_error('403 Permission denied', \"Permission denied\") if (!git_get_project_config_bool ('blame'));\n+       die_error('404 Not Found', \"File name not defined\") if (!$file_name);\n        $hash_base ||= git_get_head($project);\n        die_error(undef, \"Couldn't find base commit.\") unless ($hash_base);\n        my %co = parse_commit($hash_base)\n-               or die_error(undef, \"Reading commit failed.\");\n+               or die_error(undef, \"Reading commit failed\");\n        if (!defined $hash) {\n                $hash = git_get_hash_by_path($hash_base, $file_name, \"blob\")\n                        or die_error(undef, \"Error lookup file $file_name\");\n        }\n        open ($fd, \"-|\", $GIT, \"annotate\", '-l', '-t', '-r', $file_name, $hash_base)\n-               or die_error(undef, \"Open git-annotate failed.\");\n+               or die_error(undef, \"Open git-annotate failed\");\n        git_header_html();\n        my $formats_nav =\n                $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name\")}, \"blob\") .\n@@ -1658,7 +1658,7 @@ sub git_blob_plain {\n                        $hash = git_get_hash_by_path($base, $file_name, \"blob\")\n                                or die_error(undef, \"Error lookup file $file_name\");\n                } else {\n-                       die_error(undef, \"No file name defined.\");\n+                       die_error(undef, \"No file name defined\");\n                }\n        }\n        my $type = shift;\n@@ -1691,12 +1691,12 @@ sub git_blob {\n                        $hash = git_get_hash_by_path($base, $file_name, \"blob\")\n                                or die_error(undef, \"Error lookup file $file_name\");\n                } else {\n-                       die_error(undef, \"No file name defined.\");\n+                       die_error(undef, \"No file name defined\");\n                }\n        }\n        my $have_blame = git_get_project_config_bool ('blame');\n        open my $fd, \"-|\", $GIT, \"cat-file\", \"blob\", $hash\n-               or die_error(undef, \"Couldn't cat $file_name, $hash.\");\n+               or die_error(undef, \"Couldn't cat $file_name, $hash\");\n        my $mimetype = blob_plain_mimetype($fd, $file_name);\n        if ($mimetype !~ m/^text\\//) {\n                close $fd;\n@@ -1754,9 +1754,9 @@ sub git_tree {\n        }\n        $/ = \"\\0\";\n        open my $fd, \"-|\", $GIT, \"ls-tree\", '-z', $hash\n-               or die_error(undef, \"Open git-ls-tree failed.\");\n+               or die_error(undef, \"Open git-ls-tree failed\");\n        my @entries = map { chomp; $_ } <$fd>;\n-       close $fd or die_error(undef, \"Reading tree failed.\");\n+       close $fd or die_error(undef, \"Reading tree failed\");\n        $/ = \"\\n\";\n \n        my $refs = git_read_info_refs();\n@@ -1832,7 +1832,7 @@ sub git_log {\n \n        my $limit = sprintf(\"--max-count=%i\", (100 * ($page+1)));\n        open my $fd, \"-|\", $GIT, \"rev-list\", $limit, $hash\n-               or die_error(undef, \"Open git-rev-list failed.\");\n+               or die_error(undef, \"Open git-rev-list failed\");\n        my @revlist = map { chomp; $_ } <$fd>;\n        close $fd;\n \n@@ -1893,7 +1893,7 @@ sub git_log {\n sub git_commit {\n        my %co = parse_commit($hash);\n        if (!%co) {\n-               die_error(undef, \"Unknown commit object.\");\n+               die_error(undef, \"Unknown commit object\");\n        }\n        my %ad = parse_date($co{'author_epoch'}, $co{'author_tz'});\n        my %cd = parse_date($co{'committer_epoch'}, $co{'committer_tz'});\n@@ -1903,9 +1903,9 @@ sub git_commit {\n                $parent = \"--root\";\n        }\n        open my $fd, \"-|\", $GIT, \"diff-tree\", '-r', '-M', $parent, $hash\n-               or die_error(undef, \"Open git-diff-tree failed.\");\n+               or die_error(undef, \"Open git-diff-tree failed\");\n        my @difftree = map { chomp; $_ } <$fd>;\n-       close $fd or die_error(undef, \"Reading git-diff-tree failed.\");\n+       close $fd or die_error(undef, \"Reading git-diff-tree failed\");\n \n        # non-textual hash id's can be cached\n        my $expires;\n@@ -2121,15 +2121,15 @@ sub git_commitdiff {\n        mkdir($git_temp, 0700);\n        my %co = parse_commit($hash);\n        if (!%co) {\n-               die_error(undef, \"Unknown commit object.\");\n+               die_error(undef, \"Unknown commit object\");\n        }\n        if (!defined $hash_parent) {\n                $hash_parent = $co{'parent'};\n        }\n        open my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\n-               or die_error(undef, \"Open git-diff-tree failed.\");\n+               or die_error(undef, \"Open git-diff-tree failed\");\n        my @difftree = map { chomp; $_ } <$fd>;\n-       close $fd or die_error(undef, \"Reading git-diff-tree failed.\");\n+       close $fd or die_error(undef, \"Reading git-diff-tree failed\");\n \n        # non-textual hash id's can be cached\n        my $expires;\n@@ -2207,9 +2207,9 @@ sub git_commitdiff {\n sub git_commitdiff_plain {\n        mkdir($git_temp, 0700);\n        open my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\n-               or die_error(undef, \"Open git-diff-tree failed.\");\n+               or die_error(undef, \"Open git-diff-tree failed\");\n        my @difftree = map { chomp; $_ } <$fd>;\n-       close $fd or die_error(undef, \"Reading git-diff-tree failed.\");\n+       close $fd or die_error(undef, \"Reading git-diff-tree failed\");\n \n        # try to figure out the next tag after this commit\n        my $tagname;\n@@ -2267,7 +2267,7 @@ sub git_history {\n        my $ftype;\n        my %co = parse_commit($hash_base);\n        if (!%co) {\n-               die_error(undef, \"Unknown commit object.\");\n+               die_error(undef, \"Unknown commit object\");\n        }\n        my $refs = git_read_info_refs();\n        git_header_html();\n@@ -2325,14 +2325,14 @@ sub git_history {\n \n sub git_search {\n        if (!defined $searchtext) {\n-               die_error(\"\", \"Text field empty.\");\n+               die_error(undef, \"Text field empty\");\n        }\n        if (!defined $hash) {\n                $hash = git_get_head($project);\n        }\n        my %co = parse_commit($hash);\n        if (!%co) {\n-               die_error(undef, \"Unknown commit object.\");\n+               die_error(undef, \"Unknown commit object\");\n        }\n        # pickaxe may take all resources of your box and run for several minutes\n        # with every query - so decide by yourself how public you make this feature :)\n@@ -2470,7 +2470,7 @@ sub git_shortlog {\n \n        my $limit = sprintf(\"--max-count=%i\", (100 * ($page+1)));\n        open my $fd, \"-|\", $GIT, \"rev-list\", $limit, $hash\n-               or die_error(undef, \"Open git-rev-list failed.\");\n+               or die_error(undef, \"Open git-rev-list failed\");\n        my @revlist = map { chomp; $_ } <$fd>;\n        close $fd;\n \n@@ -2498,9 +2498,9 @@ ## feeds (RSS, OPML)\n sub git_rss {\n        # http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ\n        open my $fd, \"-|\", $GIT, \"rev-list\", \"--max-count=150\", git_get_head($project)\n-               or die_error(undef, \"Open git-rev-list failed.\");\n+               or die_error(undef, \"Open git-rev-list failed\");\n        my @revlist = map { chomp; $_ } <$fd>;\n-       close $fd or die_error(undef, \"Reading git-rev-list failed.\");\n+       close $fd or die_error(undef, \"Reading git-rev-list failed\");\n        print $cgi->header(-type => 'text/xml', -charset => 'utf-8');\n        print \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\".\n              \"<rss version=\\\"2.0\\\" xmlns:content=\\\"http://purl.org/rss/1.0/modules/content/\\\">\\n\";\n-- \n1.4.1.1\n"},{"id":"24781","messageId":"7vu04sghr0.fsf@assigned-by-dhcp.cox.net","threadId":"5138","inReplyTo":"200608050038.20534.jnareb@gmail.com","subject":"Re: [PATCH 1/5] gitweb: Cleanup input validation and error messages","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-05T00:15:31Z","receivedAt":"2006-08-05T00:15:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n>  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 $action\");\n>  \t}\n\nDoesn't this make us parrot what the browser threw at us without\nescaping back for HTML (iow, die_error does not seem to escape\n$error)?\n\n>  our $project = ($cgi->param('p') || $ENV{'PATH_INFO'});\n> -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> +$project =~ s|^/||; $project =~ s|/$||;\n\nUnrelated change but it is probably safe.\n\n> +if (defined $project || $project) {\n> +\tif (!validate_input($project)) {\n> +\t\tdie_error(undef, \"Invalid project parameter $project\");\n>  \t}\n\nBecause undef is not true, \"|| $project\" here does not make much\nsense to me.  Even if you meant to say \"&&\" to exclude empty\nstring or \"0\", wouldn't validate_input() take care of them?\nSame input parrotting comment applies here and everywhere.\n\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\nThe reason of removal is...?  Ah, you inlined it.  It was not\nclear from the proposed commit log message.\n"},{"id":"24783","messageId":"eb0oiu$sj1$1@sea.gmane.org","threadId":"5138","inReplyTo":"7vu04sghr0.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/5] gitweb: Cleanup input validation and error messages","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T00:26:47Z","receivedAt":"2006-08-05T00:26:47Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n\n> Jakub Narebski <jnareb@gmail.com> writes:\n> \n>>  our $action = $cgi->param('a');\n>>  if (defined $action) {\n>>      if ($action =~ m/[^0-9a-zA-Z\\.\\-_]/) {\n>> -            undef $action;\n>> -            die_error(undef, \"Invalid action parameter.\");\n>> +            die_error(undef, \"Invalid action parameter $action\");\n>>      }\n> \n> Doesn't this make us parrot what the browser threw at us without\n> escaping back for HTML (iow, die_error does not seem to escape\n> $error)?\n\nI wanted to know what is the parameter gitweb considers invalid.\nPerhaps the execution wasn't the best...\n\n[...]\n>> -    $rss_link = \"<link rel=\\\"alternate\\\" title=\\\"\" . esc_param($project) . \" log\\\" href=\\\"\" .\n>> -                \"$my_uri?\" . esc_param(\"p=$project;a=rss\") . \"\\\" type=\\\"application/rss+xml\\\"/>\";\n> \n> The reason of removal is...?  Ah, you inlined it.  It was not\n> clear from the proposed commit log message.\n\nI'm sorry for unrelated changes (the commit could be probably split \ninto four).\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"24810","messageId":"44d47813.36251c31.2553.3cf7@mx.gmail.com","threadId":"5138","inReplyTo":"eb0oiu$sj1$1@sea.gmane.org","subject":"[PATCH 0/9] gitweb: First patch corrected and split into separate patches","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T10:51:41Z","receivedAt":"2006-08-05T10:51:41Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jakub Narebski wrote:\n\n> I'm sorry for unrelated changes (the commit could be probably split \n> into four).\n\nThis series splits unrelated changes into separate patches, does not add\ncontroversial adding (unescaped) value of invalid/errorneous parameter to\nerror message, and correct errors noticed during creation of this series.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"24811","messageId":"eb1tdd$6kf$1@sea.gmane.org","threadId":"5138","inReplyTo":"44d47813.36251c31.2553.3cf7@mx.gmail.com","subject":"[PATCH 1/9] gitweb: Separate input validation and dispatch, add comment about opml action","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T10:55:20Z","receivedAt":"2006-08-05T10:55:20Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 58eb5b1..8b53fe6 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -71,6 +71,7 @@ if (! -d $git_temp) {\n        mkdir($git_temp, 0700) || die_error(\"Couldn't mkdir $git_temp\");\n }\n \n+# ======================================================================\n # input validation and dispatch\n our $action = $cgi->param('a');\n if (defined $action) {\n@@ -78,6 +79,7 @@ if (defined $action) {\n                undef $action;\n                die_error(undef, \"Invalid action parameter.\");\n        }\n+       # action which does not check rest of parameters\n        if ($action eq \"opml\") {\n                git_opml();\n                exit;\n-- \n1.4.1.1\n"},{"id":"24814","messageId":"eb1tep$6kf$2@sea.gmane.org","threadId":"5138","inReplyTo":"44d47813.36251c31.2553.3cf7@mx.gmail.com","subject":"[PATCH 2/9] gitweb: die_error first (optional) parameter is HTTP status","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T10:56:04Z","receivedAt":"2006-08-05T10:56:04Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 8b53fe6..6feec28 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -68,7 +68,7 @@ our $git_version = qx($GIT --version) =~\n \n $projects_list ||= $projectroot;\n if (! -d $git_temp) {\n-       mkdir($git_temp, 0700) || die_error(\"Couldn't mkdir $git_temp\");\n+       mkdir($git_temp, 0700) || die_error(undef, \"Couldn't mkdir $git_temp\");\n }\n \n # ======================================================================\n@@ -1658,7 +1658,7 @@ sub git_blob_plain {\n        }\n        my $type = shift;\n        open my $fd, \"-|\", $GIT, \"cat-file\", \"blob\", $hash\n-               or die_error(\"Couldn't cat $file_name, $hash\");\n+               or die_error(undef, \"Couldn't cat $file_name, $hash\");\n \n        $type ||= git_blob_plain_mimetype($fd, $file_name);\n \n-- \n1.4.1.1\n"},{"id":"24813","messageId":"eb1tfv$6kf$3@sea.gmane.org","threadId":"5138","inReplyTo":"44d47813.36251c31.2553.3cf7@mx.gmail.com","subject":"[PATCH 3/9] gitweb: Use undef for die_error to use default first (status) parameter value","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T10:56:42Z","receivedAt":"2006-08-05T10:56:42Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nFor consistency.\n\n gitweb/gitweb.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 6feec28..9b9bf37 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2320,7 +2320,7 @@ sub git_history {\n \n sub git_search {\n        if (!defined $searchtext) {\n-               die_error(\"\", \"Text field empty.\");\n+               die_error(undef, \"Text field empty.\");\n        }\n        if (!defined $hash) {\n                $hash = git_read_head($project);\n-- \n1.4.1.1\n"},{"id":"24815","messageId":"eb1tij$6kf$4@sea.gmane.org","threadId":"5138","inReplyTo":"44d47813.36251c31.2553.3cf7@mx.gmail.com","subject":"[PATCH 4/9] gitweb: Don't undefine query parameter related variables before die_error","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T10:58:06Z","receivedAt":"2006-08-05T10:58:06Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nIt would allow to include value of invalid parameter in error message\n\n gitweb/gitweb.perl |   21 +++++----------------\n 1 files changed, 5 insertions(+), 16 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 9b9bf37..6f3f465 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -76,7 +76,6 @@ # input validation and dispatch\n our $action = $cgi->param('a');\n if (defined $action) {\n        if ($action =~ m/[^0-9a-zA-Z\\.\\-_]/) {\n-               undef $action;\n                die_error(undef, \"Invalid action parameter.\");\n        }\n        # action which does not check rest of parameters\n@@ -89,16 +88,13 @@ if (defined $action) {\n our $project = ($cgi->param('p') || $ENV{'PATH_INFO'});\n if (defined $project) {\n        $project =~ s|^/||; $project =~ s|/$||;\n-       $project = validate_input($project);\n-       if (!defined($project)) {\n+       if (!validate_input($project)) {\n                die_error(undef, \"Invalid project parameter.\");\n        }\n        if (!(-d \"$projectroot/$project\")) {\n-               undef $project;\n                die_error(undef, \"No such directory.\");\n        }\n        if (!(-e \"$projectroot/$project/HEAD\")) {\n-               undef $project;\n                die_error(undef, \"No such project.\");\n        }\n        $rss_link = \"<link rel=\\\"alternate\\\" title=\\\"\" . esc_param($project) . \" log\\\" href=\\\"\" .\n@@ -111,32 +107,28 @@ if (defined $project) {\n \n our $file_name = $cgi->param('f');\n if (defined $file_name) {\n-       $file_name = validate_input($file_name);\n-       if (!defined($file_name)) {\n+       if (!validate_input($file_name)) {\n                die_error(undef, \"Invalid file parameter.\");\n        }\n }\n \n our $hash = $cgi->param('h');\n if (defined $hash) {\n-       $hash = validate_input($hash);\n-       if (!defined($hash)) {\n+       if (!validate_input($hash)) {\n                die_error(undef, \"Invalid hash parameter.\");\n        }\n }\n \n our $hash_parent = $cgi->param('hp');\n if (defined $hash_parent) {\n-       $hash_parent = validate_input($hash_parent);\n-       if (!defined($hash_parent)) {\n+       if (!validate_input($hash_parent)) {\n                die_error(undef, \"Invalid hash parent parameter.\");\n        }\n }\n \n our $hash_base = $cgi->param('hb');\n if (defined $hash_base) {\n-       $hash_base = validate_input($hash_base);\n-       if (!defined($hash_base)) {\n+       if (!validate_input($hash_base)) {\n                die_error(undef, \"Invalid hash base parameter.\");\n        }\n }\n@@ -144,7 +136,6 @@ if (defined $hash_base) {\n our $page = $cgi->param('pg');\n if (defined $page) {\n        if ($page =~ m/[^0-9]$/) {\n-               undef $page;\n                die_error(undef, \"Invalid page parameter.\");\n        }\n }\n@@ -152,7 +143,6 @@ if (defined $page) {\n our $searchtext = $cgi->param('s');\n if (defined $searchtext) {\n        if ($searchtext =~ m/[^a-zA-Z0-9_\\.\\/\\-\\+\\:\\@ ]/) {\n-               undef $searchtext;\n                die_error(undef, \"Invalid search parameter.\");\n        }\n        $searchtext = quotemeta $searchtext;\n@@ -182,7 +172,6 @@ my %actions = (\n \n $action = 'summary' if (!defined($action));\n if (!defined($actions{$action})) {\n-       undef $action;\n        die_error(undef, \"Unknown action.\");\n }\n $actions{$action}->();\n-- \n1.4.1.1\n"},{"id":"24816","messageId":"eb1ue8$8ti$1@sea.gmane.org","threadId":"5138","inReplyTo":"44d47813.36251c31.2553.3cf7@mx.gmail.com","subject":"[PATCH 5/9] gitweb: Cleanup and uniquify error messages","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T11:12:51Z","receivedAt":"2006-08-05T11:12:51Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |   12 ++++++------\n 1 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 6f3f465..8773a8d 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1464,7 +1464,7 @@ sub git_blame2 {\n        die_error(undef, \"Permission denied.\") if (!git_get_project_config_bool ('blame'));\n        die_error('404 Not Found', \"File name not defined\") if (!$file_name);\n        $hash_base ||= git_read_head($project);\n-       die_error(undef, \"Reading commit failed\") unless ($hash_base);\n+       die_error(undef, \"Couldn't find base commit.\") unless ($hash_base);\n        my %co = git_read_commit($hash_base)\n                or die_error(undef, \"Reading commit failed\");\n        if (!defined $hash) {\n@@ -1473,7 +1473,7 @@ sub git_blame2 {\n        }\n        $ftype = git_get_type($hash);\n        if ($ftype !~ \"blob\") {\n-               die_error(\"400 Bad Request\", \"object is not a blob\");\n+               die_error(\"400 Bad Request\", \"Object is not a blob\");\n        }\n        open ($fd, \"-|\", $GIT, \"blame\", '-l', $file_name, $hash_base)\n                or die_error(undef, \"Open git-blame failed.\");\n@@ -1520,9 +1520,9 @@ sub git_blame2 {\n sub git_blame {\n        my $fd;\n        die_error('403 Permission denied', \"Permission denied.\") if (!git_get_project_config_bool ('blame'));\n-       die_error('404 Not Found', \"What file will it be, master?\") if (!$file_name);\n+       die_error('404 Not Found', \"File name not defined.\") if (!$file_name);\n        $hash_base ||= git_read_head($project);\n-       die_error(undef, \"Reading commit failed.\") unless ($hash_base);\n+       die_error(undef, \"Couldn't find base commit.\") unless ($hash_base);\n        my %co = git_read_commit($hash_base)\n                or die_error(undef, \"Reading commit failed.\");\n        if (!defined $hash) {\n@@ -2113,7 +2113,7 @@ sub git_commitdiff {\n        open my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\n                or die_error(undef, \"Open git-diff-tree failed.\");\n        my @difftree = map { chomp; $_ } <$fd>;\n-       close $fd or die_error(undef, \"Reading diff-tree failed.\");\n+       close $fd or die_error(undef, \"Reading git-diff-tree failed.\");\n \n        # non-textual hash id's can be cached\n        my $expires;\n@@ -2484,7 +2484,7 @@ sub git_rss {\n        open my $fd, \"-|\", $GIT, \"rev-list\", \"--max-count=150\", git_read_head($project)\n                or die_error(undef, \"Open git-rev-list failed.\");\n        my @revlist = map { chomp; $_ } <$fd>;\n-       close $fd or die_error(undef, \"Reading rev-list failed.\");\n+       close $fd or die_error(undef, \"Reading git-rev-list failed.\");\n        print $cgi->header(-type => 'text/xml', -charset => 'utf-8');\n        print \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\".\n              \"<rss version=\\\"2.0\\\" xmlns:content=\\\"http://purl.org/rss/1.0/modules/content/\\\">\\n\";\n-- \n1.4.1.1\n"},{"id":"24823","messageId":"eb1ug6$8ti$2@sea.gmane.org","threadId":"5138","inReplyTo":"44d47813.36251c31.2553.3cf7@mx.gmail.com","subject":"[PATCH 6/9] gitweb: No periods for error messages","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T11:13:53Z","receivedAt":"2006-08-05T11:13:53Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nLike in Luben Tuikov patch\n\n gitweb/gitweb.perl |   92 ++++++++++++++++++++++++++--------------------------\n 1 files changed, 46 insertions(+), 46 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 8773a8d..d8ba016 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -76,7 +76,7 @@ # input validation and dispatch\n our $action = $cgi->param('a');\n if (defined $action) {\n        if ($action =~ m/[^0-9a-zA-Z\\.\\-_]/) {\n-               die_error(undef, \"Invalid action parameter.\");\n+               die_error(undef, \"Invalid action parameter\");\n        }\n        # action which does not check rest of parameters\n        if ($action eq \"opml\") {\n@@ -89,13 +89,13 @@ our $project = ($cgi->param('p') || $ENV\n if (defined $project) {\n        $project =~ s|^/||; $project =~ s|/$||;\n        if (!validate_input($project)) {\n-               die_error(undef, \"Invalid project parameter.\");\n+               die_error(undef, \"Invalid project parameter\");\n        }\n        if (!(-d \"$projectroot/$project\")) {\n-               die_error(undef, \"No such directory.\");\n+               die_error(undef, \"No such directory\");\n        }\n        if (!(-e \"$projectroot/$project/HEAD\")) {\n-               die_error(undef, \"No such project.\");\n+               die_error(undef, \"No such project\");\n        }\n        $rss_link = \"<link rel=\\\"alternate\\\" title=\\\"\" . esc_param($project) . \" log\\\" href=\\\"\" .\n                    \"$my_uri?\" . esc_param(\"p=$project;a=rss\") . \"\\\" type=\\\"application/rss+xml\\\"/>\";\n@@ -108,42 +108,42 @@ if (defined $project) {\n our $file_name = $cgi->param('f');\n if (defined $file_name) {\n        if (!validate_input($file_name)) {\n-               die_error(undef, \"Invalid file parameter.\");\n+               die_error(undef, \"Invalid file parameter\");\n        }\n }\n \n our $hash = $cgi->param('h');\n if (defined $hash) {\n        if (!validate_input($hash)) {\n-               die_error(undef, \"Invalid hash parameter.\");\n+               die_error(undef, \"Invalid hash parameter\");\n        }\n }\n \n our $hash_parent = $cgi->param('hp');\n if (defined $hash_parent) {\n        if (!validate_input($hash_parent)) {\n-               die_error(undef, \"Invalid hash parent parameter.\");\n+               die_error(undef, \"Invalid hash parent parameter\");\n        }\n }\n \n our $hash_base = $cgi->param('hb');\n if (defined $hash_base) {\n        if (!validate_input($hash_base)) {\n-               die_error(undef, \"Invalid hash base parameter.\");\n+               die_error(undef, \"Invalid hash base parameter\");\n        }\n }\n \n our $page = $cgi->param('pg');\n if (defined $page) {\n        if ($page =~ m/[^0-9]$/) {\n-               die_error(undef, \"Invalid page parameter.\");\n+               die_error(undef, \"Invalid page parameter\");\n        }\n }\n \n our $searchtext = $cgi->param('s');\n if (defined $searchtext) {\n        if ($searchtext =~ m/[^a-zA-Z0-9_\\.\\/\\-\\+\\:\\@ ]/) {\n-               die_error(undef, \"Invalid search parameter.\");\n+               die_error(undef, \"Invalid search parameter\");\n        }\n        $searchtext = quotemeta $searchtext;\n }\n@@ -172,7 +172,7 @@ my %actions = (\n \n $action = 'summary' if (!defined($action));\n if (!defined($actions{$action})) {\n-       die_error(undef, \"Unknown action.\");\n+       die_error(undef, \"Unknown action\");\n }\n $actions{$action}->();\n exit;\n@@ -418,7 +418,7 @@ sub git_get_hash_by_path {\n        my $tree = $base;\n \n        open my $fd, \"-|\", $GIT, \"ls-tree\", $base, \"--\", $path\n-               or die_error(undef, \"Open git-ls-tree failed.\");\n+               or die_error(undef, \"Open git-ls-tree failed\");\n        my $line = <$fd>;\n        close $fd or return undef;\n \n@@ -1265,13 +1265,13 @@ ## actions\n sub git_project_list {\n        my $order = $cgi->param('o');\n        if (defined $order && $order !~ m/project|descr|owner|age/) {\n-               die_error(undef, \"Invalid order parameter '$order'.\");\n+               die_error(undef, \"Invalid order parameter '$order'\");\n        }\n \n        my @list = git_read_projects();\n        my @projects;\n        if (!@list) {\n-               die_error(undef, \"No projects found.\");\n+               die_error(undef, \"No projects found\");\n        }\n        foreach my $pr (@list) {\n                my $head = git_read_head($pr->{'path'});\n@@ -1405,7 +1405,7 @@ sub git_summary {\n              \"</table>\\n\";\n \n        open my $fd, \"-|\", $GIT, \"rev-list\", \"--max-count=17\", git_read_head($project)\n-               or die_error(undef, \"Open git-rev-list failed.\");\n+               or die_error(undef, \"Open git-rev-list failed\");\n        my @revlist = map { chomp; $_ } <$fd>;\n        close $fd;\n        git_header_div('shortlog');\n@@ -1461,10 +1461,10 @@ sub git_tag {\n sub git_blame2 {\n        my $fd;\n        my $ftype;\n-       die_error(undef, \"Permission denied.\") if (!git_get_project_config_bool ('blame'));\n+       die_error(undef, \"Permission denied\") if (!git_get_project_config_bool ('blame'));\n        die_error('404 Not Found', \"File name not defined\") if (!$file_name);\n        $hash_base ||= git_read_head($project);\n-       die_error(undef, \"Couldn't find base commit.\") unless ($hash_base);\n+       die_error(undef, \"Couldn't find base commit\") unless ($hash_base);\n        my %co = git_read_commit($hash_base)\n                or die_error(undef, \"Reading commit failed\");\n        if (!defined $hash) {\n@@ -1476,7 +1476,7 @@ sub git_blame2 {\n                die_error(\"400 Bad Request\", \"Object is not a blob\");\n        }\n        open ($fd, \"-|\", $GIT, \"blame\", '-l', $file_name, $hash_base)\n-               or die_error(undef, \"Open git-blame failed.\");\n+               or die_error(undef, \"Open git-blame failed\");\n        git_header_html();\n        my $formats_nav =\n                $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name\")}, \"blob\") .\n@@ -1519,18 +1519,18 @@ sub git_blame2 {\n \n sub git_blame {\n        my $fd;\n-       die_error('403 Permission denied', \"Permission denied.\") if (!git_get_project_config_bool ('blame'));\n-       die_error('404 Not Found', \"File name not defined.\") if (!$file_name);\n+       die_error('403 Permission denied', \"Permission denied\") if (!git_get_project_config_bool ('blame'));\n+       die_error('404 Not Found', \"File name not defined\") if (!$file_name);\n        $hash_base ||= git_read_head($project);\n-       die_error(undef, \"Couldn't find base commit.\") unless ($hash_base);\n+       die_error(undef, \"Couldn't find base commit\") unless ($hash_base);\n        my %co = git_read_commit($hash_base)\n-               or die_error(undef, \"Reading commit failed.\");\n+               or die_error(undef, \"Reading commit failed\");\n        if (!defined $hash) {\n                $hash = git_get_hash_by_path($hash_base, $file_name, \"blob\")\n-                       or die_error(undef, \"Error lookup file.\");\n+                       or die_error(undef, \"Error lookup file\");\n        }\n        open ($fd, \"-|\", $GIT, \"annotate\", '-l', '-t', '-r', $file_name, $hash_base)\n-               or die_error(undef, \"Open git-annotate failed.\");\n+               or die_error(undef, \"Open git-annotate failed\");\n        git_header_html();\n        my $formats_nav =\n                $cgi->a({-href => \"$my_uri?\" . esc_param(\"p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name\")}, \"blob\") .\n@@ -1640,9 +1640,9 @@ sub git_blob_plain {\n                if (defined $file_name) {\n                        my $base = $hash_base || git_read_head($project);\n                        $hash = git_get_hash_by_path($base, $file_name, \"blob\")\n-                               or die_error(undef, \"Error lookup file.\");\n+                               or die_error(undef, \"Error lookup file\");\n                } else {\n-                       die_error(undef, \"No file name defined.\");\n+                       die_error(undef, \"No file name defined\");\n                }\n        }\n        my $type = shift;\n@@ -1673,14 +1673,14 @@ sub git_blob {\n                if (defined $file_name) {\n                        my $base = $hash_base || git_read_head($project);\n                        $hash = git_get_hash_by_path($base, $file_name, \"blob\")\n-                               or die_error(undef, \"Error lookup file.\");\n+                               or die_error(undef, \"Error lookup file\");\n                } else {\n-                       die_error(undef, \"No file name defined.\");\n+                       die_error(undef, \"No file name defined\");\n                }\n        }\n        my $have_blame = git_get_project_config_bool ('blame');\n        open my $fd, \"-|\", $GIT, \"cat-file\", \"blob\", $hash\n-               or die_error(undef, \"Couldn't cat $file_name, $hash.\");\n+               or die_error(undef, \"Couldn't cat $file_name, $hash\");\n        my $mimetype = git_blob_plain_mimetype($fd, $file_name);\n        if ($mimetype !~ m/^text\\//) {\n                close $fd;\n@@ -1738,9 +1738,9 @@ sub git_tree {\n        }\n        $/ = \"\\0\";\n        open my $fd, \"-|\", $GIT, \"ls-tree\", '-z', $hash\n-               or die_error(undef, \"Open git-ls-tree failed.\");\n+               or die_error(undef, \"Open git-ls-tree failed\");\n        my @entries = map { chomp; $_ } <$fd>;\n-       close $fd or die_error(undef, \"Reading tree failed.\");\n+       close $fd or die_error(undef, \"Reading tree failed\");\n        $/ = \"\\n\";\n \n        my $refs = read_info_ref();\n@@ -1816,7 +1816,7 @@ sub git_log {\n \n        my $limit = sprintf(\"--max-count=%i\", (100 * ($page+1)));\n        open my $fd, \"-|\", $GIT, \"rev-list\", $limit, $hash\n-               or die_error(undef, \"Open git-rev-list failed.\");\n+               or die_error(undef, \"Open git-rev-list failed\");\n        my @revlist = map { chomp; $_ } <$fd>;\n        close $fd;\n \n@@ -1877,7 +1877,7 @@ sub git_log {\n sub git_commit {\n        my %co = git_read_commit($hash);\n        if (!%co) {\n-               die_error(undef, \"Unknown commit object.\");\n+               die_error(undef, \"Unknown commit object\");\n        }\n        my %ad = date_str($co{'author_epoch'}, $co{'author_tz'});\n        my %cd = date_str($co{'committer_epoch'}, $co{'committer_tz'});\n@@ -1887,9 +1887,9 @@ sub git_commit {\n                $parent = \"--root\";\n        }\n        open my $fd, \"-|\", $GIT, \"diff-tree\", '-r', '-M', $parent, $hash\n-               or die_error(undef, \"Open git-diff-tree failed.\");\n+               or die_error(undef, \"Open git-diff-tree failed\");\n        my @difftree = map { chomp; $_ } <$fd>;\n-       close $fd or die_error(undef, \"Reading git-diff-tree failed.\");\n+       close $fd or die_error(undef, \"Reading git-diff-tree failed\");\n \n        # non-textual hash id's can be cached\n        my $expires;\n@@ -2105,15 +2105,15 @@ sub git_commitdiff {\n        mkdir($git_temp, 0700);\n        my %co = git_read_commit($hash);\n        if (!%co) {\n-               die_error(undef, \"Unknown commit object.\");\n+               die_error(undef, \"Unknown commit object\");\n        }\n        if (!defined $hash_parent) {\n                $hash_parent = $co{'parent'};\n        }\n        open my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\n-               or die_error(undef, \"Open git-diff-tree failed.\");\n+               or die_error(undef, \"Open git-diff-tree failed\");\n        my @difftree = map { chomp; $_ } <$fd>;\n-       close $fd or die_error(undef, \"Reading git-diff-tree failed.\");\n+       close $fd or die_error(undef, \"Reading git-diff-tree failed\");\n \n        # non-textual hash id's can be cached\n        my $expires;\n@@ -2191,9 +2191,9 @@ sub git_commitdiff {\n sub git_commitdiff_plain {\n        mkdir($git_temp, 0700);\n        open my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\n-               or die_error(undef, \"Open git-diff-tree failed.\");\n+               or die_error(undef, \"Open git-diff-tree failed\");\n        my @difftree = map { chomp; $_ } <$fd>;\n-       close $fd or die_error(undef, \"Reading diff-tree failed.\");\n+       close $fd or die_error(undef, \"Reading diff-tree failed\");\n \n        # try to figure out the next tag after this commit\n        my $tagname;\n@@ -2251,7 +2251,7 @@ sub git_history {\n        my $ftype;\n        my %co = git_read_commit($hash_base);\n        if (!%co) {\n-               die_error(undef, \"Unknown commit object.\");\n+               die_error(undef, \"Unknown commit object\");\n        }\n        my $refs = read_info_ref();\n        git_header_html();\n@@ -2309,14 +2309,14 @@ sub git_history {\n \n sub git_search {\n        if (!defined $searchtext) {\n-               die_error(undef, \"Text field empty.\");\n+               die_error(undef, \"Text field empty\");\n        }\n        if (!defined $hash) {\n                $hash = git_read_head($project);\n        }\n        my %co = git_read_commit($hash);\n        if (!%co) {\n-               die_error(undef, \"Unknown commit object.\");\n+               die_error(undef, \"Unknown commit object\");\n        }\n        # pickaxe may take all resources of your box and run for several minutes\n        # with every query - so decide by yourself how public you make this feature :)\n@@ -2454,7 +2454,7 @@ sub git_shortlog {\n \n        my $limit = sprintf(\"--max-count=%i\", (100 * ($page+1)));\n        open my $fd, \"-|\", $GIT, \"rev-list\", $limit, $hash\n-               or die_error(undef, \"Open git-rev-list failed.\");\n+               or die_error(undef, \"Open git-rev-list failed\");\n        my @revlist = map { chomp; $_ } <$fd>;\n        close $fd;\n \n@@ -2482,9 +2482,9 @@ ## feeds (RSS, OPML)\n sub git_rss {\n        # http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ\n        open my $fd, \"-|\", $GIT, \"rev-list\", \"--max-count=150\", git_read_head($project)\n-               or die_error(undef, \"Open git-rev-list failed.\");\n+               or die_error(undef, \"Open git-rev-list failed\");\n        my @revlist = map { chomp; $_ } <$fd>;\n-       close $fd or die_error(undef, \"Reading git-rev-list failed.\");\n+       close $fd or die_error(undef, \"Reading git-rev-list failed\");\n        print $cgi->header(-type => 'text/xml', -charset => 'utf-8');\n        print \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\".\n              \"<rss version=\\\"2.0\\\" xmlns:content=\\\"http://purl.org/rss/1.0/modules/content/\\\">\\n\";\n-- \n1.4.1.1\n"},{"id":"24820","messageId":"eb1uj0$8ti$3@sea.gmane.org","threadId":"5138","inReplyTo":"44d47813.36251c31.2553.3cf7@mx.gmail.com","subject":"[PATCH 7/9] gitweb: No error messages with unescaped/unprotected user input","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T11:15:24Z","receivedAt":"2006-08-05T11:15:24Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nProbably some error messages with unescaped user input are left...\n\n gitweb/gitweb.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex d8ba016..013bfe7 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1265,7 +1265,7 @@ ## actions\n sub git_project_list {\n        my $order = $cgi->param('o');\n        if (defined $order && $order !~ m/project|descr|owner|age/) {\n-               die_error(undef, \"Invalid order parameter '$order'\");\n+               die_error(undef, \"Unknown order parameter\");\n        }\n \n        my @list = git_read_projects();\n-- \n1.4.1.1\n"},{"id":"24824","messageId":"eb1uk7$8ti$4@sea.gmane.org","threadId":"5138","inReplyTo":"44d47813.36251c31.2553.3cf7@mx.gmail.com","subject":"[PATCH 8/9] gitweb: PATH_INFO=/ means no project","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T11:16:03Z","receivedAt":"2006-08-05T11:16:03Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Prepared for refactoring input validation.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 013bfe7..2e1a2ba 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -86,8 +86,8 @@ if (defined $action) {\n }\n \n our $project = ($cgi->param('p') || $ENV{'PATH_INFO'});\n-if (defined $project) {\n-       $project =~ s|^/||; $project =~ s|/$||;\n+$project =~ s|^/||; $project =~ s|/$||;\n+if (defined $project && $project) {\n        if (!validate_input($project)) {\n                die_error(undef, \"Invalid project parameter\");\n        }\n-- \n1.4.1.1\n"},{"id":"24817","messageId":"eb1upn$8ti$5@sea.gmane.org","threadId":"5138","inReplyTo":"44d47813.36251c31.2553.3cf7@mx.gmail.com","subject":"[PATCH 9/9] gitweb: Inline $rss_link","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T11:18:58Z","receivedAt":"2006-08-05T11:18:58Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nDoes anyone set $rss_link variable?\n\n gitweb/gitweb.perl |   13 ++++++-------\n 1 files changed, 6 insertions(+), 7 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 2e1a2ba..57f7198 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -21,7 +21,6 @@ our $cgi = new CGI;\n our $version = \"++GIT_VERSION++\";\n our $my_url = $cgi->url();\n our $my_uri = $cgi->url(-absolute => 1);\n-our $rss_link = \"\";\n \n # core git executable to use\n # this can just be \"git\" if your webserver has a sensible PATH\n@@ -97,8 +96,6 @@ if (defined $project && $project) {\n        if (!(-e \"$projectroot/$project/HEAD\")) {\n                die_error(undef, \"No such project\");\n        }\n-       $rss_link = \"<link rel=\\\"alternate\\\" title=\\\"\" . esc_param($project) . \" log\\\" href=\\\"\" .\n-                   \"$my_uri?\" . esc_param(\"p=$project;a=rss\") . \"\\\" type=\\\"application/rss+xml\\\"/>\";\n        $ENV{'GIT_DIR'} = \"$projectroot/$project\";\n } else {\n        git_project_list();\n@@ -862,11 +859,13 @@ sub git_header_html {\n <meta name=\"robots\" content=\"index, nofollow\"/>\n <title>$title</title>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"$stylesheet\"/>\n-$rss_link\n-</head>\n-<body>\n EOF\n-       print \"<div class=\\\"page_header\\\">\\n\" .\n+       print \"<link rel=\\\"alternate\\\" title=\\\"\" . esc_param($project) . \" log\\\" href=\\\"\" .\n+             \"$my_uri?\" . esc_param(\"p=$project;a=rss\") . \"\\\" type=\\\"application/rss+xml\\\"/>\\n\" .\n+             \"</head>\\n\";\n+\n+       print \"<body>\\n\" .\n+             \"<div class=\\\"page_header\\\">\\n\" .\n              \"<a href=\\\"http://www.kernel.org/pub/software/scm/git/docs/\\\" title=\\\"git documentation\\\">\" .\n              \"<img src=\\\"$logo\\\" width=\\\"72\\\" height=\\\"27\\\" alt=\\\"git\\\" style=\\\"float:right; border-width:0px;\\\"/>\" .\n              \"</a>\\n\";\n-- \n1.4.1.1\n"},{"id":"24825","messageId":"eb2068$cm7$1@sea.gmane.org","threadId":"5138","inReplyTo":"200608050036.06490.jnareb@gmail.com","subject":"[PATCH 7/5] Merge changes in \"split patch 1\" series","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T11:42:44Z","receivedAt":"2006-08-05T11:42:44Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n---\nStrange that git-format-patch does not output merges...\n\n gitweb/gitweb.perl |   44 ++++++++++++++++++++++----------------------\n 1 files changed, 22 insertions(+), 22 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 4316bd0..bf1b10f 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -67,16 +67,16 @@ our $git_version = qx($GIT --version) =~\n \n $projects_list ||= $projectroot;\n if (! -d $git_temp) {\n-       mkdir($git_temp, 0700) || die_error(\"Couldn't mkdir $git_temp\");\n+       mkdir($git_temp, 0700) || die_error(undef, \"Couldn't mkdir $git_temp\");\n }\n \n \n-# ======================================================================\n-# input validation and dispatch\n+## ======================================================================\n+## input validation and dispatch\n our $action = $cgi->param('a');\n if (defined $action) {\n        if ($action =~ m/[^0-9a-zA-Z\\.\\-_]/) {\n-               die_error(undef, \"Invalid action parameter $action\");\n+               die_error(undef, \"Invalid action parameter\");\n        }\n        # action which does not check rest of parameters\n        if ($action eq \"opml\") {\n@@ -87,15 +87,15 @@ if (defined $action) {\n \n our $project = ($cgi->param('p') || $ENV{'PATH_INFO'});\n $project =~ s|^/||; $project =~ s|/$||;\n-if (defined $project || $project) {\n+if (defined $project && $project) {\n        if (!validate_input($project)) {\n-               die_error(undef, \"Invalid project parameter $project\");\n+               die_error(undef, \"Invalid project parameter\");\n        }\n        if (!(-d \"$projectroot/$project\")) {\n-               die_error(undef, \"No such directory $project\");\n+               die_error(undef, \"No such directory\");\n        }\n        if (!(-e \"$projectroot/$project/HEAD\")) {\n-               die_error(undef, \"No such project $project\");\n+               die_error(undef, \"No such project\");\n        }\n        $ENV{'GIT_DIR'} = \"$projectroot/$project\";\n } else {\n@@ -106,42 +106,42 @@ if (defined $project || $project) {\n our $file_name = $cgi->param('f');\n if (defined $file_name) {\n        if (!validate_input($file_name)) {\n-               die_error(undef, \"Invalid file parameter $file_name\");\n+               die_error(undef, \"Invalid file parameter\");\n        }\n }\n \n our $hash = $cgi->param('h');\n if (defined $hash) {\n        if (!validate_input($hash)) {\n-               die_error(undef, \"Invalid hash parameter $hash\");\n+               die_error(undef, \"Invalid hash parameter\");\n        }\n }\n \n our $hash_parent = $cgi->param('hp');\n if (defined $hash_parent) {\n        if (!validate_input($hash_parent)) {\n-               die_error(undef, \"Invalid hash parent parameter $hash_parent\");\n+               die_error(undef, \"Invalid hash parent parameter\");\n        }\n }\n \n our $hash_base = $cgi->param('hb');\n if (defined $hash_base) {\n        if (!validate_input($hash_base)) {\n-               die_error(undef, \"Invalid hash base parameter $hash_base\");\n+               die_error(undef, \"Invalid hash base parameter\");\n        }\n }\n \n our $page = $cgi->param('pg');\n if (defined $page) {\n        if ($page =~ m/[^0-9]$/) {\n-               die_error(undef, \"Invalid page parameter $page\");\n+               die_error(undef, \"Invalid page parameter\");\n        }\n }\n \n our $searchtext = $cgi->param('s');\n if (defined $searchtext) {\n        if ($searchtext =~ m/[^a-zA-Z0-9_\\.\\/\\-\\+\\:\\@ ]/) {\n-               die_error(undef, \"Invalid search parameter $searchtext\");\n+               die_error(undef, \"Invalid search parameter\");\n        }\n        $searchtext = quotemeta $searchtext;\n }\n@@ -170,7 +170,7 @@ my %actions = (\n \n $action = 'summary' if (!defined($action));\n if (!defined($actions{$action})) {\n-       die_error(undef, \"Unknown action $action\");\n+       die_error(undef, \"Unknown action\");\n }\n $actions{$action}->();\n exit;\n@@ -1282,7 +1282,7 @@ ## actions\n sub git_project_list {\n        my $order = $cgi->param('o');\n        if (defined $order && $order !~ m/project|descr|owner|age/) {\n-               die_error(undef, \"Invalid order parameter $order\");\n+               die_error(undef, \"Unknown order parameter\");\n        }\n \n        my @list = git_read_projects();\n@@ -1479,7 +1479,7 @@ sub git_blame2 {\n        my $fd;\n        my $ftype;\n        die_error(undef, \"Permission denied\") if (!git_get_project_config_bool ('blame'));\n-       die_error('404 Not Found', \"File name not defined.\") if (!$file_name);\n+       die_error('404 Not Found', \"File name not defined\") if (!$file_name);\n        $hash_base ||= git_get_head($project);\n        die_error(undef, \"Couldn't find base commit\") unless ($hash_base);\n        my %co = parse_commit($hash_base)\n@@ -1539,12 +1539,12 @@ sub git_blame {\n        die_error('403 Permission denied', \"Permission denied\") if (!git_get_project_config_bool ('blame'));\n        die_error('404 Not Found', \"File name not defined\") if (!$file_name);\n        $hash_base ||= git_get_head($project);\n-       die_error(undef, \"Couldn't find base commit.\") unless ($hash_base);\n+       die_error(undef, \"Couldn't find base commit\") unless ($hash_base);\n        my %co = parse_commit($hash_base)\n                or die_error(undef, \"Reading commit failed\");\n        if (!defined $hash) {\n                $hash = git_get_hash_by_path($hash_base, $file_name, \"blob\")\n-                       or die_error(undef, \"Error lookup file $file_name\");\n+                       or die_error(undef, \"Error lookup file\");\n        }\n        open ($fd, \"-|\", $GIT, \"annotate\", '-l', '-t', '-r', $file_name, $hash_base)\n                or die_error(undef, \"Open git-annotate failed\");\n@@ -1656,14 +1656,14 @@ sub git_blob_plain {\n                if (defined $file_name) {\n                        my $base = $hash_base || git_get_head($project);\n                        $hash = git_get_hash_by_path($base, $file_name, \"blob\")\n-                               or die_error(undef, \"Error lookup file $file_name\");\n+                               or die_error(undef, \"Error lookup file\");\n                } else {\n                        die_error(undef, \"No file name defined\");\n                }\n        }\n        my $type = shift;\n        open my $fd, \"-|\", $GIT, \"cat-file\", \"blob\", $hash\n-               or die_error(\"Couldn't cat $file_name, $hash\");\n+               or die_error(undef, \"Couldn't cat $file_name, $hash\");\n \n        $type ||= blob_plain_mimetype($fd, $file_name);\n \n@@ -1689,7 +1689,7 @@ sub git_blob {\n                if (defined $file_name) {\n                        my $base = $hash_base || git_get_head($project);\n                        $hash = git_get_hash_by_path($base, $file_name, \"blob\")\n-                               or die_error(undef, \"Error lookup file $file_name\");\n+                               or die_error(undef, \"Error lookup file\");\n                } else {\n                        die_error(undef, \"No file name defined\");\n                }\n-- \n1.4.1.1\ngit diff --patch-with-stat\n"},{"id":"24828","messageId":"Pine.LNX.4.63.0608051654390.1800@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5138","inReplyTo":"eb2068$cm7$1@sea.gmane.org","subject":"Re: [PATCH 7/5] Merge changes in \"split patch 1\" series","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-08-05T14:55:40Z","receivedAt":"2006-08-05T14:55:40Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 5 Aug 2006, Jakub Narebski wrote:\n\n> Strange that git-format-patch does not output merges...\n\nAnd what exactly should it output? patch against commit^1 or commit^2, \netc.? Both? Combined diff?\n\nCiao,\nDscho\n"},{"id":"24829","messageId":"eb2c1o$9d9$1@sea.gmane.org","threadId":"5138","inReplyTo":"Pine.LNX.4.63.0608051654390.1800@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH 7/5] Merge changes in \"split patch 1\" series","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T15:05:09Z","receivedAt":"2006-08-05T15:05:09Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Johannes Schindelin wrote:\n \n> On Sat, 5 Aug 2006, Jakub Narebski wrote:\n> \n>> Strange that git-format-patch does not output merges...\n> \n> And what exactly should it output? patch against commit^1 or commit^2, \n> etc.? Both? Combined diff?\n\nIn my case, commit^1. But I'd be satisfied if it would warn me about missing\ncommit (the merge was topmost commit).\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"24830","messageId":"20060805155504.6832.qmail@web31807.mail.mud.yahoo.com","threadId":"5138","inReplyTo":"eb1ug6$8ti$2@sea.gmane.org","subject":"Re: [PATCH 6/9] gitweb: No periods for error messages","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-08-05T15:55:03Z","receivedAt":"2006-08-05T15:55:03Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Jakub Narebski <jnareb@gmail.com> wrote:\n\n> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n> ---\n> Like in Luben Tuikov patch\n\nGood work!\n\nI see this patch bears identical Subject line and\nis logically identical as the one I posted.\n\nMaybe you ment to include the above line above your\nSigned-off-by: line?\n\n    Luben\n\n\n> \n>  gitweb/gitweb.perl |   92 ++++++++++++++++++++++++++--------------------------\n>  1 files changed, 46 insertions(+), 46 deletions(-)\n> \n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index 8773a8d..d8ba016 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -76,7 +76,7 @@ # input validation and dispatch\n>  our $action = $cgi->param('a');\n>  if (defined $action) {\n>         if ($action =~ m/[^0-9a-zA-Z\\.\\-_]/) {\n> -               die_error(undef, \"Invalid action parameter.\");\n> +               die_error(undef, \"Invalid action parameter\");\n>         }\n>         # action which does not check rest of parameters\n>         if ($action eq \"opml\") {\n> @@ -89,13 +89,13 @@ our $project = ($cgi->param('p') || $ENV\n>  if (defined $project) {\n>         $project =~ s|^/||; $project =~ s|/$||;\n>         if (!validate_input($project)) {\n> -               die_error(undef, \"Invalid project parameter.\");\n> +               die_error(undef, \"Invalid project parameter\");\n>         }\n>         if (!(-d \"$projectroot/$project\")) {\n> -               die_error(undef, \"No such directory.\");\n> +               die_error(undef, \"No such directory\");\n>         }\n>         if (!(-e \"$projectroot/$project/HEAD\")) {\n> -               die_error(undef, \"No such project.\");\n> +               die_error(undef, \"No such project\");\n>         }\n>         $rss_link = \"<link rel=\\\"alternate\\\" title=\\\"\" . esc_param($project) . \" log\\\" href=\\\"\"\n> .\n>                     \"$my_uri?\" . esc_param(\"p=$project;a=rss\") . \"\\\"\n> type=\\\"application/rss+xml\\\"/>\";\n> @@ -108,42 +108,42 @@ if (defined $project) {\n>  our $file_name = $cgi->param('f');\n>  if (defined $file_name) {\n>         if (!validate_input($file_name)) {\n> -               die_error(undef, \"Invalid file parameter.\");\n> +               die_error(undef, \"Invalid file parameter\");\n>         }\n>  }\n>  \n>  our $hash = $cgi->param('h');\n>  if (defined $hash) {\n>         if (!validate_input($hash)) {\n> -               die_error(undef, \"Invalid hash parameter.\");\n> +               die_error(undef, \"Invalid hash parameter\");\n>         }\n>  }\n>  \n>  our $hash_parent = $cgi->param('hp');\n>  if (defined $hash_parent) {\n>         if (!validate_input($hash_parent)) {\n> -               die_error(undef, \"Invalid hash parent parameter.\");\n> +               die_error(undef, \"Invalid hash parent parameter\");\n>         }\n>  }\n>  \n>  our $hash_base = $cgi->param('hb');\n>  if (defined $hash_base) {\n>         if (!validate_input($hash_base)) {\n> -               die_error(undef, \"Invalid hash base parameter.\");\n> +               die_error(undef, \"Invalid hash base parameter\");\n>         }\n>  }\n>  \n>  our $page = $cgi->param('pg');\n>  if (defined $page) {\n>         if ($page =~ m/[^0-9]$/) {\n> -               die_error(undef, \"Invalid page parameter.\");\n> +               die_error(undef, \"Invalid page parameter\");\n>         }\n>  }\n>  \n>  our $searchtext = $cgi->param('s');\n>  if (defined $searchtext) {\n>         if ($searchtext =~ m/[^a-zA-Z0-9_\\.\\/\\-\\+\\:\\@ ]/) {\n> -               die_error(undef, \"Invalid search parameter.\");\n> +               die_error(undef, \"Invalid search parameter\");\n>         }\n>         $searchtext = quotemeta $searchtext;\n>  }\n> @@ -172,7 +172,7 @@ my %actions = (\n>  \n>  $action = 'summary' if (!defined($action));\n>  if (!defined($actions{$action})) {\n> -       die_error(undef, \"Unknown action.\");\n> +       die_error(undef, \"Unknown action\");\n>  }\n>  $actions{$action}->();\n>  exit;\n> @@ -418,7 +418,7 @@ sub git_get_hash_by_path {\n>         my $tree = $base;\n>  \n>         open my $fd, \"-|\", $GIT, \"ls-tree\", $base, \"--\", $path\n> -               or die_error(undef, \"Open git-ls-tree failed.\");\n> +               or die_error(undef, \"Open git-ls-tree failed\");\n>         my $line = <$fd>;\n>         close $fd or return undef;\n>  \n> @@ -1265,13 +1265,13 @@ ## actions\n>  sub git_project_list {\n>         my $order = $cgi->param('o');\n>         if (defined $order && $order !~ m/project|descr|owner|age/) {\n> -               die_error(undef, \"Invalid order parameter '$order'.\");\n> +               die_error(undef, \"Invalid order parameter '$order'\");\n>         }\n>  \n>         my @list = git_read_projects();\n>         my @projects;\n>         if (!@list) {\n> -               die_error(undef, \"No projects found.\");\n> +               die_error(undef, \"No projects found\");\n>         }\n>         foreach my $pr (@list) {\n>                 my $head = git_read_head($pr->{'path'});\n> @@ -1405,7 +1405,7 @@ sub git_summary {\n>               \"</table>\\n\";\n>  \n>         open my $fd, \"-|\", $GIT, \"rev-list\", \"--max-count=17\", git_read_head($project)\n> -               or die_error(undef, \"Open git-rev-list failed.\");\n> +               or die_error(undef, \"Open git-rev-list failed\");\n>         my @revlist = map { chomp; $_ } <$fd>;\n>         close $fd;\n>         git_header_div('shortlog');\n> @@ -1461,10 +1461,10 @@ sub git_tag {\n>  sub git_blame2 {\n>         my $fd;\n>         my $ftype;\n> -       die_error(undef, \"Permission denied.\") if (!git_get_project_config_bool ('blame'));\n> +       die_error(undef, \"Permission denied\") if (!git_get_project_config_bool ('blame'));\n>         die_error('404 Not Found', \"File name not defined\") if (!$file_name);\n>         $hash_base ||= git_read_head($project);\n> -       die_error(undef, \"Couldn't find base commit.\") unless ($hash_base);\n> +       die_error(undef, \"Couldn't find base commit\") unless ($hash_base);\n>         my %co = git_read_commit($hash_base)\n>                 or die_error(undef, \"Reading commit failed\");\n>         if (!defined $hash) {\n> @@ -1476,7 +1476,7 @@ sub git_blame2 {\n>                 die_error(\"400 Bad Request\", \"Object is not a blob\");\n>         }\n>         open ($fd, \"-|\", $GIT, \"blame\", '-l', $file_name, $hash_base)\n> -               or die_error(undef, \"Open git-blame failed.\");\n> +               or die_error(undef, \"Open git-blame failed\");\n>         git_header_html();\n>         my $formats_nav =\n>                 $cgi->a({-href => \"$my_uri?\" .\n> esc_param(\"p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name\")}, \"blob\") .\n> @@ -1519,18 +1519,18 @@ sub git_blame2 {\n>  \n>  sub git_blame {\n>         my $fd;\n> -       die_error('403 Permission denied', \"Permission denied.\") if\n> (!git_get_project_config_bool ('blame'));\n> -       die_error('404 Not Found', \"File name not defined.\") if (!$file_name);\n> +       die_error('403 Permission denied', \"Permission denied\") if (!git_get_project_config_bool\n> ('blame'));\n> +       die_error('404 Not Found', \"File name not defined\") if (!$file_name);\n>         $hash_base ||= git_read_head($project);\n> -       die_error(undef, \"Couldn't find base commit.\") unless ($hash_base);\n> +       die_error(undef, \"Couldn't find base commit\") unless ($hash_base);\n>         my %co = git_read_commit($hash_base)\n> -               or die_error(undef, \"Reading commit failed.\");\n> +               or die_error(undef, \"Reading commit failed\");\n>         if (!defined $hash) {\n>                 $hash = git_get_hash_by_path($hash_base, $file_name, \"blob\")\n> -                       or die_error(undef, \"Error lookup file.\");\n> +                       or die_error(undef, \"Error lookup file\");\n>         }\n>         open ($fd, \"-|\", $GIT, \"annotate\", '-l', '-t', '-r', $file_name, $hash_base)\n> -               or die_error(undef, \"Open git-annotate failed.\");\n> +               or die_error(undef, \"Open git-annotate failed\");\n>         git_header_html();\n>         my $formats_nav =\n>                 $cgi->a({-href => \"$my_uri?\" .\n> esc_param(\"p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name\")}, \"blob\") .\n> @@ -1640,9 +1640,9 @@ sub git_blob_plain {\n>                 if (defined $file_name) {\n>                         my $base = $hash_base || git_read_head($project);\n>                         $hash = git_get_hash_by_path($base, $file_name, \"blob\")\n> -                               or die_error(undef, \"Error lookup file.\");\n> +                               or die_error(undef, \"Error lookup file\");\n>                 } else {\n> -                       die_error(undef, \"No file name defined.\");\n> +                       die_error(undef, \"No file name defined\");\n>                 }\n>         }\n>         my $type = shift;\n> @@ -1673,14 +1673,14 @@ sub git_blob {\n>                 if (defined $file_name) {\n>                         my $base = $hash_base || git_read_head($project);\n>                         $hash = git_get_hash_by_path($base, $file_name, \"blob\")\n> -                               or die_error(undef, \"Error lookup file.\");\n> +                               or die_error(undef, \"Error lookup file\");\n>                 } else {\n> -                       die_error(undef, \"No file name defined.\");\n> +                       die_error(undef, \"No file name defined\");\n>                 }\n>         }\n>         my $have_blame = git_get_project_config_bool ('blame');\n>         open my $fd, \"-|\", $GIT, \"cat-file\", \"blob\", $hash\n> -               or die_error(undef, \"Couldn't cat $file_name, $hash.\");\n> +               or die_error(undef, \"Couldn't cat $file_name, $hash\");\n>         my $mimetype = git_blob_plain_mimetype($fd, $file_name);\n>         if ($mimetype !~ m/^text\\//) {\n>                 close $fd;\n> @@ -1738,9 +1738,9 @@ sub git_tree {\n>         }\n>         $/ = \"\\0\";\n>         open my $fd, \"-|\", $GIT, \"ls-tree\", '-z', $hash\n> -               or die_error(undef, \"Open git-ls-tree failed.\");\n> +               or die_error(undef, \"Open git-ls-tree failed\");\n>         my @entries = map { chomp; $_ } <$fd>;\n> -       close $fd or die_error(undef, \"Reading tree failed.\");\n> +       close $fd or die_error(undef, \"Reading tree failed\");\n>         $/ = \"\\n\";\n>  \n>         my $refs = read_info_ref();\n> @@ -1816,7 +1816,7 @@ sub git_log {\n>  \n>         my $limit = sprintf(\"--max-count=%i\", (100 * ($page+1)));\n>         open my $fd, \"-|\", $GIT, \"rev-list\", $limit, $hash\n> -               or die_error(undef, \"Open git-rev-list failed.\");\n> +               or die_error(undef, \"Open git-rev-list failed\");\n>         my @revlist = map { chomp; $_ } <$fd>;\n>         close $fd;\n>  \n> @@ -1877,7 +1877,7 @@ sub git_log {\n>  sub git_commit {\n>         my %co = git_read_commit($hash);\n>         if (!%co) {\n> -               die_error(undef, \"Unknown commit object.\");\n> +               die_error(undef, \"Unknown commit object\");\n>         }\n>         my %ad = date_str($co{'author_epoch'}, $co{'author_tz'});\n>         my %cd = date_str($co{'committer_epoch'}, $co{'committer_tz'});\n> @@ -1887,9 +1887,9 @@ sub git_commit {\n>                 $parent = \"--root\";\n>         }\n>         open my $fd, \"-|\", $GIT, \"diff-tree\", '-r', '-M', $parent, $hash\n> -               or die_error(undef, \"Open git-diff-tree failed.\");\n> +               or die_error(undef, \"Open git-diff-tree failed\");\n>         my @difftree = map { chomp; $_ } <$fd>;\n> -       close $fd or die_error(undef, \"Reading git-diff-tree failed.\");\n> +       close $fd or die_error(undef, \"Reading git-diff-tree failed\");\n>  \n>         # non-textual hash id's can be cached\n>         my $expires;\n> @@ -2105,15 +2105,15 @@ sub git_commitdiff {\n>         mkdir($git_temp, 0700);\n>         my %co = git_read_commit($hash);\n>         if (!%co) {\n> -               die_error(undef, \"Unknown commit object.\");\n> +               die_error(undef, \"Unknown commit object\");\n>         }\n>         if (!defined $hash_parent) {\n>                 $hash_parent = $co{'parent'};\n>         }\n>         open my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\n> -               or die_error(undef, \"Open git-diff-tree failed.\");\n> +               or die_error(undef, \"Open git-diff-tree failed\");\n>         my @difftree = map { chomp; $_ } <$fd>;\n> -       close $fd or die_error(undef, \"Reading git-diff-tree failed.\");\n> +       close $fd or die_error(undef, \"Reading git-diff-tree failed\");\n>  \n>         # non-textual hash id's can be cached\n>         my $expires;\n> @@ -2191,9 +2191,9 @@ sub git_commitdiff {\n>  sub git_commitdiff_plain {\n>         mkdir($git_temp, 0700);\n>         open my $fd, \"-|\", $GIT, \"diff-tree\", '-r', $hash_parent, $hash\n> -               or die_error(undef, \"Open git-diff-tree failed.\");\n> +               or die_error(undef, \"Open git-diff-tree failed\");\n>         my @difftree = map { chomp; $_ } <$fd>;\n> -       close $fd or die_error(undef, \"Reading diff-tree failed.\");\n> +       close $fd or die_error(undef, \"Reading diff-tree failed\");\n>  \n>         # try to figure out the next tag after this commit\n>         my $tagname;\n> @@ -2251,7 +2251,7 @@ sub git_history {\n>         my $ftype;\n>         my %co = git_read_commit($hash_base);\n>         if (!%co) {\n> -               die_error(undef, \"Unknown commit object.\");\n> +               die_error(undef, \"Unknown commit object\");\n>         }\n>         my $refs = read_info_ref();\n>         git_header_html();\n> @@ -2309,14 +2309,14 @@ sub git_history {\n>  \n>  sub git_search {\n>         if (!defined $searchtext) {\n> -               die_error(undef, \"Text field empty.\");\n> +               die_error(undef, \"Text field empty\");\n>         }\n>         if (!defined $hash) {\n>                 $hash = git_read_head($project);\n>         }\n>         my %co = git_read_commit($hash);\n>         if (!%co) {\n> -               die_error(undef, \"Unknown commit object.\");\n> +               die_error(undef, \"Unknown commit object\");\n>         }\n>         # pickaxe may take all resources of your box and run for several minutes\n>         # with every query - so decide by yourself how public you make this feature :)\n> @@ -2454,7 +2454,7 @@ sub git_shortlog {\n>  \n>         my $limit = sprintf(\"--max-count=%i\", (100 * ($page+1)));\n>         open my $fd, \"-|\", $GIT, \"rev-list\", $limit, $hash\n> -               or die_error(undef, \"Open git-rev-list failed.\");\n> +               or die_error(undef, \"Open git-rev-list failed\");\n>         my @revlist = map { chomp; $_ } <$fd>;\n>         close $fd;\n>  \n> @@ -2482,9 +2482,9 @@ ## feeds (RSS, OPML)\n>  sub git_rss {\n>         # http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ\n>         open my $fd, \"-|\", $GIT, \"rev-list\", \"--max-count=150\", git_read_head($project)\n> -               or die_error(undef, \"Open git-rev-list failed.\");\n> +               or die_error(undef, \"Open git-rev-list failed\");\n>         my @revlist = map { chomp; $_ } <$fd>;\n> -       close $fd or die_error(undef, \"Reading git-rev-list failed.\");\n> +       close $fd or die_error(undef, \"Reading git-rev-list failed\");\n>         print $cgi->header(-type => 'text/xml', -charset => 'utf-8');\n>         print \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\".\n>               \"<rss version=\\\"2.0\\\"\n> xmlns:content=\\\"http://purl.org/rss/1.0/modules/content/\\\">\\n\";\n> -- \n> 1.4.1.1\n> \n> \n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n"},{"id":"24831","messageId":"eb2g5l$ipo$1@sea.gmane.org","threadId":"5138","inReplyTo":"20060805155504.6832.qmail@web31807.mail.mud.yahoo.com","subject":"Re: [PATCH 6/9] gitweb: No periods for error messages","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-08-05T16:15:30Z","receivedAt":"2006-08-05T16:15:30Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Luben Tuikov wrote:\n\n> --- Jakub Narebski <jnareb@gmail.com> wrote:\n> \n>> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n>> ---\n>> Like in Luben Tuikov patch\n> \n> Good work!\n> \n> I see this patch bears identical Subject line and\n> is logically identical as the one I posted.\n> \n> Maybe you ment to include the above line above your\n> Signed-off-by: line?\n\nProbably should have just added you to Signed-off-by: line.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"}]}