Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions book/src/command/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <commitish>` commit to use, i.e., pool, pool@branch, or pool@commit
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion cmd/super/db/vacate/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposing truncate since compact is already a verb attached to other functionality, and also we're deleting not squashing as the command was once envisioned.

Long: `
See https://superdb.org/command/db.html#super-db-vacate
`,
Expand Down
Loading