[dpdk-stable] [PATCH 2/2] devtools: auto detect branch to search fix patches

Xueming Li xuemingl at nvidia.com
Sat Jun 12 15:56:28 CEST 2021


Current fix scan scripts scanned specified range in current(HEAD)
branch. When users run it in a earlier branch, few patches were
scanned.

This patch auto etects branch to scan from range.

Fixes: 752d8e097ec1 ("scripts: show fixes with release version of bug")
Cc: Thomas Monjalon <thomas at monjalon.net>
Cc: stable at dpdk.org

Signed-off-by: Xueming Li <xuemingl at nvidia.com>
---
 devtools/git-log-fixes.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/devtools/git-log-fixes.sh b/devtools/git-log-fixes.sh
index 5fc57da913..9a8a9d6739 100755
--- a/devtools/git-log-fixes.sh
+++ b/devtools/git-log-fixes.sh
@@ -34,13 +34,15 @@ done
 shift $(($OPTIND - 1))
 [ $# -ge 1 ] || usage_error 'range argument required'
 range="$*"
+range_last=$(git log --oneline v21.05-rc3..v21.05 |head -n1|cut -d' ' -f1)
+# use first branch
+refbranch=$(git branch --contains $range_last -r --sort=-authordate |head -n1)
 
 # get major release version of a commit
 commit_version () # <hash>
 {
 	local VER="v*.*"
 	# use current branch as history reference
-	local refbranch=$(git rev-parse --abbrev-ref HEAD)
 	local tag=$( (git tag -l $VER --contains $1 --sort=creatordate --merged $refbranch 2>&- ||
 		# tag --merged option has been introduced in git 2.7.0
 		# below is a fallback in case of old git version
-- 
2.25.1



More information about the stable mailing list