Skip to content

Add rcdn -D cleanup for dangling managed symlinks - #312

Open
alexg0 wants to merge 4 commits into
thoughtbot:mainfrom
alexg0:rcdn-dangling-symlink-cleanup
Open

alexg0 wants to merge 4 commits into
thoughtbot:mainfrom
alexg0:rcdn-dangling-symlink-cleanup

Conversation

@alexg0

@alexg0 alexg0 commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Add rcdn -D cleanup for dangling managed symlinks.
The cleanup respects selected dotfiles roots and FILE arguments, exclusions and inclusion overrides, and host/tag selection.
It preserves hooks and ambiguous source paths rather than treating them as removable managed links.

The earlier follow-up fixed multiple selected FILE arguments and dotfiles roots, preserved spaces/backslashes in link names, and replaced invalid removal assertions (-e is already false for dangling links) with -h checks.

Selection fix (2026-09-09)

The previous -D pass checked root membership and positional filenames but skipped exclusion and host/tag scope.
The expanded regression reproduced deletion of links that should have been preserved before this fix.

  • Reuse the existing exclusion helpers by moving them unchanged from lsrc into the shared library; apply them to missing source paths and excluded ancestors.
  • Respect CLI/config selection and parse the -I argument correctly.
  • Keep exclusion globs literal while matching, even when the caller's working directory contains matching live files.
  • Preserve source paths containing repeated separators or dot segments, preventing ambiguous classification and an ancestor-walk loop.
  • Match explicit nested FILE exclusion spelling consistently with lsrc.

Verification

  • Full make check: all 48 integration cases pass.
  • Expanded dangling-link regressions cover exclusions, inclusion overrides, tags, hosts, hooks, caller-directory glob expansion, and ambiguous paths.
  • Shell syntax checks and git diff --check pass.
  • Independent correctness and ponytail reviews completed on the final patch; no outstanding findings or justified complexity cuts.

Current upstream main at f1e5b2d was included in the earlier follow-up; published history is preserved.
These are local test results, not a claim of hosted CI or deployment verification.

@alexg0
alexg0 requested a review from DoodlingDev as a code owner February 10, 2026 23:38
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.

1 participant