Thread (19 messages) 19 messages, 4 authors, 2024-08-21

Re: [dpdk-dev] [PATCH 1/2] devtools: fix version pattern for fix search

From: Christian Ehrhardt <hidden>
Date: 2021-06-14 13:57:23

On Sat, Jun 12, 2021 at 3:57 PM Xueming Li [off-list ref] wrote:
quoted hunk ↗ jump to hunk
When scanning fixes from current(HEAD) branch, local tags were included
and reported as version. For example:
  $ git tag --contains <commit_id> --merged
  20.11_backport_202010506   // user tag
  v20.11
  v20.11.1

This patch matches DPDK officail version pattern in search, selects
the most early tag. Official tag pattern: "v<major>.<minor>"

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

Signed-off-by: Xueming Li <redacted>
---
 devtools/git-log-fixes.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/devtools/git-log-fixes.sh b/devtools/git-log-fixes.sh
index 210c8dcf25..5fc57da913 100755
--- a/devtools/git-log-fixes.sh
+++ b/devtools/git-log-fixes.sh
@@ -38,12 +38,13 @@ range="$*"
 # 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 --contains $1 --merged $refbranch 2>&- ||
+       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
-               for t in $(git tag -l --contains $1) ; do
+               for t in $(git tag -l $VER --contains $1) ; do
                        git branch $refbranch --contains $t |
                        sed "s,.\+,$t,"
                done) |
--
LGTM - thanks for improving the scripts!

Reviewed-by: Christian Ehrhardt <redacted>
2.25.1

-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help