With -x, an operand that lies under another operand but is on a different filesystem is never walked. pruneRoots drops it before the walk as covered by the outer operand, and the outer operand's walk then declines to enter it because it is on another filesystem. So scan -x /srv /srv/pool2, with /srv/pool2 a separate filesystem, reaches none of the files under /srv/pool2, although the operator named it.
README "scan mode" says overlapping operands are harmless and every file is reached exactly once; "Rules for the walk" says that with -x each operand is bounded by its own filesystem. Here the nested operand's files are reached zero times, and nothing is warned about.
Where (next at 5900feb): pruneRoots in scan.go (an operand under another is dropped without regard to -x), and subdirJob in scan.go (the outer walk declines the directory on another filesystem).
Found while fixing #99 (#105 discloses it); it touches the same code, so it is fixed after that PR lands.
Definition of done
With -x, an operand under another operand is kept and walked as its own operand when it is on a different filesystem than the operand covering it. Without -x, and for a nested operand on the same filesystem, pruneRoots keeps dropping it as now.
A record under such a kept operand is verified by that operand's walk like any other: records of files that are gone are deleted. The rule that keeps records under a directory the walk declined (#99) does not apply under a directory that is itself a scanned operand.
README "scan mode" states the rule where it describes overlapping operands.
A test with a nested operand on another filesystem (with the device check stubbed, as the test for #99 does) fails before the fix because no file under it is walked, and passes after.
Severity: minor. It needs -x with nested operands on different filesystems; new files under the nested operand go unrecorded, and with #105 its existing records are kept but never checked, so a file changed or deleted there can still appear in the report as it was.
Model: opus-5-5
With `-x`, an operand that lies under another operand but is on a different filesystem is never walked. `pruneRoots` drops it before the walk as covered by the outer operand, and the outer operand's walk then declines to enter it because it is on another filesystem. So `scan -x /srv /srv/pool2`, with `/srv/pool2` a separate filesystem, reaches none of the files under `/srv/pool2`, although the operator named it.
README "`scan` mode" says overlapping operands are harmless and every file is reached exactly once; "Rules for the walk" says that with `-x` each operand is bounded by its own filesystem. Here the nested operand's files are reached zero times, and nothing is warned about.
Where (`next` at `5900feb`): `pruneRoots` in `scan.go` (an operand under another is dropped without regard to `-x`), and `subdirJob` in `scan.go` (the outer walk declines the directory on another filesystem).
Found while fixing https://git.eeqj.de/sneak/sfdupes/issues/99 (https://git.eeqj.de/sneak/sfdupes/pulls/105 discloses it); it touches the same code, so it is fixed after that PR lands.
**Definition of done**
- With `-x`, an operand under another operand is kept and walked as its own operand when it is on a different filesystem than the operand covering it. Without `-x`, and for a nested operand on the same filesystem, `pruneRoots` keeps dropping it as now.
- A record under such a kept operand is verified by that operand's walk like any other: records of files that are gone are deleted. The rule that keeps records under a directory the walk declined (https://git.eeqj.de/sneak/sfdupes/issues/99) does not apply under a directory that is itself a scanned operand.
- README "`scan` mode" states the rule where it describes overlapping operands.
- A test with a nested operand on another filesystem (with the device check stubbed, as the test for https://git.eeqj.de/sneak/sfdupes/issues/99 does) fails before the fix because no file under it is walked, and passes after.
Severity: minor. It needs `-x` with nested operands on different filesystems; new files under the nested operand go unrecorded, and with https://git.eeqj.de/sneak/sfdupes/pulls/105 its existing records are kept but never checked, so a file changed or deleted there can still appear in the report as it was.
Model: opus-5-5
clawbot
self-assigned this 2026-10-14 19:50:48 +02:00
Plan: one PR on next, now that #105 has landed, built as the definition of done says.
With -x, pruneRoots keeps an operand that lies under another operand when the two are on different filesystems, and that operand is walked as its own operand. Without -x, or on the same filesystem, it is dropped as now.
The rule from #99 that keeps records below a directory the walk declined does not cover records below an operand that is itself scanned: that operand's walk verifies them, and a record of a file that is gone is deleted.
The test stubs the device check, as the test for #99 does.
Two comment fixes in the same code, from the review of that PR: the startWalk doc comment is rewrapped where one line was left short, and the comment on TestScanOneFilesystemKeepsOtherFilesystemRecords no longer says the test runs the later phases as runPhases does, since it skips the content phase.
Model: opus-5-5
Plan: one PR on `next`, now that https://git.eeqj.de/sneak/sfdupes/pulls/105 has landed, built as the definition of done says.
- With `-x`, `pruneRoots` keeps an operand that lies under another operand when the two are on different filesystems, and that operand is walked as its own operand. Without `-x`, or on the same filesystem, it is dropped as now.
- The rule from https://git.eeqj.de/sneak/sfdupes/issues/99 that keeps records below a directory the walk declined does not cover records below an operand that is itself scanned: that operand's walk verifies them, and a record of a file that is gone is deleted.
- The test stubs the device check, as the test for https://git.eeqj.de/sneak/sfdupes/issues/99 does.
- Two comment fixes in the same code, from the review of that PR: the `startWalk` doc comment is rewrapped where one line was left short, and the comment on `TestScanOneFilesystemKeepsOtherFilesystemRecords` no longer says the test runs the later phases as `runPhases` does, since it skips the content phase.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
With
-x, an operand that lies under another operand but is on a different filesystem is never walked.pruneRootsdrops it before the walk as covered by the outer operand, and the outer operand's walk then declines to enter it because it is on another filesystem. Soscan -x /srv /srv/pool2, with/srv/pool2a separate filesystem, reaches none of the files under/srv/pool2, although the operator named it.README "
scanmode" says overlapping operands are harmless and every file is reached exactly once; "Rules for the walk" says that with-xeach operand is bounded by its own filesystem. Here the nested operand's files are reached zero times, and nothing is warned about.Where (
nextat5900feb):pruneRootsinscan.go(an operand under another is dropped without regard to-x), andsubdirJobinscan.go(the outer walk declines the directory on another filesystem).Found while fixing #99 (#105 discloses it); it touches the same code, so it is fixed after that PR lands.
Definition of done
-x, an operand under another operand is kept and walked as its own operand when it is on a different filesystem than the operand covering it. Without-x, and for a nested operand on the same filesystem,pruneRootskeeps dropping it as now.scanmode" states the rule where it describes overlapping operands.Severity: minor. It needs
-xwith nested operands on different filesystems; new files under the nested operand go unrecorded, and with #105 its existing records are kept but never checked, so a file changed or deleted there can still appear in the report as it was.Model: opus-5-5
Plan: one PR on
next, now that #105 has landed, built as the definition of done says.-x,pruneRootskeeps an operand that lies under another operand when the two are on different filesystems, and that operand is walked as its own operand. Without-x, or on the same filesystem, it is dropped as now.startWalkdoc comment is rewrapped where one line was left short, and the comment onTestScanOneFilesystemKeepsOtherFilesystemRecordsno longer says the test runs the later phases asrunPhasesdoes, since it skips the content phase.Model: opus-5-5