Skip to content

fix issues #174 (#2)#390

Merged
Dimillian merged 2 commits intoDimillian:mainfrom
MasonChow:main
Feb 10, 2026
Merged

fix issues #174 (#2)#390
Dimillian merged 2 commits intoDimillian:mainfrom
MasonChow:main

Conversation

@MasonChow
Copy link
Contributor

Fixes #174
This PR fixes an inconsistency where globally ignored files can still appear in CodexMonitor’s Git UI (especially in unstagedFiles), even though git status/

Example pattern:

  • global ignore: ignored_root
  • file path: ignored_root/example/foo/bar.txt

Actual (before this PR):

Root Cause

Solution

1) Add parent-directory ignore detection

Introduce a helper that walks up ancestor directories and checks whether any parent is ignored.

  • New helper logic:
    • has_ignored_parent_directory(...)
    • integrated into should_skip_ignored_path(...)

2) Apply the same filter consistently in UI-facing Git paths

Use should_skip_ignored_path(...) in:

  • get_git_status_inner(...) (before adding entries to files/stagedFiles/unstagedFiles)
  • get_git_diffs_inner(...)
  • build_combined_diff(...) (by passing repo in and filtering deltas there as well)

This keeps status and diff behavior aligned.

Why this approach

  • Keeps existing architecture intact (single shared filtering utility).
  • Minimal behavioral surface change: only filters entries that should already be ignored.
  • Avoids project-specific hardcoded path rules.
  • Works with generic ignore patterns (not tied to .claude/*).

Tests

Added/updated tests in src-tauri/src/shared/git_ui_core.rs:

  1. get_git_status_omits_global_ignored_paths
  • configures core.excludesfile with ignored_root
  • creates ignored_root/example/foo/bar.txt
  • verifies unstagedFiles does not include ignored path
  1. get_git_diffs_omits_global_ignored_paths
  • same setup
  • verifies diff list does not include ignored path

Note: test identifiers use neutral paths (ignored_root/example/foo/bar.txt) to avoid project-specific naming.

Validation

Ran:

  • cargo test --manifest-path src-tauri/Cargo.toml get_git_status_omits_global_ignored_paths -- --nocapture
  • cargo test --manifest-path src-tauri/Cargo.toml get_git_diffs_omits_global_ignored_paths -- --nocapture

Both pass.

Risk / Compatibility

Low risk:

  • Changes are scoped to filtering of ignored paths in Git UI data collection.
  • No command behavior or data model changes.
  • No frontend API shape changes.

@Dimillian
Copy link
Owner

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Dimillian Dimillian merged commit ba0378f into Dimillian:main Feb 10, 2026
6 checks passed
gersmann pushed a commit to gersmann/codex-monitor-web that referenced this pull request Mar 10, 2026
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

【BUG】diff not respecting .gitignore_global settings

2 participants