From bbec3342a1267f322312606cf2887d9fcb544046 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 30 Jun 2021 12:49:51 +0200 Subject: [PATCH 1/3] Script to find pull requests without a changelog entry Signed-off-by: Gilles Peskine --- tools/bin/mbedtls-check-missing-changelog | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 tools/bin/mbedtls-check-missing-changelog diff --git a/tools/bin/mbedtls-check-missing-changelog b/tools/bin/mbedtls-check-missing-changelog new file mode 100755 index 00000000..dcce83f3 --- /dev/null +++ b/tools/bin/mbedtls-check-missing-changelog @@ -0,0 +1,39 @@ +#!/bin/bash +set -e + +help () { + cat <&2 + exit 120 +fi +if [[ "$1" == '--help' ]]; then + help + exit +fi + +revision_range=$1 +merge_commits=$(git log --merges --first-parent --format=%H $revision_range) +for c in $merge_commits; do + if [[ $(git log -n1 --format=%ae $c\^2) == *@arm.com ]]; then + continue + fi + if git diff --name-only $c~1 $c | grep -q ChangeLog; then + continue + fi + git show --oneline $c | grep . +done From 002deb36d1f1c0ca9cd3e1a6498a5847f5ef9113 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 1 Jul 2021 12:04:10 +0200 Subject: [PATCH 2/3] Do consider pull requests from @arm.com authors The heuristic that @arm.com = PR by the team and PR by the team = low likelihood of a missing changelog is not particularly correct nowadays. Signed-off-by: Gilles Peskine --- tools/bin/mbedtls-check-missing-changelog | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tools/bin/mbedtls-check-missing-changelog b/tools/bin/mbedtls-check-missing-changelog index dcce83f3..132d7c72 100755 --- a/tools/bin/mbedtls-check-missing-changelog +++ b/tools/bin/mbedtls-check-missing-changelog @@ -12,8 +12,6 @@ This script uses heuristics: revision range. * Pull requests that modify ChangeLog or ChangeLog.d in any way are assumed to be ok. -* Pull requests whose last commit before merging has an @arm.com author - are assumed to be team PR where we put a changelog entry if necessary. EOF } @@ -29,9 +27,6 @@ fi revision_range=$1 merge_commits=$(git log --merges --first-parent --format=%H $revision_range) for c in $merge_commits; do - if [[ $(git log -n1 --format=%ae $c\^2) == *@arm.com ]]; then - continue - fi if git diff --name-only $c~1 $c | grep -q ChangeLog; then continue fi From 06b47f2b5a5dd8a2cdfc47b9e5f89820f79dfc11 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 1 Jul 2021 12:05:18 +0200 Subject: [PATCH 3/3] Don't show diffs when listing commits Normally this script should only list merge commits without conflicts, so there shouldn't be a diff. But don't pollute the output if there is a diff. Signed-off-by: Gilles Peskine --- tools/bin/mbedtls-check-missing-changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bin/mbedtls-check-missing-changelog b/tools/bin/mbedtls-check-missing-changelog index 132d7c72..21346606 100755 --- a/tools/bin/mbedtls-check-missing-changelog +++ b/tools/bin/mbedtls-check-missing-changelog @@ -30,5 +30,5 @@ for c in $merge_commits; do if git diff --name-only $c~1 $c | grep -q ChangeLog; then continue fi - git show --oneline $c | grep . + git show -s --oneline $c | grep . done