{"thread":{"id":"7494","subject":"[PATCH 0/3] gitweb: Few cleanup patches","startedAt":"2007-04-01T20:21:01Z","lastAt":"2007-04-04T09:10:33Z","messageCount":6,"participants":["Jakub Narebski","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"38471","messageId":"200704012221.01676.jnareb@gmail.com","threadId":"7494","inReplyTo":null,"subject":"[PATCH 0/3] gitweb: Few cleanup patches","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-04-01T20:21:01Z","receivedAt":"2007-04-01T20:21:01Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\n [PATCH 1/3] gitweb: Whitespace cleanup - tabs are for indent, spaces are for align (3)\n [PATCH 2/3] gitweb: Quote hash keys, and do not use barewords keys\n [PATCH 3/3] gitweb: Few doublequoted strings cleanups\n\n---\n gitweb/gitweb.perl |  150 ++++++++++++++++++++++++++--------------------------\n 1 files changed, 75 insertions(+), 75 deletions(-)\n\n-- \nJakub Narebski\nPoland\n"},{"id":"38474","messageId":"200704012221.39055.jnareb@gmail.com","threadId":"7494","inReplyTo":"200704012221.01676.jnareb@gmail.com","subject":"[PATCH 1/3] gitweb: Whitespace cleanup - tabs are for indent, spaces are for align (3)","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-04-01T20:21:38Z","receivedAt":"2007-04-01T20:21:38Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Code should be look the same way, regardless of tab size.\nUse tabs for indent, but spaces for align.\n\nIndent continued part of command spanning multiple lines, but only once.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |   48 ++++++++++++++++++++++++------------------------\n 1 files changed, 24 insertions(+), 24 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex d1f4aeb..5c49056 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -1800,7 +1800,7 @@ EOF\n \t\t      $cgi->hidden(-name => \"a\") . \"\\n\" .\n \t\t      $cgi->hidden(-name => \"h\") . \"\\n\" .\n \t\t      $cgi->popup_menu(-name => 'st', -default => 'commit',\n-\t\t\t\t       -values => ['commit', 'author', 'committer', 'pickaxe']) .\n+\t\t                       -values => ['commit', 'author', 'committer', 'pickaxe']) .\n \t\t      $cgi->sup($cgi->a({-href => href(action=>\"search_help\")}, \"?\")) .\n \t\t      \" search:\\n\",\n \t\t      $cgi->textfield(-name => \"s\", -value => $searchtext) . \"\\n\" .\n@@ -3097,7 +3097,7 @@ sub git_summary {\n \t\tgit_project_list_body(\\@forklist, undef, 0, 15,\n \t\t                      $#forklist <= 15 ? undef :\n \t\t                      $cgi->a({-href => href(action=>\"forks\")}, \"...\"),\n-\t\t\t\t      'noheader');\n+\t\t                      'noheader');\n \t}\n \n \tgit_footer_html();\n@@ -3204,7 +3204,7 @@ HTML\n \t\tmy $rev = substr($full_rev, 0, 8);\n \t\tmy $author = $meta->{'author'};\n \t\tmy %date = parse_date($meta->{'author-time'},\n-\t\t\t\t      $meta->{'author-tz'});\n+\t\t                      $meta->{'author-tz'});\n \t\tmy $date = $date{'iso-tz'};\n \t\tif ($group_size) {\n \t\t\t$current_color = ++$current_color % $num_colors;\n@@ -3216,9 +3216,9 @@ HTML\n \t\t\tprint \" rowspan=\\\"$group_size\\\"\" if ($group_size > 1);\n \t\t\tprint \">\";\n \t\t\tprint $cgi->a({-href => href(action=>\"commit\",\n-\t\t\t\t\t\t     hash=>$full_rev,\n-\t\t\t\t\t\t     file_name=>$file_name)},\n-\t\t\t\t      esc_html($rev));\n+\t\t\t                             hash=>$full_rev,\n+\t\t\t                             file_name=>$file_name)},\n+\t\t\t              esc_html($rev));\n \t\t\tprint \"</td>\\n\";\n \t\t}\n \t\topen (my $dd, \"-|\", git_cmd(), \"rev-parse\", \"$full_rev^\")\n@@ -3227,13 +3227,13 @@ HTML\n \t\tclose $dd;\n \t\tchomp($parent_commit);\n \t\tmy $blamed = href(action => 'blame',\n-\t\t\t\t  file_name => $meta->{'filename'},\n-\t\t\t\t  hash_base => $parent_commit);\n+\t\t                  file_name => $meta->{'filename'},\n+\t\t                  hash_base => $parent_commit);\n \t\tprint \"<td class=\\\"linenr\\\">\";\n \t\tprint $cgi->a({ -href => \"$blamed#l$orig_lineno\",\n-\t\t\t\t-id => \"l$lineno\",\n-\t\t\t\t-class => \"linenr\" },\n-\t\t\t      esc_html($lineno));\n+\t\t                -id => \"l$lineno\",\n+\t\t                -class => \"linenr\" },\n+\t\t              esc_html($lineno));\n \t\tprint \"</td>\";\n \t\tprint \"<td class=\\\"pre\\\">\" . esc_html($data) . \"</td>\\n\";\n \t\tprint \"</tr>\\n\";\n@@ -3623,7 +3623,7 @@ sub git_snapshot {\n \tmy $name = $project;\n \t$name =~ s/\\047/\\047\\\\\\047\\047/g;\n \topen my $fd, \"-|\",\n-\t\"$git archive --format=tar --prefix=\\'$name\\'/ $hash | $command\"\n+\t\t\"$git archive --format=tar --prefix=\\'$name\\'/ $hash | $command\"\n \t\tor die_error(undef, \"Execute git-tar-tree failed\");\n \tbinmode STDOUT, ':raw';\n \tprint <$fd>;\n@@ -3736,7 +3736,7 @@ sub git_commit {\n \t\t# difftree output is not printed for merges\n \t\topen my $fd, \"-|\", git_cmd(), \"diff-tree\", '-r', \"--no-commit-id\",\n \t\t\t@diff_opts, $parent, $hash, \"--\"\n-\t\t\t\tor die_error(undef, \"Open git-diff-tree failed\");\n+\t\t\tor die_error(undef, \"Open git-diff-tree failed\");\n \t\t@difftree = map { chomp; $_ } <$fd>;\n \t\tclose $fd or die_error(undef, \"Reading git-diff-tree failed\");\n \t}\n@@ -4308,13 +4308,13 @@ sub git_search {\n \t\tif ($page > 0) {\n \t\t\t$paging_nav .=\n \t\t\t\t$cgi->a({-href => href(action=>\"search\", hash=>$hash,\n-\t\t\t\t\t\t       searchtext=>$searchtext, searchtype=>$searchtype)},\n-\t\t\t\t\t\"first\");\n+\t\t\t\t                       searchtext=>$searchtext, searchtype=>$searchtype)},\n+\t\t\t\t        \"first\");\n \t\t\t$paging_nav .= \" &sdot; \" .\n \t\t\t\t$cgi->a({-href => href(action=>\"search\", hash=>$hash,\n-\t\t\t\t\t\t       searchtext=>$searchtext, searchtype=>$searchtype,\n-\t\t\t\t\t\t       page=>$page-1),\n-\t\t\t\t\t -accesskey => \"p\", -title => \"Alt-p\"}, \"prev\");\n+\t\t\t\t                       searchtext=>$searchtext, searchtype=>$searchtype,\n+\t\t\t\t                       page=>$page-1),\n+\t\t\t\t         -accesskey => \"p\", -title => \"Alt-p\"}, \"prev\");\n \t\t} else {\n \t\t\t$paging_nav .= \"first\";\n \t\t\t$paging_nav .= \" &sdot; prev\";\n@@ -4322,9 +4322,9 @@ sub git_search {\n \t\tif ($#commitlist >= 100) {\n \t\t\t$paging_nav .= \" &sdot; \" .\n \t\t\t\t$cgi->a({-href => href(action=>\"search\", hash=>$hash,\n-\t\t\t\t\t\t       searchtext=>$searchtext, searchtype=>$searchtype,\n-\t\t\t\t\t\t       page=>$page+1),\n-\t\t\t\t\t -accesskey => \"n\", -title => \"Alt-n\"}, \"next\");\n+\t\t\t\t                       searchtext=>$searchtext, searchtype=>$searchtype,\n+\t\t\t\t                       page=>$page+1),\n+\t\t\t\t         -accesskey => \"n\", -title => \"Alt-n\"}, \"next\");\n \t\t} else {\n \t\t\t$paging_nav .= \" &sdot; next\";\n \t\t}\n@@ -4332,9 +4332,9 @@ sub git_search {\n \t\tif ($#commitlist >= 100) {\n \t\t\t$next_link =\n \t\t\t\t$cgi->a({-href => href(action=>\"search\", hash=>$hash,\n-\t\t\t\t\t\t       searchtext=>$searchtext, searchtype=>$searchtype,\n-\t\t\t\t\t\t       page=>$page+1),\n-\t\t\t\t\t -accesskey => \"n\", -title => \"Alt-n\"}, \"next\");\n+\t\t\t\t                       searchtext=>$searchtext, searchtype=>$searchtype,\n+\t\t\t\t                       page=>$page+1),\n+\t\t\t\t         -accesskey => \"n\", -title => \"Alt-n\"}, \"next\");\n \t\t}\n \n \t\tgit_print_page_nav('','', $hash,$co{'tree'},$hash, $paging_nav);\n-- \n1.5.0.5\n"},{"id":"38473","messageId":"200704012222.21920.jnareb@gmail.com","threadId":"7494","inReplyTo":"200704012221.01676.jnareb@gmail.com","subject":"[PATCH 2/3] gitweb: Quote hash keys, and do not use barewords keys","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-04-01T20:22:21Z","receivedAt":"2007-04-01T20:22:21Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Ensure that in all references to an elemento of a hash the value\nof key is singlequoted, instead of using bareword: use $hash{'key'}\ninstead of $hash{key}\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |   16 ++++++++--------\n 1 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 5c49056..eab8f3f 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -19,7 +19,7 @@ use File::Basename qw(basename);\n binmode STDOUT, ':utf8';\n \n BEGIN {\n-\tCGI->compile() if $ENV{MOD_PERL};\n+\tCGI->compile() if $ENV{'MOD_PERL'};\n }\n \n our $cgi = new CGI;\n@@ -1870,16 +1870,16 @@ sub git_print_page_nav {\n \tmy %arg = map { $_ => {action=>$_} } @navs;\n \tif (defined $head) {\n \t\tfor (qw(commit commitdiff)) {\n-\t\t\t$arg{$_}{hash} = $head;\n+\t\t\t$arg{$_}{'hash'} = $head;\n \t\t}\n \t\tif ($current =~ m/^(tree | log | shortlog | commit | commitdiff | search)$/x) {\n \t\t\tfor (qw(shortlog log)) {\n-\t\t\t\t$arg{$_}{hash} = $head;\n+\t\t\t\t$arg{$_}{'hash'} = $head;\n \t\t\t}\n \t\t}\n \t}\n-\t$arg{tree}{hash} = $treehead if defined $treehead;\n-\t$arg{tree}{hash_base} = $treebase if defined $treebase;\n+\t$arg{'tree'}{'hash'} = $treehead if defined $treehead;\n+\t$arg{'tree'}{'hash_base'} = $treebase if defined $treebase;\n \n \tprint \"<div class=\\\"page_nav\\\">\\n\" .\n \t\t(join \" | \",\n@@ -1927,9 +1927,9 @@ sub git_print_header_div {\n \tmy ($action, $title, $hash, $hash_base) = @_;\n \tmy %args = ();\n \n-\t$args{action} = $action;\n-\t$args{hash} = $hash if $hash;\n-\t$args{hash_base} = $hash_base if $hash_base;\n+\t$args{'action'} = $action;\n+\t$args{'hash'} = $hash if $hash;\n+\t$args{'hash_base'} = $hash_base if $hash_base;\n \n \tprint \"<div class=\\\"header\\\">\\n\" .\n \t      $cgi->a({-href => href(%args), -class => \"title\"},\n-- \n1.5.0.5\n"},{"id":"38472","messageId":"200704012223.00087.jnareb@gmail.com","threadId":"7494","inReplyTo":"200704012221.01676.jnareb@gmail.com","subject":"[PATCH 3/3] gitweb: Few doublequoted strings cleanups","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-04-01T20:22:59Z","receivedAt":"2007-04-01T20:22:59Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Replace a few doublequoted strings by theirs singlequoted equivalent,\nlose doublequotes around variable in string containing only\nof a variable name, use '' consistently as an empty string (and not\nsometimes as \"\").\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n gitweb/gitweb.perl |   86 ++++++++++++++++++++++++++--------------------------\n 1 files changed, 43 insertions(+), 43 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex eab8f3f..9f116a2 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -36,7 +36,7 @@ our $GIT = \"++GIT_BINDIR++/git\";\n our $projectroot = \"++GITWEB_PROJECTROOT++\";\n \n # target of the home link on top of all pages\n-our $home_link = $my_uri || \"/\";\n+our $home_link = $my_uri || '/';\n \n # string of the home link on top of all pages\n our $home_link_str = \"++GITWEB_HOME_LINK_STR++\";\n@@ -377,7 +377,7 @@ if (defined $searchtype) {\n # now read PATH_INFO and use it as alternative to parameters\n sub evaluate_path_info {\n \treturn if defined $project;\n-\tmy $path_info = $ENV{\"PATH_INFO\"};\n+\tmy $path_info = $ENV{'PATH_INFO'};\n \treturn if !$path_info;\n \t$path_info =~ s,^/+,,;\n \treturn if !$path_info;\n@@ -403,7 +403,7 @@ sub evaluate_path_info {\n \t\t# we got \"project.git/branch:filename\" or \"project.git/branch:dir/\"\n \t\t# we could use git_get_type(branch:pathname), but it needs $git_dir\n \t\t$pathname =~ s,^/+,,;\n-\t\tif (!$pathname || substr($pathname, -1) eq \"/\") {\n+\t\tif (!$pathname || substr($pathname, -1) eq '/') {\n \t\t\t$action  ||= \"tree\";\n \t\t\t$pathname =~ s,/$,,;\n \t\t} else {\n@@ -515,10 +515,10 @@ sub href(%) {\n \tfor (my $i = 0; $i < @mapping; $i += 2) {\n \t\tmy ($name, $symbol) = ($mapping[$i], $mapping[$i+1]);\n \t\tif (defined $params{$name}) {\n-\t\t\tpush @result, $symbol . \"=\" . esc_param($params{$name});\n+\t\t\tpush @result, $symbol . '=' . esc_param($params{$name});\n \t\t}\n \t}\n-\t$href .= \"?\" . join(';', @result) if scalar @result;\n+\t$href .= '?' . join(';', @result) if scalar @result;\n \n \treturn $href;\n }\n@@ -876,7 +876,7 @@ sub format_ref_marker {\n \tif ($markers) {\n \t\treturn ' <span class=\"refs\">'. $markers . '</span>';\n \t} else {\n-\t\treturn \"\";\n+\t\treturn '';\n \t}\n }\n \n@@ -900,17 +900,17 @@ sub format_diff_line {\n \tmy $line = shift;\n \tmy ($from, $to) = @_;\n \tmy $char = substr($line, 0, 1);\n-\tmy $diff_class = \"\";\n+\tmy $diff_class = '';\n \n \tchomp $line;\n \n \tif ($char eq '+') {\n \t\t$diff_class = \" add\";\n-\t} elsif ($char eq \"-\") {\n+\t} elsif ($char eq '-') {\n \t\t$diff_class = \" rem\";\n-\t} elsif ($char eq \"@\") {\n+\t} elsif ($char eq '@') {\n \t\t$diff_class = \" chunk_header\";\n-\t} elsif ($char eq \"\\\\\") {\n+\t} elsif ($char eq '\\\\') {\n \t\t$diff_class = \" incomplete\";\n \t}\n \t$line = untabify($line);\n@@ -1052,7 +1052,7 @@ sub git_get_projects_list {\n \t\tmy $dir = $projects_list . ($filter ? \"/$filter\" : '');\n \t\t# remove the trailing \"/\"\n \t\t$dir =~ s!/+$!!;\n-\t\tmy $pfxlen = length(\"$dir\");\n+\t\tmy $pfxlen = length($dir);\n \n \t\tmy ($check_forks) = gitweb_check_feature('forks');\n \n@@ -1074,7 +1074,7 @@ sub git_get_projects_list {\n \t\t\t\t\t$File::Find::prune = 1;\n \t\t\t\t}\n \t\t\t},\n-\t\t}, \"$dir\");\n+\t\t}, $dir);\n \n \t} elsif (-f $projects_list) {\n \t\t# read from file(url-encoded):\n@@ -1166,7 +1166,7 @@ sub git_get_last_activity {\n }\n \n sub git_get_references {\n-\tmy $type = shift || \"\";\n+\tmy $type = shift || '';\n \tmy %refs;\n \t# 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c refs/tags/v2.6.11\n \t# c39ae07f393806ccf406ef966e9a15afc43cc36a refs/tags/v2.6.11^{}\n@@ -1261,7 +1261,7 @@ sub parse_tag {\n \t\t} elsif ($line =~ m/--BEGIN/) {\n \t\t\tpush @comment, $line;\n \t\t\tlast;\n-\t\t} elsif ($line eq \"\") {\n+\t\t} elsif ($line eq '') {\n \t\t\tlast;\n \t\t}\n \t}\n@@ -1323,7 +1323,7 @@ sub parse_commit_text {\n \n \tforeach my $title (@commit_lines) {\n \t\t$title =~ s/^    //;\n-\t\tif ($title ne \"\") {\n+\t\tif ($title ne '') {\n \t\t\t$co{'title'} = chop_str($title, 80, 5);\n \t\t\t# remove leading stuff of merges to make the interesting part visible\n \t\t\tif (length($title) > 50) {\n@@ -1346,7 +1346,7 @@ sub parse_commit_text {\n \t\t\tlast;\n \t\t}\n \t}\n-\tif ($co{'title'} eq \"\") {\n+\tif ($co{'title'} eq '') {\n \t\t$co{'title'} = $co{'title_short'} = '(no commit message)';\n \t}\n \t# remove added spaces\n@@ -1781,7 +1781,7 @@ EOF\n \tmy ($have_search) = gitweb_check_feature('search');\n \tif ((defined $project) && ($have_search)) {\n \t\tif (!defined $searchtext) {\n-\t\t\t$searchtext = \"\";\n+\t\t\t$searchtext = '';\n \t\t}\n \t\tmy $search_hash;\n \t\tif (defined $hash_base) {\n@@ -1803,7 +1803,7 @@ EOF\n \t\t                       -values => ['commit', 'author', 'committer', 'pickaxe']) .\n \t\t      $cgi->sup($cgi->a({-href => href(action=>\"search_help\")}, \"?\")) .\n \t\t      \" search:\\n\",\n-\t\t      $cgi->textfield(-name => \"s\", -value => $searchtext) . \"\\n\" .\n+\t\t      $cgi->textfield(-name => 's', -value => $searchtext) . \"\\n\" .\n \t\t      \"</div>\" .\n \t\t      $cgi->end_form() . \"\\n\";\n \t}\n@@ -2003,7 +2003,7 @@ sub git_print_log ($;%) {\n \t\tshift @$log;\n \t}\n \t# remove leading empty lines\n-\twhile (defined $log->[0] && $log->[0] eq \"\") {\n+\twhile (defined $log->[0] && $log->[0] eq '') {\n \t\tshift @$log;\n \t}\n \n@@ -2027,7 +2027,7 @@ sub git_print_log ($;%) {\n \n \t\t# print only one empty line\n \t\t# do not print empty line after signoff\n-\t\tif ($line eq \"\") {\n+\t\tif ($line eq '') {\n \t\t\tnext if ($empty || $signoff);\n \t\t\t$empty = 1;\n \t\t} else {\n@@ -2220,7 +2220,7 @@ sub git_difftree_body {\n \t\t\t$from_file_type = file_type($diff{'from_mode'});\n \t\t}\n \n-\t\tif ($diff{'status'} eq \"A\") { # created\n+\t\tif ($diff{'status'} eq 'A') { # created\n \t\t\tmy $mode_chng = \"<span class=\\\"file_status new\\\">[new $to_file_type\";\n \t\t\t$mode_chng   .= \" with mode: $to_mode_str\" if $to_mode_str;\n \t\t\t$mode_chng   .= \"]</span>\";\n@@ -2242,7 +2242,7 @@ sub git_difftree_body {\n \t\t\t              \"blob\");\n \t\t\tprint \"</td>\\n\";\n \n-\t\t} elsif ($diff{'status'} eq \"D\") { # deleted\n+\t\t} elsif ($diff{'status'} eq 'D') { # deleted\n \t\t\tmy $mode_chng = \"<span class=\\\"file_status deleted\\\">[deleted $from_file_type]</span>\";\n \t\t\tprint \"<td>\";\n \t\t\tprint $cgi->a({-href => href(action=>\"blob\", hash=>$diff{'from_id'},\n@@ -2270,8 +2270,8 @@ sub git_difftree_body {\n \t\t\t              \"history\");\n \t\t\tprint \"</td>\\n\";\n \n-\t\t} elsif ($diff{'status'} eq \"M\" || $diff{'status'} eq \"T\") { # modified, or type changed\n-\t\t\tmy $mode_chnge = \"\";\n+\t\t} elsif ($diff{'status'} eq 'M' || $diff{'status'} eq 'T') { # modified, or type changed\n+\t\t\tmy $mode_chnge = '';\n \t\t\tif ($diff{'from_mode'} != $diff{'to_mode'}) {\n \t\t\t\t$mode_chnge = \"<span class=\\\"file_status mode_chnge\\\">[changed\";\n \t\t\t\tif ($from_file_type ne $to_file_type) {\n@@ -2320,10 +2320,10 @@ sub git_difftree_body {\n \t\t\t              \"history\");\n \t\t\tprint \"</td>\\n\";\n \n-\t\t} elsif ($diff{'status'} eq \"R\" || $diff{'status'} eq \"C\") { # renamed or copied\n+\t\t} elsif ($diff{'status'} eq 'R' || $diff{'status'} eq 'C') { # renamed or copied\n \t\t\tmy %status_name = ('R' => 'moved', 'C' => 'copied');\n \t\t\tmy $nstatus = $status_name{$diff{'status'}};\n-\t\t\tmy $mode_chng = \"\";\n+\t\t\tmy $mode_chng = '';\n \t\t\tif ($diff{'from_mode'} != $diff{'to_mode'}) {\n \t\t\t\t# mode also for directories, so we cannot use $to_mode_str\n \t\t\t\t$mode_chng = sprintf(\", mode: %04o\", $to_mode_oct & 0777);\n@@ -2434,14 +2434,14 @@ sub git_patchset_body {\n \t\t\t}\n \t\t\t$from{'file'} = $diffinfo->{'from_file'} || $diffinfo->{'file'};\n \t\t\t$to{'file'}   = $diffinfo->{'to_file'}   || $diffinfo->{'file'};\n-\t\t\tif ($diffinfo->{'status'} ne \"A\") { # not new (added) file\n+\t\t\tif ($diffinfo->{'status'} ne 'A') { # not new (added) file\n \t\t\t\t$from{'href'} = href(action=>\"blob\", hash_base=>$hash_parent,\n \t\t\t\t                     hash=>$diffinfo->{'from_id'},\n \t\t\t\t                     file_name=>$from{'file'});\n \t\t\t} else {\n \t\t\t\tdelete $from{'href'};\n \t\t\t}\n-\t\t\tif ($diffinfo->{'status'} ne \"D\") { # not deleted file\n+\t\t\tif ($diffinfo->{'status'} ne 'D') { # not deleted file\n \t\t\t\t$to{'href'} = href(action=>\"blob\", hash_base=>$hash,\n \t\t\t\t                   hash=>$diffinfo->{'to_id'},\n \t\t\t\t                   file_name=>$to{'file'});\n@@ -2577,12 +2577,12 @@ sub git_project_list_body {\n \t\t}\n \t\t($pr->{'age'}, $pr->{'age_string'}) = @aa;\n \t\tif (!defined $pr->{'descr'}) {\n-\t\t\tmy $descr = git_get_project_description($pr->{'path'}) || \"\";\n+\t\t\tmy $descr = git_get_project_description($pr->{'path'}) || '';\n \t\t\t$pr->{'descr_long'} = to_utf8($descr);\n \t\t\t$pr->{'descr'} = chop_str($descr, 25, 5);\n \t\t}\n \t\tif (!defined $pr->{'owner'}) {\n-\t\t\t$pr->{'owner'} = get_file_owner(\"$projectroot/$pr->{'path'}\") || \"\";\n+\t\t\t$pr->{'owner'} = get_file_owner(\"$projectroot/$pr->{'path'}\") || '';\n \t\t}\n \t\tif ($check_forks) {\n \t\t\tmy $pname = $pr->{'path'};\n@@ -2926,10 +2926,10 @@ sub git_search_grep_body {\n \t\tmy $comment = $co{'comment'};\n \t\tforeach my $line (@$comment) {\n \t\t\tif ($line =~ m/^(.*)($searchtext)(.*)$/i) {\n-\t\t\t\tmy $lead = esc_html($1) || \"\";\n+\t\t\t\tmy $lead = esc_html($1) || '';\n \t\t\t\t$lead = chop_str($lead, 30, 10);\n-\t\t\t\tmy $match = esc_html($2) || \"\";\n-\t\t\t\tmy $trail = esc_html($3) || \"\";\n+\t\t\t\tmy $match = esc_html($2) || '';\n+\t\t\t\tmy $trail = esc_html($3) || '';\n \t\t\t\t$trail = chop_str($trail, 30, 10);\n \t\t\t\tmy $text = \"$lead<span class=\\\"match\\\">$match</span>$trail\";\n \t\t\t\tprint chop_str($text, 80, 5) . \"<br/>\\n\";\n@@ -3056,7 +3056,7 @@ sub git_summary {\n \tforeach my $git_url (@url_list) {\n \t\tnext unless $git_url;\n \t\tprint \"<tr><td>$url_tag</td><td>$git_url</td></tr>\\n\";\n-\t\t$url_tag = \"\";\n+\t\t$url_tag = '';\n \t}\n \tprint \"</table>\\n\";\n \n@@ -3381,7 +3381,7 @@ sub git_blob_plain {\n \t\t}\n \t} elsif ($hash =~ m/^[0-9a-fA-F]{40}$/) {\n \t\t# blobs defined by non-textual hash id's can be cached\n-\t\t$expires = \"+1d\";\n+\t\t$expires = '+1d';\n \t}\n \n \tmy $type = shift;\n@@ -3391,7 +3391,7 @@ sub git_blob_plain {\n \t$type ||= blob_mimetype($fd, $file_name);\n \n \t# save as filename, even when no $file_name is given\n-\tmy $save_as = \"$hash\";\n+\tmy $save_as = $hash;\n \tif (defined $file_name) {\n \t\t$save_as = $file_name;\n \t} elsif ($type =~ m/^text\\//) {\n@@ -3399,8 +3399,8 @@ sub git_blob_plain {\n \t}\n \n \tprint $cgi->header(\n-\t\t-type => \"$type\",\n-\t\t-expires=>$expires,\n+\t\t-type => $type,\n+\t\t-expires => $expires,\n \t\t-content_disposition => 'inline; filename=\"' . \"$save_as\" . '\"');\n \tundef $/;\n \tbinmode STDOUT, ':raw';\n@@ -3423,7 +3423,7 @@ sub git_blob {\n \t\t}\n \t} elsif ($hash =~ m/^[0-9a-fA-F]{40}$/) {\n \t\t# blobs defined by non-textual hash id's can be cached\n-\t\t$expires = \"+1d\";\n+\t\t$expires = '+1d';\n \t}\n \n \tmy ($have_blame) = gitweb_check_feature('blame');\n@@ -3616,7 +3616,7 @@ sub git_snapshot {\n \n \tprint $cgi->header(\n \t\t-type => \"application/$ctype\",\n-\t\t-content_disposition => 'inline; filename=\"' . \"$filename\" . '\"',\n+\t\t-content_disposition => 'inline; filename=\"' . $filename . '\"',\n \t\t-status => '200 OK');\n \n \tmy $git = git_cmd_str();\n@@ -3744,7 +3744,7 @@ sub git_commit {\n \t# non-textual hash id's can be cached\n \tmy $expires;\n \tif ($hash =~ m/^[0-9a-fA-F]{40}$/) {\n-\t\t$expires = \"+1d\";\n+\t\t$expires = '+1d';\n \t}\n \tmy $refs = git_get_references();\n \tmy $ref = format_ref_marker($refs, $co{'id'});\n@@ -4129,7 +4129,7 @@ sub git_commitdiff {\n \t# non-textual hash id's can be cached\n \tmy $expires;\n \tif ($hash =~ m/^[0-9a-fA-F]{40}$/) {\n-\t\t$expires = \"+1d\";\n+\t\t$expires = '+1d';\n \t}\n \n \t# write commit message\n@@ -4157,7 +4157,7 @@ sub git_commitdiff {\n \t\t\t-type => 'text/plain',\n \t\t\t-charset => 'utf-8',\n \t\t\t-expires => $expires,\n-\t\t\t-content_disposition => 'inline; filename=\"' . \"$filename\" . '\"');\n+\t\t\t-content_disposition => 'inline; filename=\"' . $filename . '\"');\n \t\tmy %ad = parse_date($co{'author_epoch'}, $co{'author_tz'});\n \t\tprint <<TEXT;\n From: $co{'author'}\n-- \n1.5.0.5\n"},{"id":"38531","messageId":"7vlkh9w6pa.fsf@assigned-by-dhcp.cox.net","threadId":"7494","inReplyTo":"200704012223.00087.jnareb@gmail.com","subject":"Re: [PATCH 3/3] gitweb: Few doublequoted strings cleanups","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-04-03T20:20:33Z","receivedAt":"2007-04-03T20:20:33Z","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> Replace a few doublequoted strings by theirs singlequoted equivalent,\n> lose doublequotes around variable in string containing only\n> of a variable name, use '' consistently as an empty string (and not\n> sometimes as \"\").\n\nWhy?  I do not in particular like a micro-cleanup like this (it\nseems more of personal taste than cleanup).\n\n> -\t} elsif ($char eq \"\\\\\") {\n> +\t} elsif ($char eq '\\\\') {\n>  \t\t$diff_class = \" incomplete\";\n>  \t}\n\nEspecially this makes a shell scripter think twice before\nrealizing that this is Perl and a backslash expands inside\nsingle quotes.  In other words, I find that the former is easier\nto read.\n\n> @@ -1052,7 +1052,7 @@ sub git_get_projects_list {\n>  \t\tmy $dir = $projects_list . ($filter ? \"/$filter\" : '');\n>  \t\t# remove the trailing \"/\"\n>  \t\t$dir =~ s!/+$!!;\n> -\t\tmy $pfxlen = length(\"$dir\");\n> +\t\tmy $pfxlen = length($dir);\n\nOn the other hand, I think this makes the code easier to read.\n\n> @@ -1261,7 +1261,7 @@ sub parse_tag {\n>  \t\t} elsif ($line =~ m/--BEGIN/) {\n>  \t\t\tpush @comment, $line;\n>  \t\t\tlast;\n\nOne thing I noticed is that we seem to have needless 'm' as in\nthe above m/--BEGIN/ in some places.  My preferences are (this\nfalls within \"personal taste\" category):\n\n * Unless the pattern has slashes, drop 'm' for match, always\n   use '|' as the delimiter for substitution s/A/B;\n\n * If the pattern has slashes, consistently use the same\n   alternate letter as the delimiter (gitweb seems to use '!').\n\n\n> @@ -3616,7 +3616,7 @@ sub git_snapshot {\n>  \n>  \tprint $cgi->header(\n>  \t\t-type => \"application/$ctype\",\n> -\t\t-content_disposition => 'inline; filename=\"' . \"$filename\" . '\"',\n> +\t\t-content_disposition => 'inline; filename=\"' . $filename . '\"',\n>  \t\t-status => '200 OK');\n>  \n\nWouldn't it be easier to read if we did\n\n\t\"inline; filename=\\\"$filename\\\"\"\n\ninstead?\n"},{"id":"38609","messageId":"200704041110.33921.jnareb@gmail.com","threadId":"7494","inReplyTo":"7vlkh9w6pa.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 3/3] gitweb: Few doublequoted strings cleanups","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-04-04T09:10:33Z","receivedAt":"2007-04-04T09:10:33Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n> Jakub Narebski <jnareb@gmail.com> writes:\n> \n>> Replace a few doublequoted strings by theirs singlequoted equivalent,\n>> lose doublequotes around variable in string containing only\n>> of a variable name, use '' consistently as an empty string (and not\n>> sometimes as \"\").\n> \n> Why?  I do not in particular like a micro-cleanup like this (it\n> seems more of personal taste than cleanup).\n\nIMVHO consistency (always use '' to denote empty string... or always\nuse \"\") is a cleanup.\n\nBut I'm not that attached to this patch. It could stay or it could\ngo... One of the reasons for this patch was (most probably wrong)\nidea from dealing with PHP that using single quotes makes program\na tiny bit faster.\n\n>> -\t} elsif ($char eq \"\\\\\") {\n>> +\t} elsif ($char eq '\\\\') {\n>>  \t\t$diff_class = \" incomplete\";\n>>  \t}\n> \n> Especially this makes a shell scripter think twice before\n> realizing that this is Perl and a backslash expands inside\n> single quotes.  In other words, I find that the former is easier\n> to read.\n\nO.K. Although you can always escape singlequote inside single\nquotes, so escape character also has to be escaped.\n\n>> @@ -1052,7 +1052,7 @@ sub git_get_projects_list {\n>>  \t\tmy $dir = $projects_list . ($filter ? \"/$filter\" : '');\n>>  \t\t# remove the trailing \"/\"\n>>  \t\t$dir =~ s!/+$!!;\n>> -\t\tmy $pfxlen = length(\"$dir\");\n>> +\t\tmy $pfxlen = length($dir);\n> \n> On the other hand, I think this makes the code easier to read.\n\nThere are only two such chunks. Feel free to pick them...\n \n>> @@ -3616,7 +3616,7 @@ sub git_snapshot {\n>>  \n>>  \tprint $cgi->header(\n>>  \t\t-type => \"application/$ctype\",\n>> -\t\t-content_disposition => 'inline; filename=\"' . \"$filename\" . '\"',\n>> +\t\t-content_disposition => 'inline; filename=\"' . $filename . '\"',\n>>  \t\t-status => '200 OK');\n>>  \n> \n> Wouldn't it be easier to read if we did\n> \n> \t\"inline; filename=\\\"$filename\\\"\"\n> \n> instead?\n\nIt would. Right.\n\n-- \nJakub Narebski\nPoland\n"}]}