Repository navigation
Drop the filter-override listing from the .git guard's object read (#512) - #520
Merged
Merged
Conversation
There was a problem hiding this comment.
Round 1 — reviewed head 22f1981c — reviewer summarizer:hermes/gpt-5.6-terra over coverage+credentials+deployment+general+lifecycle+prose.
terra
Advisory findings from outerloop — the code owner decides. Reply to disagree; the outerloop:no-review label opts this PR out.
Verdict: nothing blocking — 1 advisory note.
1 finding attached to the lines below.
Merged verdict: one non-blocking coverage suggestion. Rejected findings: none.
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.
Fixes part of #512. Before this change, every guarded kernel git call ran four subprocesses: the
.gitguard's own object read (cat-file -e), agit config --get-regexpfilter-override listing for that read, another listing for the real command, and the real command. The listing for the guard's read is useless.cat-file -eonly resolves an object in the store and never converts working-tree files, so no filter driver can run in it.The change: the guard's read calls
_git_env(None), with no root, so no listing runs. It keeps the rest of the git environment: global and system config pinned to/dev/null,GIT_NO_REPLACE_OBJECTS,core.attributesFile=/dev/null, and theSAFE_GIT_FLAGSargv. The real command's listing is untouched, so its position and freshness are unchanged: it still runs after the config sanitize and immediately before the command. Nothing is cached, and nothing that is refused or neutralized changes.Measured on the slowest test,
test_author_sleep_wake_keeps_its_snapshot_when_the_terminal_record_fails:tests/test_attempt.pyruns about 12% faster (≈134 s → 117 s)Production saves one subprocess on every guarded git call.
Rejected alternatives:
cat-file. That would weaken the guard, becausecat-file -einflates the object and rejects a corrupt one.The remaining cost in #512 is the guard's
cat-fileitself and the per-call listing. Both are left open.Built by GLM-5.3 (self-reviewed, with a call-site audit), security-reviewed by Codex (clean), final read and simplification by Claude Opus 5.5. GLM's version added a
pairsparameter to_git_env, which turned out to be unnecessary.