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

Re: [dpdk-dev] [dpdk-stable] [PATCH v2 2/2] devtools: fix patches missing if range newer than HEAD

From: Xueming(Steven) Li <hidden>
Date: 2021-08-09 07:44:26

-----Original Message-----
From: Thomas Monjalon <redacted>
Sent: Sunday, August 8, 2021 7:25 PM
To: Xueming(Steven) Li <redacted>
Cc: dev@dpdk.org; stable@dpdk.org; Christian Ehrhardt <redacted>; bluca@debian.org;
ktraynor@redhat.com; david.marchand@redhat.com
Subject: Re: [dpdk-stable] [PATCH v2 2/2] devtools: fix patches missing if range newer than HEAD

30/06/2021 08:34, Xueming Li:
quoted
Current fix scan scripts scanned specified range in HEAD branch.
I cannot parse the above sentence.
The scripts scans patches and try to get patch version info from current branch.
quoted
When users ran it in an earlier branch, few patches were scanned due
to the fixes in the range are newer and not merged to HEAD branch.
You mean some patches were not scanned?
Scanned but failed to retrieve correct version info. 
quoted
This patch introduces optional <branch> argument, default to HEAD if
not specified. Checks the <range> specified in parameter must being
merged in <branch>.
Cannot parse either.
quoted
Fixes: 752d8e097ec1 ("scripts: show fixes with release version of
bug")
Cc: Thomas Monjalon <redacted>
Cc: stable@dpdk.org
Cc: Christian Ehrhardt <redacted>

Signed-off-by: Xueming Li <redacted>
[...]
quoted
-	echo "usage: $(basename $0) [-h] <git_range>"
+	echo "usage: $(basename $0) [-h] <git_range> [<branch>]"
[...]
quoted
-range="$*"
+range="$1"
I think it breaks passing range in multiple parameters without quotes.
But it is not really a problem.
quoted
+branch="$2"
+
+[ -n "$branch" ] || branch="HEAD"
+refbranch=$(git rev-parse --abbrev-ref $branch)
Why this line is needed? A comment may help.
OK
If $branch is not used anymore, we can overwrite it instead of introducing one more variable $refbranch.
$branch will be used in function commit_version().
quoted
+range_last=$(git log --oneline $range |head -n1|cut -d' ' -f1)
spaces missing around pipes.
You can avoid "head" and "cut" by providing the right options to git.
Yes, rev-parse will do this efficiently.
quoted
+if ! git branch -a --contains $range_last |grep -q -e " $refbranch$" -e " remotes/$refbranch$"; then
+	echo "range $range not included by branch $refbranch"
+	exit 1
+fi

 # 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)
You move a line but not its comment above.
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help