Skip to content

fix(rg): align -u ignore classes with --no-ignore#1751

Merged
chaliy merged 1 commit into
mainfrom
2026-05-25-fix-rg-ignore-class-toggles-in-u-flag
May 25, 2026
Merged

fix(rg): align -u ignore classes with --no-ignore#1751
chaliy merged 1 commit into
mainfrom
2026-05-25-fix-rg-ignore-class-toggles-in-u-flag

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented May 25, 2026

Motivation

  • Make -u/--unrestricted match --no-ignore semantics by disabling all per-class ignore toggles on the first -u so later positive flags only re-enable their intended classes.
  • Fix bug where -u --ignore-dot unintentionally left VCS/exclude/global/parent ignore classes enabled, causing incorrect ignore-file loading.

Description

  • Updated RgOptions::apply_unrestricted to set no_ignore_dot, no_ignore_exclude, no_ignore_global, no_ignore_parent, and no_ignore_vcs when no_ignore is first set.
  • Added a differential test case unrestricted and ignore-dot only restores dot ignores to prevent regressions in partial re-enable behavior.
  • Modified file: crates/bashkit/src/builtins/rg/mod.rs.

Testing

  • Ran cargo test -p bashkit builtins::rg::tests -- --nocapture and the test run exercised the rg suite; the new/related rg tests passed while one unrelated existing differential test (diff_rg_matches_real_rg_cases) failed due to a timing-line mismatch.
  • The added differential case for -u --ignore-dot executed and matched the expected output in the test run.

Codex Task

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 25, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit d6b2135 Commit Preview URL May 25 2026, 04:33 PM

When -u/--unrestricted is first applied (level 1) it now disables all
per-class ignore toggles (no_ignore_dot, no_ignore_exclude,
no_ignore_global, no_ignore_parent, no_ignore_vcs) in addition to
no_ignore, matching real ripgrep behavior. This way later positive
flags such as --ignore-dot can re-enable only their intended class.

Adds a differential regression case '-u --ignore-dot'.

Rebased on current main on top of #1754; original PR #1751 by chaliy.
@chaliy chaliy force-pushed the 2026-05-25-fix-rg-ignore-class-toggles-in-u-flag branch from 58c8fe9 to d6b2135 Compare May 25, 2026 15:10
@chaliy chaliy merged commit 901587e into main May 25, 2026
33 checks passed
@chaliy chaliy deleted the 2026-05-25-fix-rg-ignore-class-toggles-in-u-flag branch May 25, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant