diff options
author | Daniel Stenberg <daniel@haxx.se> | 2022-11-12 00:07:34 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-11-15 10:56:09 +0100 |
commit | 980510926d97e0513c4495473618473b41695836 (patch) | |
tree | fd4a5ca289a1977f95b7a730377628457173535d /scripts | |
parent | f4912407eb37ab12a09aa124dd5ce5be3ff03932 (diff) | |
download | curl-980510926d97e0513c4495473618473b41695836.tar.gz |
log2changes.pl: wrap long lines at 80 columns
Also, only use author names in the output.
Fixes #9896
Reported-by: John Sherrill
Closes #9897
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/log2changes.pl | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/scripts/log2changes.pl b/scripts/log2changes.pl index 1af705758..ee8a753eb 100755 --- a/scripts/log2changes.pl +++ b/scripts/log2changes.pl @@ -37,6 +37,18 @@ sub nicedate { return $date; } +sub printmsg { + my ($p, $msg)=@_; + while(length($msg) > 77) { + print $p.substr($msg, 0, 77, "")."\n"; + $p=" "; + } + if($msg eq "") { + $p = ""; + } + print "$p$msg\n"; +} + print ' _ _ ____ _ ___| | | | _ \| | @@ -47,7 +59,6 @@ print Changelog '; -my $line; my $tag; while(<STDIN>) { my $l = $_; @@ -61,44 +72,32 @@ while(<STDIN>) { } } elsif($l =~ /^Author: *(.*) +</) { - $a = $1; - } - elsif($l =~ /^Commit: *(.*) +</) { $c = $1; } elsif($l =~ /^CommitDate: (.*)/) { $date = nicedate($1); } elsif($l =~ /^( )(.*)/) { - my $extra; + my $pref = " "; if ($tag) { # Version entries have a special format print "\nVersion " . $tag." ($date)\n"; $oldc = ""; $tag = ""; } - if($a ne $c) { - $extra=sprintf("\n- [%s brought this change]\n\n ", $a); - } - else { - $extra="\n- "; - } if($co ne $oldco) { if($c ne $oldc) { - print "\n$c ($date)$extra"; + print "\n$c ($date)\n\n"; } else { - print "$extra"; + print "\n"; } - $line =0; + $pref = "- "; } $oldco = $co; $oldc = $c; $olddate = $date; - if($line++ && $2 ne "") { - print " "; - } - print $2."\n"; + printmsg($pref, $2); } } |