Skip to content

scripts: let pr-wait.sh --sha take an abbreviated commit id - #219

Merged
linyiru merged 1 commit into
mainfrom
pr-wait-short-sha
Nov 8, 2026
Merged

linyiru merged 1 commit into
mainfrom
pr-wait-short-sha

Conversation

@linyiru

@linyiru linyiru commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

pr-wait.sh --sha compared its value with the PR's full head id. An abbreviated id, such as git log --oneline prints, therefore never matched. pr-wait logged waiting for head a0e6b74; the PR is at a0e6b74fc62… on every poll, and gave up only when the 30-minute deadline ran out, long after the checks had finished. An agent hit this four times in one session.

An id of 7 or more hex digits now matches as a prefix of the head. A shorter one is a usage error, because it could match a commit nobody meant. The test fixtures use full 40-digit ids, and there is a test for the abbreviated case.

--sha compared its value with the PR's full head id, so an abbreviated id such as git log --oneline prints never matched: pr-wait reported 'waiting for head a0e6b74; the PR is at a0e6b74...' every poll and gave up after the whole 30-minute deadline, long after the checks had finished. An id of 7 or more hex digits now matches as a prefix; a shorter one is a usage error.

Signed-off-by: Yi-Ru Lin <deduce@gmail.com>
@linyiru
linyiru enabled auto-merge November 8, 2026 05:23
@linyiru
linyiru merged commit ee115bd into main Nov 8, 2026
7 checks passed
@linyiru
linyiru deleted the pr-wait-short-sha branch November 8, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant