Repository navigation
Conversation
The commit-msg hook exempted fixup!, squash! and amend! subjects, and the pre-push hook and CI replay messages through the same script, so three fixup! commits reached pull request 462 unjudged. They are now refused with the fold that fixes them, in all three places. The first-word check also learns the remaining forms of the verbs it named, so "Wires" is refused as "Wiring" already was.
A hook that lost its executable bit, or a global core.hooksPath, never touched a file Cargo watches, so build.rs could not notice either and only warned when it did. The check now lives in scripts/hook-check, a workspace member whose build script reruns on every build, so only that empty crate recompiles. A build whose hooks cannot be put in effect fails with the installer's instructions; CODETRIAL_SKIP_HOOKS=1 opts out, and CI sets it. cargo test and commands naming their targets leave the check out. The installer now asks git once and returns early when every hook is in effect, and indent.sh covers the new crate.
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.
Pull request #462 landed three
fixup!commits because the commit-msg hook exempted autosquash subjects, and the pre-push hook and the CI commit-log step replay messages through that same script. The first commit refusesfixup!,squash!andamend!subjects in that script, so they are blocked at commit, at push and in CI alike, andCONTRIBUTING.mdsays so. It also completes the verb forms the first-word check already named ("Wires" is refused as "Wiring" was).The second commit makes
cargo buildhold a checkout to its hooks. Cargo only notices a change by mtime, sochmod -xon a hook or a globalcore.hooksPathwas invisible to the oldbuild.rs, which also only warned. The check moves intoscripts/hook-check, an empty workspace member whose build script reruns on every build, so only that crate recompiles and the server does not. A build whose hooks cannot be put in effect now fails with the installer's own instructions.CODETRIAL_SKIP_HOOKS=1opts out, CI sets it, and release builds name-p codetrial.cargo testand commands that name their targets leave the check out, whichdocs/development.mdlists.Verified with
scripts/test-git-hooks.sh(113 checks), a newBuildHooksTestsintests/test_test_gate.py(repairs a non-executable and a deleted hook, refuses a sharedcore.hooksPath, skips only onCODETRIAL_SKIP_HOOKS=1, installs only at the top of its own checkout), clippy with-D warnings, shellcheck, ruff andscripts/indent.sh --check. Removing the fixup rule, or the every-build rerun, fails the matching test. A no-opcargo buildcosts about 0.7s, roughly 0.5s of it Cargo rerunning an always-stale build script. The fullscripts/test.shgate did not finish green locally: browser tests timed out under machine load, a different set each run, and the ones I reran alone passed.Anyone with a global
core.hooksPathor a hook manager writing into.git/hooksnow gets a failed build until they follow the printed instructions or setCODETRIAL_SKIP_HOOKS=1. #471 editsabs()inscripts/install-git-hooks.sh, a few lines from the lines this changes, so whichever merges second will need a small rebase. #462 still carries its threefixup!commits and needsgit rebase -i --autosquash.