release-notes.pl: check fixes/closes lines better

To better skip lines that just happen to mention those words at the
start of a line without being instructions.
This commit is contained in:
Daniel Stenberg 2023-01-02 11:31:29 +01:00
parent f27262b179
commit 9ca194b5e2
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -6,7 +6,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 2020 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 2020 - 2023, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
@ -88,6 +88,7 @@ sub getref {
# 'num'
# 'https://github.com/curl/curl/issues/6939'
# 'https://github.com/curl/curl-www/issues/69'
# 'https://elsewhere.example.com/discussion'
sub extract {
my ($ref)=@_;
@ -99,10 +100,11 @@ sub extract {
# return the plain number
return $1;
}
else {
# return the URL
elsif($ref =~ /:\/\//) {
# contains a '://', return the URL
return $ref;
}
# false alarm, not a valid line
}
my $short;
@ -132,13 +134,16 @@ for my $l (@gitlog) {
my $line = $1;
if($line =~ /^Fixes(:|) *(.*)/i) {
push @fixes, extract($2);
my $ref = extract($2);
push @fixes, $ref if($ref);
}
elsif($line =~ /^Clo(s|)es(:|) *(.*)/i) {
push @closes, extract($3);
my $ref = extract($3);
push @closes, $ref if($ref);
}
elsif($line =~ /^Bug: (.*)/i) {
push @bug, extract($1);
my $ref = extract($1);
push @bug, $ref if($ref);
}
}
}