Stop remote info counting a non-blob file under blobs/ #344

Merged
clawbot merged 1 commits from issue-295-remote-info-non-blob-files into next 2026-10-13 08:33:28 +02:00
Collaborator

Fixes #295.

What was wrong: remote info counted every key under blobs/ with four or more path parts as a blob, while prune takes only keys of exactly four parts whose last part is a blob hash. A stray file such as blobs/56/f6/.DS_Store was reported as an orphaned blob, with the advice to run prune, which skipped the file, deleted nothing, and left the advice in place.

What changed: scanRemoteBlobStorage now takes its blob list from listAllRemoteBlobs, the listing prune uses, instead of its own loop over blobs/. The blob total, the orphan count and size, and the prune advice, in the table and in --json, now cover exactly the blobs prune would consider. A four-part key whose last part is not a blob hash now also logs the warning prune already logs for it.

blobKeyParts moves from info.go to prune.go, its only remaining user, and its comment drops "minimum", since prune checks for exactly four parts.

The new test puts a .DS_Store next to a referenced blob and checks the table and --json figures. The README remote info paragraph gains one sentence about such a file.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/vaultik/issues/295. **What was wrong:** `remote info` counted every key under `blobs/` with four or more path parts as a blob, while `prune` takes only keys of exactly four parts whose last part is a blob hash. A stray file such as `blobs/56/f6/.DS_Store` was reported as an orphaned blob, with the advice to run `prune`, which skipped the file, deleted nothing, and left the advice in place. **What changed:** `scanRemoteBlobStorage` now takes its blob list from `listAllRemoteBlobs`, the listing `prune` uses, instead of its own loop over `blobs/`. The blob total, the orphan count and size, and the prune advice, in the table and in `--json`, now cover exactly the blobs `prune` would consider. A four-part key whose last part is not a blob hash now also logs the warning `prune` already logs for it. `blobKeyParts` moves from `info.go` to `prune.go`, its only remaining user, and its comment drops "minimum", since `prune` checks for exactly four parts. The new test puts a `.DS_Store` next to a referenced blob and checks the table and `--json` figures. The README `remote info` paragraph gains one sentence about such a file. Model: opus-5-5
clawbot added the needs-review label 2026-10-13 07:50:46 +02:00
clawbot self-assigned this 2026-10-13 07:50:46 +02:00
clawbot added 1 commit 2026-10-13 07:50:47 +02:00
remote info counted every key under blobs/ with four or more path parts
as a blob, while prune skips a name that is not a blob hash. A stray
file such as .DS_Store was reported as an orphaned blob, with advice to
run prune, which then deleted nothing. remote info now takes its blob
list from prune's listAllRemoteBlobs, so its blob and orphan figures,
in the table and in --json, cover exactly what prune would consider.

blobKeyParts moves to prune.go, its only remaining user.

Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 94412d9ef3 into next 2026-10-13 08:33:28 +02:00
clawbot deleted branch issue-295-remote-info-non-blob-files 2026-10-13 08:33:29 +02:00
Sign in to join this conversation.