diff --git a/bugs-in-changelog.sh b/bugs-in-changelog.sh index 4d97b85cf..c8397144d 100755 --- a/bugs-in-changelog.sh +++ b/bugs-in-changelog.sh @@ -1,6 +1,6 @@ #!/bin/bash - # bugs-in-changelog.sh -# Copyright (C) 2009-2020 Red Hat Inc. +# Copyright (C) 2009-2021 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,27 +21,26 @@ # stable release (or any release). To use it, the only parameter # should be the git commit range, eg: # -# ./bugs-in-changelog.sh "1.0.89.." +# ./bugs-in-changelog.sh "v1.44.0.." if [ -z "$1" ]; then echo "$0 git-commit-range" exit 1 fi -# Comma-separated list of Bugzilla IDs. -bugids=$( - git log "$1" | egrep -o 'RHBZ#[0-9]+' | - sed 's/RHBZ#//' | - sort -u | - tr '\n' ',' | - sed 's/,$//' -) +# Grep the log for Bugzilla IDs in various formats. +rhbzs="$( git log "$1" | egrep -o 'RHBZ#[0-9]+' | sed 's/RHBZ#//' )" +bzurls="$( git log "$1" | egrep -o 'https?://bugzilla.redhat[_./?=a-z0-9]*[/=][0-9]+\b' | sed 's/.*[/=]\([0-9]\+\)$/\1/' )" + +# Uniq and format as comma-separated list of ids. +bugids=$( for b in $rhbzs $bzurls ; do echo $b; done | sort -u | tr '\n' ',' | sed 's/,$//' ) #echo bugids "$bugids" # Filter out any bugs which may still be in NEW or ASSIGNED: bugzilla query -b "$bugids" \ -s MODIFIED,POST,ON_QA,PASSES_QA,VERIFIED,RELEASE_PENDING,CLOSED \ + --component libguestfs \ --outputformat='%{bug_id} %{short_desc}' | sort -n -r | perl -pe '