proposal: leave empty files out of report and trees #178

Closed
opened 2026-11-11 01:06:06 +01:00 by clawbot · 3 comments
Collaborator

Proposal from the acceptance test (#164). It needs your decision before anyone builds it.

What is missing

Empty files are reported as duplicates of each other, and no option leaves them out.

  • report puts every empty file in the database in one group.
  • trees reports directories that hold only empty files as duplicate trees of 0 bytes.

Example from the test: six empty files (.gitkeep and the like) gave five report rows, and two directories holding one .gitkeep each gave this trees row:

first	dupe	files	size	disk_size
.../emptyA	.../emptyB	1	0	512

On a real machine these are every __init__.py, .gitkeep, lock file and empty log: thousands of rows that free nothing. They sort last, so they do not hide the large duplicates, but they inflate the group and file counts in both summaries.

This is as specified. The test in README.md under "Definition of done" expects the pair empty1 and empty2 in the report, and has since your first version of the spec. So it is a question, not a bug.

Why a user expects it

Removing an empty file frees nothing. jdupes leaves empty files out unless -z is given, and fdupes has -n for it.

Your choices

  • Reports leave out empty files: report drops the group of size 0, and trees drops a group whose trees hold 0 bytes. An empty file still counts toward the digest of a tree that holds other files. No option. The README's test loses its empty1 and empty2 pair.
  • A minimum size option: report --min-size N and trees --min-size N leave out groups below N bytes, and the default keeps today's output. It also serves a user who only cares about large files, at the price of a flag on two commands.
  • Leave as is: the user filters the output on the size column.

Recommended: Reports leave out empty files.

Model: fable-5-2

Proposal from the acceptance test (https://git.eeqj.de/sneak/sfdupes/issues/164). It needs your decision before anyone builds it. ## What is missing Empty files are reported as duplicates of each other, and no option leaves them out. - `report` puts every empty file in the database in one group. - `trees` reports directories that hold only empty files as duplicate trees of 0 bytes. Example from the test: six empty files (`.gitkeep` and the like) gave five `report` rows, and two directories holding one `.gitkeep` each gave this `trees` row: ``` first dupe files size disk_size .../emptyA .../emptyB 1 0 512 ``` On a real machine these are every `__init__.py`, `.gitkeep`, lock file and empty log: thousands of rows that free nothing. They sort last, so they do not hide the large duplicates, but they inflate the group and file counts in both summaries. This is as specified. The test in `README.md` under "Definition of done" expects the pair `empty1` and `empty2` in the report, and has since your first version of the spec. So it is a question, not a bug. ## Why a user expects it Removing an empty file frees nothing. `jdupes` leaves empty files out unless `-z` is given, and `fdupes` has `-n` for it. ## Your choices - **Reports leave out empty files**: `report` drops the group of size 0, and `trees` drops a group whose trees hold 0 bytes. An empty file still counts toward the digest of a tree that holds other files. No option. The README's test loses its `empty1` and `empty2` pair. - **A minimum size option**: `report --min-size N` and `trees --min-size N` leave out groups below `N` bytes, and the default keeps today's output. It also serves a user who only cares about large files, at the price of a flag on two commands. - **Leave as is**: the user filters the output on the size column. Recommended: **Reports leave out empty files**. Model: fable-5-2
sneak was assigned by clawbot 2026-11-11 01:06:06 +01:00
Owner

rec approved

rec approved
Author
Collaborator

sneak approved the recommendation above (chat via tracker, 11 November about 02:20 UTC); it is the definition of done, built as one PR into next with tests and README changes.

Model: opus-5-5

sneak approved the recommendation above (chat via tracker, 11 November about 02:20 UTC); it is the definition of done, built as one PR into `next` with tests and README changes. Model: opus-5-5
sneak was unassigned by clawbot 2026-11-11 03:24:00 +01:00
Author
Collaborator

Built in #183: report drops the size-0 group, trees drops groups of 0-byte trees, and empty files still count toward a tree's digest. No option.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/sfdupes/pulls/183: `report` drops the size-0 group, `trees` drops groups of 0-byte trees, and empty files still count toward a tree's digest. No option. Model: opus-5-5
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/sfdupes#178