From: Kevin Traynor <ktraynor@redhat.com>
To: Thomas Monjalon <thomas@monjalon.net>, dev@dpdk.org
Subject: Re: [PATCH 2/2] devtools: deduplicate function to mark fixes
Date: Wed, 9 Oct 2024 10:17:12 +0100 [thread overview]
Message-ID: <6183e492-7c00-4ca0-822f-62a30fc4c90e@redhat.com> (raw)
In-Reply-To: <20230418140726.1472209-3-thomas@monjalon.net>
On 18/04/2023 15:07, Thomas Monjalon wrote:
> 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 <thomas@monjalon.net>
> ---
> devtools/git-log-fixes.sh | 22 ++++++----------------
> 1 file changed, 6 insertions(+), 16 deletions(-)
>
> diff --git a/devtools/git-log-fixes.sh b/devtools/git-log-fixes.sh
> index 4690dd4545..005e46f715 100755
> --- a/devtools/git-log-fixes.sh
> +++ b/devtools/git-log-fixes.sh
> @@ -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: *stable@dpdk.org' ; 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: *stable@dpdk.org' 'S')
> + fixes=$(git_log_mark $id '^Fixes:' 'F')
> [ "$stable" = "S" ] || [ "$fixes" = "F" ] || [ -n "$origins" ] || continue
> version=$(commit_version $id)
> if [ -n "$origins" ] ; then
Acked-by: Kevin Traynor <ktraynor@redhat.com>
next prev parent reply other threads:[~2024-10-09 9:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-18 14:07 [PATCH 0/2] minor changes in script used for backports Thomas Monjalon
2023-04-18 14:07 ` [PATCH 1/2] devtools: fix check of multiple commits fixed at once Thomas Monjalon
2023-11-28 14:15 ` Luca Boccassi
2024-10-09 9:17 ` Kevin Traynor
2023-04-18 14:07 ` [PATCH 2/2] devtools: deduplicate function to mark fixes Thomas Monjalon
2023-11-28 14:14 ` Luca Boccassi
2024-10-09 9:17 ` Kevin Traynor [this message]
2023-11-28 13:23 ` [PATCH 0/2] minor changes in script used for backports Thomas Monjalon
2024-11-30 22:04 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6183e492-7c00-4ca0-822f-62a30fc4c90e@redhat.com \
--to=ktraynor@redhat.com \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).