minor changes in script used for backports
cover minor changes in script used for backports
While looking again at git-log-fixes.sh,
I've found a minor bug and a small improvement.
Thomas Monjalon (2):
devtools: fix check of multiple commits fixed at once
devtools: deduplicate function to mark fixes
devtools/git-log-fixes.sh | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-)
Signature · 1 line
2.40.0
PATCH 1/2 devtools: fix check of multiple commits fixed at once
When looking for fixes to backport,
only the first origin commit hash (from "Fixes:") was checked. There is very little chance that the next commits being fixed have a wrong hash in the commit log of the fix,
but it is fixed by checking them all before proceeding further.
--- devtools/git-log-fixes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/git-log-fixes.sh +1 -1
@@ -68,7 +68,7 @@ origin_version () # <origin_hash> ... { for origin in $* ; do # check hash is valid - git rev-parse -q --verify $1 >&- || continue + git rev-parse -q --verify $origin >&- || continue # get version of this bug origin local origver=$(commit_version $origin) local roothashes="$(origin_filter $origin)"
Signature · 1 line
2.40.0
Re: [PATCH 1/2] devtools: fix check of multiple commits fixed at once
Quoted 7 lines · Thomas Monjalon
When looking for fixes to backport,
only the first origin commit hash (from "Fixes:") was checked. There is very little chance that the next commits being fixed have a wrong hash in the commit log of the fix,
but it is fixed by checking them all before proceeding further.
Quoted 7 lines
Fixes 752d8e097ec1 ("scripts: show fixes with release version of bug")Signed-off-by Thomas Monjalon <[email protected]>--- devtools/git-log-fixes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Re: [PATCH 1/2] devtools: fix check of multiple commits fixed at once
In reply to Thomas MonjalonQuoted 19 lines · Thomas Monjalon
When looking for fixes to backport,
only the first origin commit hash (from "Fixes:") was checked. There is very little chance that the next commits being fixed have a wrong hash in the commit log of the fix,
but it is fixed by checking them all before proceeding further.Fixes 752d8e097ec1 ("scripts: show fixes with release version of bug")Signed-off-by Thomas Monjalon <[email protected]>--- devtools/git-log-fixes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)devtools/git-log-fixes.sh +0
-0
devtools/git-log-fixes.sh origin_version () # <origin_hash> ... · line 74
Quoted 8 lines
devtools/git-log-fixes.sh +1
-1@@ -68,7 +68,7 @@ origin_version () # <origin_hash> ... { for origin in $* ; do # check hash is valid - git rev-parse -q --verify $1 >&- || continue + git rev-parse -q --verify $origin >&- || continue # get version of this bug origin local origver=$(commit_version $origin) local roothashes="$(origin_filter $origin)"
These still apply and working well.
PATCH 2/2 devtools: deduplicate function to mark fixes
In reply to Thomas MonjalonIn the commit 8070d8fecb4e ("devtools: add fixes flag to commit listing") the function to mark a commit for "stable" was duplicated for "Fixes:" mark.
The code is a bit smaller by using a single function for both marks.
--- devtools/git-log-fixes.sh | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-)
devtools/git-log-fixes.sh +6 -16
@@ -84,31 +84,21 @@ origin_version () # <origin_hash> ... done | sort -uV | head -n1 } -# print a marker for stable tag presence -stable_tag () # <hash> +# print a marker for pattern presence in the commit message +git_log_mark () # <hash> <pattern> <marker> { - if git log --format='%b' -1 $1 | grep -qi '^Cc: *[email protected]' ; then - echo 'S' + if git log --format='%b' -1 $1 | grep -qi "$2" ; then + echo "$3" else echo '-' fi } -# print a marker for fixes tag presence -fixes_tag () # <hash> -{ - if git log --format='%b' -1 $1 | grep -qi '^Fixes: *' ; then - echo 'F' - else - echo '-' - fi -} - git log --oneline --reverse $range | while read id headline ; do origins=$(origin_filter $id) - stable=$(stable_tag $id) - fixes=$(fixes_tag $id) + stable=$(git_log_mark $id '^Cc: *[email protected]' 'S') + fixes=$(git_log_mark $id '^Fixes:' 'F') [ "$stable" = "S" ] || [ "$fixes" = "F" ] || [ -n "$origins" ] || continue version=$(commit_version $id) if [ -n "$origins" ] ; then
Signature · 1 line
2.40.0
Re: [PATCH 2/2] devtools: deduplicate function to mark fixes
Quoted 10 lines · Thomas Monjalon
In the commit
8070d8fecb4e("devtools: add fixes flag to commit listing") the function to mark a commit for "stable" was duplicated for "Fixes:" mark.The code is a bit smaller by using a single function for both marks.
Signed-off-by Thomas Monjalon <[email protected]>--- devtools/git-log-fixes.sh | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-)
Re: [PATCH 2/2] devtools: deduplicate function to mark fixes
In reply to Thomas MonjalonQuoted 42 lines · Thomas Monjalon
In the commit
8070d8fecb4e("devtools: add fixes flag to commit listing") the function to mark a commit for "stable" was duplicated for "Fixes:" mark.The code is a bit smaller by using a single function for both marks.
Signed-off-by Thomas Monjalon <[email protected]>--- devtools/git-log-fixes.sh | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-)devtools/git-log-fixes.sh +4
-14@@ -84,31 +84,21 @@ origin_version () # <origin_hash> ... done | sort -uV | head -n1 } -# print a marker for stable tag presence -stable_tag () # <hash> +# print a marker for pattern presence in the commit message +git_log_mark () # <hash> <pattern> <marker> { - if git log --format='%b' -1 $1 | grep -qi '^Cc: *[email protected]' ; then - echo 'S' + if git log --format='%b' -1 $1 | grep -qi "$2" ; then + echo "$3" else echo '-' fi } -# print a marker for fixes tag presence -fixes_tag () # <hash> -{ - if git log --format='%b' -1 $1 | grep -qi '^Fixes: *' ; then - echo 'F' - else - echo '-' - fi -} -
devtools/git-log-fixes.sh origin_version () # <origin_hash> ... · line 104
Quoted 10 lines
devtools/git-log-fixes.sh +2
-2git log --oneline --reverse $range | while read id headline ; do origins=$(origin_filter $id) - stable=$(stable_tag $id) - fixes=$(fixes_tag $id) + stable=$(git_log_mark $id '^Cc: *[email protected]' 'S') + fixes=$(git_log_mark $id '^Fixes:' 'F') [ "$stable" = "S" ] || [ "$fixes" = "F" ] || [ -n "$origins" ] || continue version=$(commit_version $id) if [ -n "$origins" ] ; then
These patches have been forgotten.
Adding more Cc.
18/04/2023 16:07, Thomas Monjalon:
Quoted 6 lines
While looking again at
git-log-fixes.sh,
I've found a minor bug and a small improvement.Thomas Monjalon (2):
devtools: fix check of multiple commits fixed at once
devtools: deduplicate function to mark fixes
28/11/2023 14:23, Thomas Monjalon:
Quoted 10 lines
These patches have been forgotten.
Adding more Cc.18/04/2023 16:07, Thomas Monjalon:
Quoted 6 lines
While looking again at
git-log-fixes.sh,
I've found a minor bug and a small improvement.Thomas Monjalon (2):
devtools: fix check of multiple commits fixed at once
devtools: deduplicate function to mark fixes
Applied