From 59b9f61a3f76762dc975e99cc05335a3b97ad1f9 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Tue, 22 Aug 2006 23:42:53 +0200 Subject: [PATCH] gitweb: Use here-doc Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 75 +++++++++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index ae38eca03..1c8a2ebe1 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1185,11 +1185,13 @@ sub die_error { my $error = shift || "Malformed query, file missing or permission denied"; git_header_html($status); - print "
\n" . - "

\n" . - "$status - $error\n" . - "
\n" . - "
\n"; + print < +

+$status - $error +
+ +EOF git_footer_html(); exit; } @@ -2022,9 +2024,11 @@ sub git_blame2 { my $num_colors = scalar(@rev_color); my $current_color = 0; my $last_rev; - print "
\n"; - print "\n"; - print "\n"; + print < +
CommitLineData
+ +HTML while (<$fd>) { /^([0-9a-fA-F]{40}).*?(\d+)\)\s{1}(\s*.*)/; my $full_rev = $1; @@ -2566,9 +2570,10 @@ sub git_blobdiff { git_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav); git_print_header_div('commit', esc_html($co{'title'}), $hash_base); } else { - print "
\n" . - "

\n" . - "
$hash vs $hash_parent
\n"; + print <

+
$hash vs $hash_parent
+HTML } git_print_page_path($file_name, "blob", $hash_base); print "
\n" . @@ -2704,9 +2709,11 @@ sub git_commitdiff_plain { -content_disposition => "inline; filename=\"git-$hash.patch\""); my %ad = parse_date($co{'author_epoch'}, $co{'author_tz'}); my $comment = $co{'comment'}; - print "From: $co{'author'}\n" . - "Date: $ad{'rfc2822'} ($ad{'tz_local'})\n". - "Subject: $co{'title'}\n"; + print <; close $fd or die_error(undef, "Reading git-rev-list failed"); print $cgi->header(-type => 'text/xml', -charset => 'utf-8'); - print "\n". - "\n"; - print "\n"; - print "$project\n". - "" . esc_html("$my_url?p=$project;a=summary") . "\n". - "$project log\n". - "en\n"; + print < + + +$project $my_uri $my_url +${\esc_html("$my_url?p=$project;a=summary")} +$project log +en +XML for (my $i = 0; $i <= $#revlist; $i++) { my $commit = $revlist[$i]; @@ -3005,13 +3014,15 @@ sub git_opml { my @list = git_get_projects_list(); print $cgi->header(-type => 'text/xml', -charset => 'utf-8'); - print "\n". - "\n". - "". - " $site_name Git OPML Export\n". - "\n". - "\n". - "\n"; + print < + + + $site_name Git OPML Export + + + +XML foreach my $pr (@list) { my %proj = %$pr; @@ -3030,7 +3041,9 @@ sub git_opml { my $html = "$my_url?p=$proj{'path'};a=summary"; print "\n"; } - print "\n". - "\n". - "\n"; + print < + + +XML } -- 2.26.2
CommitLineData