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 <[email protected]>
---
 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

Reply via email to