Repository navigation
.github/workflows/check.yml: Compute the checkpatch range from the merge base. - #3854
Merged
Merged
Conversation
…rge base. The check job checked github.event.pull_request.base.sha..HEAD. HEAD is the merge commit that GitHub made for the pull request, and that merge commit can be on an older base than base.sha. checkpatch then diffs the two endpoints, so every change on master since that older base looks like a change of the pull request. Old files in that range fail the check. Fetch the base branch and check from the merge base of the base branch and HEAD. This is the same change as apache/nuttx#20696. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
xiaoxiang781216
approved these changes
Oct 16, 2026
raiden00pl
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The check job runs checkpatch on
github.event.pull_request.base.sha..HEAD.HEADis the merge commit that GitHub made for the pull request, and that merge commit can be on an older base thanbase.sha. checkpatch diffs the two endpoints, so every change on master since that older base looks like a change of the pull request, and old style errors in those files fail the check.This happened on apache/nuttx#20640: its merge commit was on an old master, and
checkfailed with nxstyle errors in three files that the PR does not touch.This PR fetches the base branch and checks from the merge base of the base branch and
HEAD. It is the same change as apache/nuttx#20696.Impact
CI only. The check job checks only the commits and files of the pull request.
Testing
Simulated with apps PR #3846 (fork point 7e03b98, master 12 commits ahead). I made a merge commit of its head on an older master (467e220), with
base.sha= master b1a17ba:.github/workflows/build.ymland the same commit, which is the PR's own change.With a merge commit on the current base, both ranges are the same.
tools/checkpatch.sh -c -u -m -gpasses.