From db06c5eab482823cd1fbe4f5f16827bb5c75be93 Mon Sep 17 00:00:00 2001 From: sneak Date: Tue, 17 Nov 2026 00:30:42 +0000 Subject: [PATCH] Say that snapshot remove accepts a remote key Rebased onto next, where `snapshot remove` takes a snapshot ID, a remote key or the leading part of a remote key (https://git.eeqj.de/sneak/vaultik/issues/400). The README and `snapshot remove --help` still said a remote key is not accepted. With `--local-only` the argument must still be the ID of a snapshot in the local index: that mode does not look the key up at the destination. Model: opus-5-5 --- README.md | 6 +++--- internal/cli/snapshot.go | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8479bba..c95ec4f 100644 --- a/README.md +++ b/README.md @@ -597,8 +597,8 @@ cannot be listed or has no marker file. ### `snapshot remove ` -Removes one snapshot. The argument must be a snapshot ID. A remote key is not -accepted. +Removes one snapshot. The argument is a snapshot ID, a remote key or the leading +part of a remote key. It needs the [lock](#locking). It needs permission to list and delete at the destination, unless you give `--local-only`. It needs no private key. @@ -618,7 +618,7 @@ Its blobs stay. Run `vaultik prune` afterwards to delete the blobs that no snapshot uses any more. An ID that is in neither the local index nor the destination is an error. With -`--local-only`, the snapshot must be in the local index. +`--local-only`, the argument must be the ID of a snapshot in the local index. The deletion at the destination can fail, for example when the destination is unreachable or has no marker file. What happens then depends on where the diff --git a/internal/cli/snapshot.go b/internal/cli/snapshot.go index 744a01d..071f22b 100644 --- a/internal/cli/snapshot.go +++ b/internal/cli/snapshot.go @@ -379,14 +379,14 @@ know about), which is what 'vaultik prune' does. The command prints the 'vaultik prune' invocation to run as a follow-up only when it removed the snapshot's metadata from the destination store, and never under --json. -The argument must be a snapshot ID: a remote key is not accepted. An ID -that names no snapshot in the local index or on the destination store is -an error. Needs permission to list and delete objects on the destination -store, unless --local-only is given. +The argument is a snapshot ID, a remote key or the leading part of a +remote key. An ID that names no snapshot in the local index or on the +destination store is an error. Needs permission to list and delete +objects on the destination store, unless --local-only is given. Use --local-only to skip the remote half (e.g. when you want to forget a -snapshot locally without touching the destination store); the snapshot -must then be in the local index. +snapshot locally without touching the destination store); the argument +must then be the ID of a snapshot in the local index. If removing the snapshot's metadata from the destination store fails (for example because the remote is unreachable), the local-database removal