diff options
author | fanquake <fanquake@gmail.com> | 2023-10-09 15:00:55 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-10-09 15:03:13 +0100 |
commit | 4e7442e743afef4d365fc3ce7c6e9f0a5d4d1ec4 (patch) | |
tree | 15d6ed34a0a0b0a73b1f237102528ec6e0dea57a /contrib | |
parent | 3003861e78a4118ebc8a9063d15de5062bafa4c0 (diff) | |
parent | 88c8e3a0e4d6bee015a348536c6e12a2c7835896 (diff) |
Merge bitcoin/bitcoin#28573: github actions: Fix test-one-commit when parent of head is merge commit
88c8e3a0e4d6bee015a348536c6e12a2c7835896 github actions: Fix test-one-commit when parent of head is merge commit (Ryan Ofsky)
Pull request description:
Instead of figuring out the commit *after* the last merge and rebasing on that with a ~1 suffix, just figure out the last merge commit directly and rebase on it. This way, if HEAD happens to be a merge commit, the rebase just succeeds immediately without blank variables or errors.
Explanation of the problem from https://github.com/bitcoin/bitcoin/pull/28497#issuecomment-1743430631:
> The problem is that the PR only contains a one commit after the last merge, so the job _should_ be skipped, but the `pull_request.commits != 1` check is not smart enough to skip it because the PR is based on another PR and has merge ancestor commits. So specifically what happens is that after HEAD~ is checked out, the new HEAD is a merge commit, so the range `$(git log --merges -1 --format=%H)..HEAD` is equivalent to HEAD..HEAD, which is empty, so the `COMMIT_AFTER_LAST_MERGE` variable is empty and the rebase command fails.
Note: In the current version of this PR, the "test each commit" job is skipped, because this PR only contains a single commit. But I manually verified the code works in earlier versions of the PR that included dummy commits.
ACKs for top commit:
maflcko:
lgtmrecr ACK 88c8e3a0e4d6bee015a348536c6e12a2c7835896
RandyMcMillan:
utACK 88c8e3a
Tree-SHA512: a6865b5c8b96eb0b622b3255971a3cf050dd0f5a356cdfcf7f0cbb659e4a363612e8e62b3ae4fd6b5d9a40bc29176891bc4690659b026c5ef8feea25c8e263cc
Diffstat (limited to 'contrib')
0 files changed, 0 insertions, 0 deletions