Repository navigation
Say nothing to delete instead of asking to delete zero files [patch] - #183
Merged
Merged
Conversation
Since empty files stopped being deleted, a tree whose only duplicates are empty marker files (__init__.py, .gitkeep) planned zero deletions but still reached the confirmation prompt, so a non-interactive run read EOF, printed "Aborted." and exited 1. Deduplicate now returns early with exit 0 when the plan deletes nothing, and Scan only suggests Deduplicate when some group has a deletable copy. Fixes #176 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019BwRbgKQMY5pZraxHBjxqM
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #176
Summary
Empty files stopped being deleted in #151. Since then, a tree whose only duplicates are empty marker files (
__init__.py,.gitkeep) planned zero deletions but still reachedProceed with deletion? (y/N). A non-interactive run read EOF, printedAborted.and exited 1.Deduplicate: right afterPlanDeletions, whenplan.FileCount == 0it printsNothing to delete (only empty-file duplicates found).and returns with exit code 0. It no longer prompts or reads stdin.Scan: prints the "Run the 'Deduplicate' command" hint only when at least one group has a deletable copy.DryRunandStatsalready reportFiles to delete: 0andEmpty duplicates (never deleted)accurately, so they are unchanged.Tests
OnlyEmptyDuplicatesSkipTheConfirmationAndSucceed: runs with empty stdin and asserts exit 0, no prompt, noAborted., and that both empty files survive.ScanDoesNotSuggestDeduplicateWhenOnlyEmptyDuplicatesExist🤖 Generated with Claude Code
https://claude.ai/code/session_019BwRbgKQMY5pZraxHBjxqM
Generated by Claude Code