Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions tools/bin/mbedtls-check-missing-changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
set -e

help () {
cat <<EOF
Usage: $0 REVISION_RANGE
Find Mbed TLS pull requests in the specified range of revisions that seem
to be missing a changelog entry.

This script uses heuristics:
* Pull requests are merge commits on the first-parent-path in the specified
revision range.
* Pull requests that modify ChangeLog or ChangeLog.d in any way are assumed
to be ok.
EOF
}

if [[ $# -ne 1 ]]; then
help >&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)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we always merge through GitHub, we could use a more sensitive search to only catch PR merges and not merges from inside PR.

for c in $merge_commits; do
if git diff --name-only $c~1 $c | grep -q ChangeLog; then
continue
fi
git show -s --oneline $c | grep .
done