Skip to content

Commit 873dcc1

Browse files
committed
Merge bitcoin/bitcoin#27058: contrib: Improve verify-commits.py to work with maintainers leaving
14fac80 verify-commits: Mention git v2.38.0 requirement (Andrew Chow) bb86887 verify-commits: Skip checks for commits older than trusted roots (Andrew Chow) 5497c14 verify-commits: Use merge-tree in clean merge check (Andrew Chow) 76923bf verify-commits: Remove all allowed commit exceptions (Andrew Chow) 53b07b2 verify-commits: Move trusted-keys valid sig check into verify-commits itself (Andrew Chow) Pull request description: Currently the `verify-commits.py` script does not work well with maintainers giving up their commit access. If a key is removed from `trusted-keys`, any commits it signed previously will fail to verify, however keys cannot be kept in the list as it would allow that person to continue to push new commits. Furthermore, the `trusted-keys` used depends on the working tree which `verify-commits.py` itself may be modifying. When the script is run, the `trusted-keys` may be the one that is intended to be used, but the script may change the tree to a different commit with a different `trusted-keys` and use that instead! To resolve these issues, I've updated `verify-commits.py` to load the `trusted-keys` file and check the keys itself rather than delegating that to `gpg.sh` (which previously read in `trusted-keys`). This avoids the issue with the tree changing. I've also updated the script so that it stops modifying the tree. It would do this for the clean merge check where it would checkout each individual commit and attempt to reapply the merges, and then checking out the commit given as a cli arg. `git merge-tree` lets us do basically that but without modifying the tree. It will give us the object id for the resulting tree which we can compare against the object id of the tree in the merge commit in question. This also appears to be quite a bit faster. Lastly I've removed all of the exception commits in `allow-revsig-commits`, `allow-incorrect-sha512-commits`, and `allow-unclean-merge-commits` since all of these predate the commits in `trusted-git-root` and `trusted-sha512-root`. I've also updated the script to skip verification of commits that predate `trusted-git-root`, and skip sha512 verification for those that predate `trusted-sha512-root`. ACKs for top commit: Sjors: ACK 14fac80 glozow: Concept ACK 14fac80 Tree-SHA512: f9b0c6e1f1aecb169cdd6c833b8871b15e31c2374dc589858df0523659b294220d327481cc36dd0f92e9040d868eee6a8a68502f3163e05fa751f9fc2fa8832a
2 parents be2e748 + 14fac80 commit 873dcc1

File tree

6 files changed

+45
-876
lines changed

6 files changed

+45
-876
lines changed

contrib/verify-commits/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ Note that the above isn't a good UI/UX yet, and needs significant improvements
2727
to make it more convenient and reduce the chance of errors; pull-reqs
2828
improving this process would be much appreciated.
2929

30+
Unless `--clean-merge 0` is specified, `verify-commits.py` will attempt to verify that
31+
each merge commit applies cleanly (with some exceptions). This requires using at least
32+
git v2.38.0.
33+
3034
Configuration files
3135
-------------------
3236

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
f8feaa4636260b599294c7285bcf1c8b7737f74e
2-
8040ae6fc576e9504186f2ae3ff2c8125de1095c

0 commit comments

Comments
 (0)