From: Daniel Stenberg Date: Tue, 15 Jul 2025 15:43:57 +0000 (+0200) Subject: release-notes.pl: ignore dupes on input and output X-Git-Tag: curl-8_15_0~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1962573a9363c0c90c24dff6fc3dc1eaf96ab1cd;p=thirdparty%2Fcurl.git release-notes.pl: ignore dupes on input and output Re-running this script now makes it track the already mentioned changelog entries and not add them again even if the git log contains them. This makes the script better handle reruns in a release branch after rebasing on a later version of master. Closes #17937 --- diff --git a/scripts/release-notes.pl b/scripts/release-notes.pl index c72b56de6e..741235a3e6 100755 --- a/scripts/release-notes.pl +++ b/scripts/release-notes.pl @@ -61,16 +61,29 @@ my @releasenotes=`cat RELEASE-NOTES`; my @o; # the entire new RELEASE-NOTES my @refused; # [num] = [2 bits of use info] my @refs; # [number] = [URL] +my %dupe; for my $l (@releasenotes) { if($l =~ /^ o .*\[(\d+)\]/) { # referenced, set bit 0 $refused[$1]=1; + my $m = $l; + chomp $m; + $m =~ s/^ o //; + $m =~ s/ \[\d+\]$//; + $dupe{$m} = 1; # mark this as present } elsif($l =~ /^ \[(\d+)\] = (.*)/) { # listed in a reference, set bit 1 $refused[$1] |= 2; $refs[$1] = $2; } + # mention without reference + elsif($l =~ /^ o (.*)/) { + my $m = $l; + chomp $m; + $m =~ s/^ o //; + $dupe{$m} = 1; # mark this as present + } } # Return a new fresh reference number @@ -156,6 +169,11 @@ sub onecommit { my ($short)=@_; my $ref; + if($dupe{$short}) { + # this git commit message was found in the file + return; + } + if($bug[0]) { $ref = $bug[0]; } @@ -185,6 +203,11 @@ for my $l (@releasenotes) { push @o, $l; push @o, "\n"; for my $f (@line) { + if($dupe{$f}) { + # this item is already listed + next; + } + push @o, sprintf " o %s%s\n", $f, $moreinfo{$f}? sprintf(" [%d]", $moreinfo{$f}): ""; $refused[$moreinfo{$f}]=3;