]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
release-notes.pl: check fixes/closes lines better
authorDaniel Stenberg <daniel@haxx.se>
Mon, 2 Jan 2023 10:31:29 +0000 (11:31 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 2 Jan 2023 10:31:29 +0000 (11:31 +0100)
To better skip lines that just happen to mention those words at the
start of a line without being instructions.

scripts/release-notes.pl

index 9e1c4a58c634abd158f1459362f7772450ae241f..42f9b7a4d2b1986c2d7811d0c82262669efea60c 100755 (executable)
@@ -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);
         }
     }
 }