Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 920f5177de716d41851e4b98f59989d9f9b5fad5
https://github.com/WebKit/WebKit/commit/920f5177de716d41851e4b98f59989d9f9b5fad5
Author: Zak Ridouh <[email protected]>
Date: 2026-08-25 (Tue, 25 Aug 2026)
Changed paths:
M Tools/Scripts/hooks/prepare-commit-msg
Log Message:
-----------
[git webkit] prepare-commit-msg fails to amend when the checkout is older
than the installed hook
https://bugs.webkit.org/show_bug.cgi?id=322514
rdar://185816251
Reviewed by Alex Christensen.
The hook is rendered into .git/hooks, but it imports webkitscmpy from the
checkout, so a hook installed from main runs against whatever branch is checked
out. Amending on a branch cut before 319270@main raised the following
error:
AttributeError: 'CommitMessageParser' object has no attribute 'reconcile_tests'
and aborted the commit.
Call reconcile_tests only when the parser has it and keep the tests section as
written otherwise, so amending still updates the file list. Every other parser
call here carries the same hazard, so move them under the existing ImportError
guard and catch AttributeError as well. An out-of-date checkout now falls back
to the commit message as written instead of failing the commit, the same way
pre-push tolerates a checkout too old for its imports.
* Tools/Scripts/hooks/prepare-commit-msg:
Canonical link: https://commits.webkit.org/319828@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications