Conversation
…loses #6009) With no target/*/tri the hook ran whatever `command -v tri` named. Two unrelated `tri` programs on one machine (an ops script, exit 1; an April build without `hooks`, exit 2) each refused every commit in an unbuilt checkout once core.hooksPath pointed at .githooks. - A PATH tri is used only if `tri hooks pre-commit --help` answers 0; otherwise the hook says it was not used. - With no usable tri the conflict-marker gate still runs (python3 tools/check_conflict_markers.py --staged, same exit vocabulary), and the note says the census and fix( gates did not run. - scripts/ci/test_pre_commit_hook_ignores_a_foreign_tri.py: 17 checks in a fixture repository with its own PATH. Against master's hook 14 of them fail by name (negative control); the 3 that pass are the controls that this repository's tri is still used and still blocks. - loop-tools-gate.yml runs it (no compiler needed) and its paths: filters now include .githooks/pre-commit and tools/check_conflict_markers.py. Census moved: shell `run: steps` 264 -> 265 and `the runner does` 243 -> 244, the one new loop-tools-gate step. Re-blessed here. Refs #5933 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
This was referenced Oct 4, 2026
Merged
Merged
Merged
This was referenced Oct 4, 2026
Merged
This was referenced Oct 4, 2026
Open
This branch has not been deployed
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.
Closes #6009. Refs #5933.
What was wrong
.githooks/pre-commitlooks fortarget/{debug,release}/triand, failing that, ran whatevercommand -v trinamed.triis a common name. On the owner's machine PATH held two other programs:tri hooks pre-commit~/.local/bin/triunknown command: hooks, exit 1~/.cargo/bin/trihooksOnly 5 of 38 checkouts on that machine have a local build. Once
core.hooksPathpointed at.githooks, every commit in the other 33 was refused by a message that named no defect in the commit.The change
triis used only iftri hooks pre-commit --helpanswers 0. That is the help of the exact subcommand the hook runs, and asking for help runs no gate. Otherwise the hook printsnote: <path> is not this repository's tri ...; not used.python3 tools/check_conflict_markers.py --staged, the same script and operand tri calls. Exit 1 refuses; any other non-zero prints "could NOT RUN" and refuses, as through tri. The note now says that the census and fix( gates did not run, instead of "nothing was checked". If python3 or the script is missing, it says markers were not checked either and lets the commit through, as before.scripts/ci/test_pre_commit_hook_ignores_a_foreign_tri.pychecks this in a fixture repository with its own PATH, so the machine's owntricopies cannot change the answer. It runs inloop-tools-gate.yml's no-compiler job, and that workflow'spaths:now include.githooks/pre-commitandtools/check_conflict_markers.py.Evidence
--hookpointed at master's hook. 14 of 17 checks fail by name, for examplecalls: ['hooks pre-commit']andexit 1: unknown command: hooks (tri help). The 3 that pass are the controls: this repository's tri on PATH is still used, and still blocks when it says no.~/.local/bin/tri. A clean index gives exit 0 and the notes above. A staged conflict marker givescarrying a conflict marker 1, exit 1.tri census pin --gate: one census moved. In shell,run: stepswent 264 -> 265 andthe runner does243 -> 244; that is the one new step. Re-blessed in the same commit.check_pr_branch_filters.pyCLEAN,loop-tools-tracked.shPASS, ASCII only.Seen, not fixed here
fix_carries_source()incli/tri/src/hooks.rsreadsgit log -1 HEAD, which is the previous commit, not the one being made. That is a separate change to tri's Rust (see #6009).🤖 Generated with Claude Code