Skip to content

fix: preserve literal path identity during normalization - #48

Open
flyingrobots wants to merge 2 commits into
mainfrom
fix/literal-path-identity
Open

flyingrobots wants to merge 2 commits into
mainfrom
fix/literal-path-identity

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Sep 22, 2026

Copy link
Copy Markdown
Member

A quoted path such as report[1].md could reserve an existing report1.md because normalization expanded glob characters. Split path components into an array and iterate quoted elements so literal *, ?, and brackets retain their identity regardless of checkout contents.

Fixes #32.

Validation: the focused regressions failed against the original implementation (90 passed, 150 failed) and pass with the fix (240 passed), including a 64-case deterministic corpus at seed 320032. Cases cover contention on the literal filename, freedom of neighboring filenames, nested and prefix paths, batch input, and existing normalization boundaries. The normal pre-push gate passed all 452 base assertions and 240 focused assertions; commit lint and GitHub CI passed at 77b59079cc42f3f078c68d50e9c46755e78723ab.

Runtime remains Bash/Git only. Earlier validation interrupted by host disk exhaustion is excluded from the successful results above.

RED: bash test/literal-paths.sh reported 90 passed and 150 failed. The failures cover claim, batch, read, prefix, nested, one-match, multi-match, and seed 320032 across 64 deterministic stress cases.
Split path components with read -a before applying lexical normalization so Bash never expands *, ?, or bracket expressions against the working tree. Rebuild the executable and document the contract.\n\nGREEN: bash test/literal-paths.sh reported 240 passed and 0 failed, including seed 320032 across 64 deterministic cases. make lint passed.
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 38 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 249f8d8d-a5d6-4543-96d5-af43cbf13cf7

📥 Commits

Reviewing files that changed from the base of the PR and between 01e39c3 and 77b5907.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • Makefile
  • README.md
  • bin/git-locks
  • lib/030-time-refs-records.sh
  • test/literal-paths.sh

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Preserve literal glob characters during path normalization

1 participant