Conversation
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.
This adds commit-log validation (check-commitlog.sh) that ensures every non-merge commit after 4a46a13 carries a Change-Id and meets subject line formatting rules. For commits after 5aa6396, the SHA-1 must start with "0000".
The vanity hash rewriter (vanity-hash.py) uses partial SHA-1 caching via hashlib.copy() with minimal space/tab padding (16 byte, 1 bit per byte). Each brute-force attempt hashes only the final block -- ~4096 expected attempts for a 12-bit prefix, sub-millisecond on any CPU.
Change-Id: Iadd4b0f9e8c7d6a5b3f2e1d0c9b8a7f6e5d4c3b2
Summary by cubic
Enforces commit hygiene across hooks and CI: every non-merge commit must include a Change-Id, follow subject rules, and (for newer commits) use a vanity SHA-1 prefix "0000". Adds fast, automatic hash rewriting and blocks non-compliant pushes/PRs.
New Features
scripts/check-commitlog.shvalidates non-merge commits since the enforcement point: requires Change-Id, capitalized subject (no trailing dot, sane length), warns on WIP, and flags GitHub web-UI bypass; enforces SHA-1 prefix "0000" for newer commits; supports--rangefor PR/push checks.scripts/vanity-hash.pyrewrites HEAD to match a hex prefix (default "0000") with fast SHA-1 caching; prefix configurable viagit config kbox.vanity-prefix; supports--prefixand--dry-run.scripts/pre-push.hookvalidates only the commits being pushed (handles new branches);scripts/post-commit.hookauto-applies the vanity prefix and skips CI; new CI job runs commit checks on PRs/pushes; addedmake check-commitlog;.gitignorenow ignores__pycache__.Migration
make install-hooks. If validation fails, amend/rebase to add a Change-Id and fix the subject; the vanity rewrite runs automatically after commit or viapython3 scripts/vanity-hash.py. Avoid--no-verifyand creating commits in the GitHub web UI.Written for commit 000013d. Summary will update on new commits.