gitweb: No periods for error messages
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Acked-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Jakub Narebski committed
Aug 5, 2006 at 13:13 UTC
cac4bd94fb6d5f3066614051827669476a9f0b56
1 file changed
+46
-46
gitweb/gitweb.perl
+46
-46
@@ -76,7 +76,7 @@ if (! -d $git_temp) {
76
our $action = $cgi->param('a');
77
if (defined $action) {
78
if ($action =~ m/[^0-9a-zA-Z\.\-_]/) {
79
- die_error(undef, "Invalid action parameter.");
79
+ die_error(undef, "Invalid action parameter");
80
}
81
# action which does not check rest of parameters
82
if ($action eq "opml") {
@@ -89,13 +89,13 @@ our $project = ($cgi->param('p') || $ENV{'PATH_INFO'});
89
if (defined $project) {
90
$project =~ s|^/||; $project =~ s|/$||;
91
if (!validate_input($project)) {
92
- die_error(undef, "Invalid project parameter.");
92
+ die_error(undef, "Invalid project parameter");
93
}
94
if (!(-d "$projectroot/$project")) {
95
- die_error(undef, "No such directory.");
95
+ die_error(undef, "No such directory");
96
}
97
if (!(-e "$projectroot/$project/HEAD")) {
98
- die_error(undef, "No such project.");
98
+ die_error(undef, "No such project");
99
}
100
$rss_link = "<link rel=\"alternate\" title=\"" . esc_param($project) . " log\" href=\"" .
101
"$my_uri?" . esc_param("p=$project;a=rss") . "\" type=\"application/rss+xml\"/>";
@@ -108,42 +108,42 @@ if (defined $project) {
108
our $file_name = $cgi->param('f');
109
if (defined $file_name) {
110
if (!validate_input($file_name)) {
111
- die_error(undef, "Invalid file parameter.");
111
+ die_error(undef, "Invalid file parameter");
112
}
113
}
114
115
our $hash = $cgi->param('h');
116
if (defined $hash) {
117
if (!validate_input($hash)) {
118
- die_error(undef, "Invalid hash parameter.");
118
+ die_error(undef, "Invalid hash parameter");
119
}
120
}
121
122
our $hash_parent = $cgi->param('hp');
123
if (defined $hash_parent) {
124
if (!validate_input($hash_parent)) {
125
- die_error(undef, "Invalid hash parent parameter.");
125
+ die_error(undef, "Invalid hash parent parameter");
126
}
127
}
128
129
our $hash_base = $cgi->param('hb');
130
if (defined $hash_base) {
131
if (!validate_input($hash_base)) {
132
- die_error(undef, "Invalid hash base parameter.");
132
+ die_error(undef, "Invalid hash base parameter");
133
}
134
}
135
136
our $page = $cgi->param('pg');
137
if (defined $page) {
138
if ($page =~ m/[^0-9]$/) {
139
- die_error(undef, "Invalid page parameter.");
139
+ die_error(undef, "Invalid page parameter");
140
}
141
}
142
143
our $searchtext = $cgi->param('s');
144
if (defined $searchtext) {
145
if ($searchtext =~ m/[^a-zA-Z0-9_\.\/\-\+\:\@ ]/) {
146
- die_error(undef, "Invalid search parameter.");
146
+ die_error(undef, "Invalid search parameter");
147
}
148
$searchtext = quotemeta $searchtext;
149
}
@@ -172,7 +172,7 @@ my %actions = (
172
173
$action = 'summary' if (!defined($action));
174
if (!defined($actions{$action})) {
175
- die_error(undef, "Unknown action.");
175
+ die_error(undef, "Unknown action");
176
}
177
$actions{$action}->();
178
exit;
@@ -418,7 +418,7 @@ sub git_get_hash_by_path {
418
my $tree = $base;
419
420
open my $fd, "-|", $GIT, "ls-tree", $base, "--", $path
421
- or die_error(undef, "Open git-ls-tree failed.");
421
+ or die_error(undef, "Open git-ls-tree failed");
422
my $line = <$fd>;
423
close $fd or return undef;
424
@@ -1265,13 +1265,13 @@ sub git_diff_print {
1265
sub git_project_list {
1266
my $order = $cgi->param('o');
1267
if (defined $order && $order !~ m/project|descr|owner|age/) {
1268
- die_error(undef, "Invalid order parameter '$order'.");
1268
+ die_error(undef, "Invalid order parameter '$order'");
1269
}
1270
1271
my @list = git_read_projects();
1272
my @projects;
1273
if (!@list) {
1274
- die_error(undef, "No projects found.");
1274
+ die_error(undef, "No projects found");
1275
}
1276
foreach my $pr (@list) {
1277
my $head = git_read_head($pr->{'path'});
@@ -1405,7 +1405,7 @@ sub git_summary {
1405
"</table>\n";
1406
1407
open my $fd, "-|", $GIT, "rev-list", "--max-count=17", git_read_head($project)
1408
- or die_error(undef, "Open git-rev-list failed.");
1408
+ or die_error(undef, "Open git-rev-list failed");
1409
my @revlist = map { chomp; $_ } <$fd>;
1410
close $fd;
1411
git_header_div('shortlog');
@@ -1461,10 +1461,10 @@ sub git_tag {
1461
sub git_blame2 {
1462
my $fd;
1463
my $ftype;
1464
- die_error(undef, "Permission denied.") if (!git_get_project_config_bool ('blame'));
1464
+ die_error(undef, "Permission denied") if (!git_get_project_config_bool ('blame'));
1465
die_error('404 Not Found', "File name not defined") if (!$file_name);
1466
$hash_base ||= git_read_head($project);
1467
- die_error(undef, "Couldn't find base commit.") unless ($hash_base);
1467
+ die_error(undef, "Couldn't find base commit") unless ($hash_base);
1468
my %co = git_read_commit($hash_base)
1469
or die_error(undef, "Reading commit failed");
1470
if (!defined $hash) {
@@ -1476,7 +1476,7 @@ sub git_blame2 {
1476
die_error("400 Bad Request", "Object is not a blob");
1477
}
1478
open ($fd, "-|", $GIT, "blame", '-l', $file_name, $hash_base)
1479
- or die_error(undef, "Open git-blame failed.");
1479
+ or die_error(undef, "Open git-blame failed");
1480
git_header_html();
1481
my $formats_nav =
1482
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name")}, "blob") .
@@ -1519,18 +1519,18 @@ sub git_blame2 {
1519
1520
sub git_blame {
1521
my $fd;
1522
- die_error('403 Permission denied', "Permission denied.") if (!git_get_project_config_bool ('blame'));
1523
- die_error('404 Not Found', "File name not defined.") if (!$file_name);
1522
+ die_error('403 Permission denied', "Permission denied") if (!git_get_project_config_bool ('blame'));
1523
+ die_error('404 Not Found', "File name not defined") if (!$file_name);
1524
$hash_base ||= git_read_head($project);
1525
- die_error(undef, "Couldn't find base commit.") unless ($hash_base);
1525
+ die_error(undef, "Couldn't find base commit") unless ($hash_base);
1526
my %co = git_read_commit($hash_base)
1527
- or die_error(undef, "Reading commit failed.");
1527
+ or die_error(undef, "Reading commit failed");
1528
if (!defined $hash) {
1529
$hash = git_get_hash_by_path($hash_base, $file_name, "blob")
1530
- or die_error(undef, "Error lookup file.");
1530
+ or die_error(undef, "Error lookup file");
1531
}
1532
open ($fd, "-|", $GIT, "annotate", '-l', '-t', '-r', $file_name, $hash_base)
1533
- or die_error(undef, "Open git-annotate failed.");
1533
+ or die_error(undef, "Open git-annotate failed");
1534
git_header_html();
1535
my $formats_nav =
1536
$cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name")}, "blob") .
@@ -1640,9 +1640,9 @@ sub git_blob_plain {
1640
if (defined $file_name) {
1641
my $base = $hash_base || git_read_head($project);
1642
$hash = git_get_hash_by_path($base, $file_name, "blob")
1643
- or die_error(undef, "Error lookup file.");
1643
+ or die_error(undef, "Error lookup file");
1644
} else {
1645
- die_error(undef, "No file name defined.");
1645
+ die_error(undef, "No file name defined");
1646
}
1647
}
1648
my $type = shift;
@@ -1673,14 +1673,14 @@ sub git_blob {
1673
if (defined $file_name) {
1674
my $base = $hash_base || git_read_head($project);
1675
$hash = git_get_hash_by_path($base, $file_name, "blob")
1676
- or die_error(undef, "Error lookup file.");
1676
+ or die_error(undef, "Error lookup file");
1677
} else {
1678
- die_error(undef, "No file name defined.");
1678
+ die_error(undef, "No file name defined");
1679
}
1680
}
1681
my $have_blame = git_get_project_config_bool ('blame');
1682
open my $fd, "-|", $GIT, "cat-file", "blob", $hash
1683
- or die_error(undef, "Couldn't cat $file_name, $hash.");
1683
+ or die_error(undef, "Couldn't cat $file_name, $hash");
1684
my $mimetype = git_blob_plain_mimetype($fd, $file_name);
1685
if ($mimetype !~ m/^text\//) {
1686
close $fd;
@@ -1738,9 +1738,9 @@ sub git_tree {
1738
}
1739
$/ = "\0";
1740
open my $fd, "-|", $GIT, "ls-tree", '-z', $hash
1741
- or die_error(undef, "Open git-ls-tree failed.");
1741
+ or die_error(undef, "Open git-ls-tree failed");
1742
my @entries = map { chomp; $_ } <$fd>;
1743
- close $fd or die_error(undef, "Reading tree failed.");
1743
+ close $fd or die_error(undef, "Reading tree failed");
1744
$/ = "\n";
1745
1746
my $refs = read_info_ref();
@@ -1819,7 +1819,7 @@ sub git_log {
1819
1820
my $limit = sprintf("--max-count=%i", (100 * ($page+1)));
1821
open my $fd, "-|", $GIT, "rev-list", $limit, $hash
1822
- or die_error(undef, "Open git-rev-list failed.");
1822
+ or die_error(undef, "Open git-rev-list failed");
1823
my @revlist = map { chomp; $_ } <$fd>;
1824
close $fd;
1825
@@ -1880,7 +1880,7 @@ sub git_log {
1880
sub git_commit {
1881
my %co = git_read_commit($hash);
1882
if (!%co) {
1883
- die_error(undef, "Unknown commit object.");
1883
+ die_error(undef, "Unknown commit object");
1884
}
1885
my %ad = date_str($co{'author_epoch'}, $co{'author_tz'});
1886
my %cd = date_str($co{'committer_epoch'}, $co{'committer_tz'});
@@ -1890,9 +1890,9 @@ sub git_commit {
1890
$parent = "--root";
1891
}
1892
open my $fd, "-|", $GIT, "diff-tree", '-r', '-M', $parent, $hash
1893
- or die_error(undef, "Open git-diff-tree failed.");
1893
+ or die_error(undef, "Open git-diff-tree failed");
1894
my @difftree = map { chomp; $_ } <$fd>;
1895
- close $fd or die_error(undef, "Reading git-diff-tree failed.");
1895
+ close $fd or die_error(undef, "Reading git-diff-tree failed");
1896
1897
# non-textual hash id's can be cached
1898
my $expires;
@@ -2108,15 +2108,15 @@ sub git_commitdiff {
2108
mkdir($git_temp, 0700);
2109
my %co = git_read_commit($hash);
2110
if (!%co) {
2111
- die_error(undef, "Unknown commit object.");
2111
+ die_error(undef, "Unknown commit object");
2112
}
2113
if (!defined $hash_parent) {
2114
$hash_parent = $co{'parent'};
2115
}
2116
open my $fd, "-|", $GIT, "diff-tree", '-r', $hash_parent, $hash
2117
- or die_error(undef, "Open git-diff-tree failed.");
2117
+ or die_error(undef, "Open git-diff-tree failed");
2118
my @difftree = map { chomp; $_ } <$fd>;
2119
- close $fd or die_error(undef, "Reading git-diff-tree failed.");
2119
+ close $fd or die_error(undef, "Reading git-diff-tree failed");
2120
2121
# non-textual hash id's can be cached
2122
my $expires;
@@ -2194,9 +2194,9 @@ sub git_commitdiff {
2194
sub git_commitdiff_plain {
2195
mkdir($git_temp, 0700);
2196
open my $fd, "-|", $GIT, "diff-tree", '-r', $hash_parent, $hash
2197
- or die_error(undef, "Open git-diff-tree failed.");
2197
+ or die_error(undef, "Open git-diff-tree failed");
2198
my @difftree = map { chomp; $_ } <$fd>;
2199
- close $fd or die_error(undef, "Reading diff-tree failed.");
2199
+ close $fd or die_error(undef, "Reading diff-tree failed");
2200
2201
# try to figure out the next tag after this commit
2202
my $tagname;
@@ -2254,7 +2254,7 @@ sub git_history {
2254
my $ftype;
2255
my %co = git_read_commit($hash_base);
2256
if (!%co) {
2257
- die_error(undef, "Unknown commit object.");
2257
+ die_error(undef, "Unknown commit object");
2258
}
2259
my $refs = read_info_ref();
2260
git_header_html();
@@ -2312,14 +2312,14 @@ sub git_history {
2312
2313
sub git_search {
2314
if (!defined $searchtext) {
2315
- die_error(undef, "Text field empty.");
2315
+ die_error(undef, "Text field empty");
2316
}
2317
if (!defined $hash) {
2318
$hash = git_read_head($project);
2319
}
2320
my %co = git_read_commit($hash);
2321
if (!%co) {
2322
- die_error(undef, "Unknown commit object.");
2322
+ die_error(undef, "Unknown commit object");
2323
}
2324
# pickaxe may take all resources of your box and run for several minutes
2325
# with every query - so decide by yourself how public you make this feature :)
@@ -2457,7 +2457,7 @@ sub git_shortlog {
2457
2458
my $limit = sprintf("--max-count=%i", (100 * ($page+1)));
2459
open my $fd, "-|", $GIT, "rev-list", $limit, $hash
2460
- or die_error(undef, "Open git-rev-list failed.");
2460
+ or die_error(undef, "Open git-rev-list failed");
2461
my @revlist = map { chomp; $_ } <$fd>;
2462
close $fd;
2463
@@ -2485,9 +2485,9 @@ sub git_shortlog {
2485
sub git_rss {
2486
# http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ
2487
open my $fd, "-|", $GIT, "rev-list", "--max-count=150", git_read_head($project)
2488
- or die_error(undef, "Open git-rev-list failed.");
2488
+ or die_error(undef, "Open git-rev-list failed");
2489
my @revlist = map { chomp; $_ } <$fd>;
2490
- close $fd or die_error(undef, "Reading git-rev-list failed.");
2490
+ close $fd or die_error(undef, "Reading git-rev-list failed");
2491
print $cgi->header(-type => 'text/xml', -charset => 'utf-8');
2492
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n".
2493
"<rss version=\"2.0\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\">\n";