* [PATCH 0/4] devtools: align trailer checks with kernel convention
@ 2026-04-02 16:16 Stephen Hemminger
2026-04-02 16:16 ` [RFC 3/4] devtools: remove blank line requirement between trailers Stephen Hemminger
2026-04-02 16:16 ` [RFC 4/4] devtools: demote tag ordering to warning Stephen Hemminger
0 siblings, 2 replies; 3+ messages in thread
From: Stephen Hemminger @ 2026-04-02 16:16 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger
This series makes four incremental changes to check-git-log.sh to
align DPDK's commit message trailer handling with the Linux kernel
convention.
The motivation came from the recent work in kernel where the
same patch needed different trailer formatting for DPDK vs. the kernel.
This is unnecessary friction for developers who work across both
projects.
Patch 1: Use git's built-in %(trailers) format instead of grepping
the commit body with hand-rolled patterns.
Patch 2: Recognize the kernel trailer tags that DPDK was missing:
Co-developed-by, Closes:, and Link:. Also adds proper format
validation for Cc:, Coverity issue:, and Bugzilla ID: tags.
Patch 3: Remove the blank line requirement between relation tags
(Fixes, Cc) and attribution tags (Signed-off-by). All trailers
now form a single contiguous block, matching kernel convention
and git-interpret-trailers(1) semantics.
Patch 4: Demote tag ordering from error to warning, since the
kernel itself does not enforce strict ordering via tooling.
Stephen Hemminger (4):
devtools: use git trailer parser for tag extraction
devtools: recognize kernel trailer tags
devtools: remove blank line requirement between trailers
devtools: demote tag ordering to warning
devtools/check-git-log.sh | 50 +++++++++++++++++++++++----------------
1 file changed, 29 insertions(+), 21 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [RFC 3/4] devtools: remove blank line requirement between trailers
2026-04-02 16:16 [PATCH 0/4] devtools: align trailer checks with kernel convention Stephen Hemminger
@ 2026-04-02 16:16 ` Stephen Hemminger
2026-04-02 16:16 ` [RFC 4/4] devtools: demote tag ordering to warning Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2026-04-02 16:16 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Thomas Monjalon
Remove the SEQ[4]="^$" entry that required a blank line between
relation tags (Fixes, Cc) and attribution tags (Signed-off-by).
In the Linux kernel, all trailers form a single contiguous block
with no internal blank lines. This is also how git-interpret-trailers(1)
defines a trailer block: a group of consecutive trailer lines preceded
by a blank line. A blank line within the block causes git to only
parse the lower portion, losing the upper trailers.
Use %(trailers:key-only) to feed tag names into the ordering check
instead of the previous grep+cut pipeline on the body. This is
consistent with the %(trailers:unfold) change for tag extraction.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
devtools/check-git-log.sh | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh
index 3775b1587f..94cf68b926 100755
--- a/devtools/check-git-log.sh
+++ b/devtools/check-git-log.sh
@@ -223,28 +223,29 @@ done)
&& failure=true;}
# check tag sequence
+# All trailers form a single contiguous block with no blank lines,
+# matching kernel/netdev convention and git-interpret-trailers(1).
bad=$(for commit in $commits; do
- body=$(git log --format='%b' -1 $commit)
- echo "$body" |
- grep -o -e "$reltag\|^[[:blank:]]*$\|$bytag" |
- # retrieve tags only
- cut -f1 -d":" |
+ git log --format='%(trailers:key-only)' -1 $commit |
+ grep -v '^$' |
# it is okay to have several tags of the same type
# but for processing we need to squash them
uniq |
# make sure the tags are in the proper order as presented in SEQ
awk -v subject="$(git log --format='\t%s' -1 $commit)" 'BEGIN{
- SEQ[0] = "Coverity issue";
- SEQ[1] = "Bugzilla ID";
- SEQ[2] = "Fixes";
- SEQ[3] = "Cc";
- SEQ[4] = "^$";
- SEQ[5] = "Reported-by";
- SEQ[6] = "Suggested-by";
- SEQ[7] = "Signed-off-by";
- SEQ[8] = "Acked-by";
- SEQ[9] = "Reviewed-by";
- SEQ[10] = "Tested-by";
+ SEQ[0] = "Fixes";
+ SEQ[1] = "Closes";
+ SEQ[2] = "Link";
+ SEQ[3] = "Coverity issue";
+ SEQ[4] = "Bugzilla ID";
+ SEQ[5] = "Cc";
+ SEQ[6] = "Reported-by";
+ SEQ[7] = "Suggested-by";
+ SEQ[8] = "Co-developed-by";
+ SEQ[9] = "Signed-off-by";
+ SEQ[10] = "Acked-by";
+ SEQ[11] = "Reviewed-by";
+ SEQ[12] = "Tested-by";
latest = 0;
chronological = 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [RFC 4/4] devtools: demote tag ordering to warning
2026-04-02 16:16 [PATCH 0/4] devtools: align trailer checks with kernel convention Stephen Hemminger
2026-04-02 16:16 ` [RFC 3/4] devtools: remove blank line requirement between trailers Stephen Hemminger
@ 2026-04-02 16:16 ` Stephen Hemminger
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2026-04-02 16:16 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Thomas Monjalon
The Linux kernel does not enforce a strict tag ordering via tooling.
Ordering is a convention, enforced socially by maintainers rather
than by checkpatch.pl. The b4 tool has a configurable trailer-order
preference, but it is not mandatory.
Demote the tag ordering check from an error (which sets failure=true
and causes a non-zero exit) to a warning (printed but does not
affect the exit code). This avoids rejecting patches that are
otherwise correct but happen to have Reviewed-by before Acked-by
or similar minor ordering differences.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
devtools/check-git-log.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh
index 94cf68b926..5b621f5c8d 100755
--- a/devtools/check-git-log.sh
+++ b/devtools/check-git-log.sh
@@ -266,8 +266,7 @@ bad=$(for commit in $commits; do
chronological = 1;
}'
done)
-[ -z "$bad" ] || { printf "Wrong tag order: \n$bad\n"\
- && failure=true;}
+[ -z "$bad" ] || printf "WARNING: non-preferred tag order: \n$bad\n"
# check required tag
bad=$(for commit in $commits; do
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-02 16:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-02 16:16 [PATCH 0/4] devtools: align trailer checks with kernel convention Stephen Hemminger
2026-04-02 16:16 ` [RFC 3/4] devtools: remove blank line requirement between trailers Stephen Hemminger
2026-04-02 16:16 ` [RFC 4/4] devtools: demote tag ordering to warning Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox