Skip to content

[codex] Ignore fsmonitor config in Git metadata reads#22652

Merged
bookholt-oai merged 1 commit into
mainfrom
codex/ignore-fsmonitor-for-git-metadata
May 14, 2026
Merged

[codex] Ignore fsmonitor config in Git metadata reads#22652
bookholt-oai merged 1 commit into
mainfrom
codex/ignore-fsmonitor-for-git-metadata

Conversation

@bookholt-oai
Copy link
Copy Markdown
Contributor

Summary

  • keep Git metadata/status subprocesses independent of repository core.fsmonitor configuration
  • preserve existing working-tree state reporting while making the helper behavior more predictable
  • add regression coverage for get_has_changes when a repository defines an fsmonitor command

Validation

  • cargo fmt --all
  • cargo test -p codex-core test_get_has_changes_
  • cargo test -p codex-git-utils

@bookholt-oai bookholt-oai marked this pull request as ready for review May 14, 2026 15:58
@bookholt-oai bookholt-oai requested a review from a team as a code owner May 14, 2026 15:58
Copy link
Copy Markdown
Contributor

@evawong-oai evawong-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated PR 22652 at head 37f8213.

Result: approve.

Validation performed:

  1. Checked out the PR head and verified the worktree HEAD matched 37f8213 before running the test.
  2. Added a targeted regression that exercises the changed metadata path through get_has_changes.
  3. The test creates a temporary Git repository, writes a repository configured core.fsmonitor helper, and configures Git to use that helper.
  4. The helper payload writes a marker file if Git invokes it. That marker is the signal for the reported behavior.
  5. The test then writes an untracked file and calls get_has_changes, which runs the Codex Git metadata path that now invokes git with core.fsmonitor disabled.

Observed result:

  1. get_has_changes returned Some(true), so Codex still detected the working tree change.
  2. helper_ran was false, so the repository controlled core.fsmonitor helper did not execute.
  3. The targeted test passed with 1 passed and 0 failed.

Relevant validation output:

ZDI_31270_AFTER_PR_FSMONITOR_VALIDATION has_changes=Some(true) helper_ran=false
test git_info_tests::zdi_31270_fsmonitor_after_pr_get_has_changes ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1743 filtered out; finished in 0.23s

Security conclusion: this validates the specific reported fsmonitor execution path after the PR. The metadata read still works, but a repository supplied core.fsmonitor helper is not executed during get_has_changes on the patched head.

@bookholt-oai bookholt-oai merged commit 6ec8c4a into main May 14, 2026
45 of 47 checks passed
@bookholt-oai bookholt-oai deleted the codex/ignore-fsmonitor-for-git-metadata branch May 14, 2026 17:07
@github-actions github-actions Bot locked and limited conversation to collaborators May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants