Skip to content

fix(ls): preserve entries whose names end in dots - #4305

Open
pavelbe wants to merge 1 commit into
rtk-ai:developfrom
pavelbe:fix/ls-trailing-dot-entries
Open

pavelbe wants to merge 1 commit into
rtk-ai:developfrom
pavelbe:fix/ls-trailing-dot-entries

Conversation

@pavelbe

@pavelbe pavelbe commented Sep 27, 2026

Copy link
Copy Markdown

Summary

rtk ls silently drops real entries such as report., directories ending in a dot, and link -> .. The dot-directory check treated any line ending in . as . or ...

Recognize only literal dot-directory names after the listing metadata. Preserve filename whitespace and retain raw fallback for unrecognized locale rows. The change is confined to the existing ls filter and its tests.

Test plan

  • Regression failed before the fix on report.; 41 ls tests pass after it.
  • cargo test --all-targets: 4034 passed, 8 ignored, 0 filtered.
  • cargo clippy --all-targets -- -D warnings, formatting check and build pass.
  • Native CLI smoke with real files, a directory and a symlink: trailing dots and filename whitespace survive; literal dot directories remain omitted.

Tests used disposable HOME/XDG paths with inherited agent-config overrides cleared; protected host configuration hashes stayed unchanged. The complete suite used Git 2.51.0 because an unchanged Git error-text test is version-dependent on Git 2.43.

AI assistance: implemented and reviewed with OpenAI Codex; the regression and local checks above were executed. No Windows or macOS runtime validation is claimed.

@rtk-wshm-sync-bot rtk-wshm-sync-bot Bot added bug Something isn't working ls parsing labels Sep 27, 2026
@rtk-wshm-sync-bot

Copy link
Copy Markdown

wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟢 Risk low

Summary

Fixes a bug in rtk ls where any line ending in a literal '.' character (e.g. filenames like 'report.', or symlinks pointing to '.') was incorrectly treated as a '.' or '..' pseudo-directory entry and dropped. The fix restricts dot-directory detection to lines that match the actual ls listing format with a literal dot-directory name after the date field, adding a fallback regex for localized month names and raw-fallback handling for unrecognized locale rows.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Analyzed automatically by wshm · This is an automated analysis, not a human review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ls parsing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant