From 912cae028fe0d683d109854e58f0677b7bc19def Mon Sep 17 00:00:00 2001 From: Phil Rzewski Date: Wed, 18 Mar 2026 14:03:31 -0700 Subject: [PATCH] Book docs for "db vacate" --- book/src/command/db.md | 26 +++++++++++++------------- cmd/super/db/vacate/command.go | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/book/src/command/db.md b/book/src/command/db.md index 0d8d585e3..2e6929e77 100644 --- a/book/src/command/db.md +++ b/book/src/command/db.md @@ -237,7 +237,7 @@ super db -f db -c "from logs:objects" * [revert](#super-db-revert) reverse an old commit * [serve](#super-db-serve) run a SuperDB service endpoint * [use](#super-db-use) set working branch for `db` commands -* [vacate](#super-db-vacate) compact a pool's commit history by squashing old commit objects +* [vacate](#super-db-vacate) truncate a pool's commit history by removing old commit objects * [vacuum](#super-db-vacuum) vacuum deleted storage in database ### super db auth @@ -773,7 +773,7 @@ This command stores the working branch in `$HOME/.super_head`. ### super db vacate ``` -super db vacate [ options ] commit +super db vacate [options] [timestamp] ``` **Options** * `-use ` commit to use, i.e., pool, pool@branch, or pool@commit @@ -782,19 +782,19 @@ super db vacate [ options ] commit * [Output](options.md#output) * [Commit](options.md#commit) -The `vacate` command compacts the commit history by squashing all of the -commit objects in the history up to the indicated commit and removing -the old commits. No other commit objects in the pool may point at any -of the squashed commits. In particular, no branch may point to any -commit that would be deleted. +The `vacate` command truncates a pool's commit history by removing old commit +objects. -The branch history may contain pointers to old commit objects, but any -attempt to access them will fail as the underlying commit history will -be no longer available. +If `-use` is specified, all commit objects timestamped older than that of the +given commitish will be deleted. If the optional `timestamp` argument is +supplied, all commit objects older than that timestamp will be deleted. If +neither `-use` nor `timestamp` is given, only the most recent commit in the +history will be kept and all others deleted. -**DANGER ZONE.** There is no prompting or second chances here so use -carefully. Once the pool's commit history has been squashed and old -commits are deleted, they cannot be recovered. +**DANGER ZONE.** You must confirm that you want to remove +the objects to proceed. The `-f` option can be used to force removal +without confirmation. The `-dryrun` option may also be used to see a summary +of how many objects would be removed by a `vacate` but without removing them. ### super db vacuum diff --git a/cmd/super/db/vacate/command.go b/cmd/super/db/vacate/command.go index d60b90d28..ca88baa06 100644 --- a/cmd/super/db/vacate/command.go +++ b/cmd/super/db/vacate/command.go @@ -19,7 +19,7 @@ import ( var spec = &charm.Spec{ Name: "vacate", Usage: "vacate [options] [timestamp]", - Short: "compact a pool's commit history by removing old commit objects", + Short: "truncate a pool's commit history by removing old commit objects", Long: ` See https://superdb.org/command/db.html#super-db-vacate `,