+sub git_print_log {
+ my $log = shift;
+
+ # remove leading empty lines
+ while (defined $log->[0] && $log->[0] eq "") {
+ shift @$log;
+ }
+
+ # print log
+ my $signoff = 0;
+ my $empty = 0;
+ foreach my $line (@$log) {
+ # print only one empty line
+ # do not print empty line after signoff
+ if ($line eq "") {
+ next if ($empty || $signoff);
+ $empty = 1;
+ } else {
+ $empty = 0;
+ }
+ if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
+ $signoff = 1;
+ print "<span class=\"signoff\">" . esc_html($line) . "</span><br/>\n";
+ } else {
+ $signoff = 0;
+ print format_log_line_html($line) . "<br/>\n";
+ }
+ }
+}
+
+sub git_print_simplified_log {
+ my $log = shift;
+ my $remove_title = shift;
+
+ shift @$log if $remove_title;
+ # remove leading empty lines
+ while (defined $log->[0] && $log->[0] eq "") {
+ shift @$log;
+ }
+
+ # simplify and print log
+ my $empty = 0;
+ foreach my $line (@$log) {
+ # remove signoff lines
+ if ($line =~ m/^ *(signed[ \-]off[ \-]by[ :]|acked[ \-]by[ :]|cc[ :])/i) {
+ next;
+ }
+ # print only one empty line
+ if ($line eq "") {
+ next if $empty;
+ $empty = 1;
+ } else {
+ $empty = 0;
+ }
+ print format_log_line_html($line) . "<br/>\n";
+ }
+ # end with single empty line
+ print "<br/>\n" unless $empty;
+}
+