jj/cli
Yuya Nishihara f169c99fb4 cli: add "op abandon root..head" command that "reparents" operations
In order to implement GC (#12), we'll need to somehow prune old operations.
Perhaps the easiest implementation is to just remove unwanted operation files
and put tombstone file instead (like git shallow.) However, the removed
operations might be referenced by another jj process running in parallel. Since
the parallel operation thinks all the historical head commits are reachable, the
removed operations would have to be resurrected (or fix up index data, etc.)
when the op heads get merged.

The idea behind this patch is to split the "op log" GC into two steps:
 1. recreate operations to be retained and make the old history unreachable,
 2. delete unreachable operations if the head was created e.g. 3 days ago.
The latter will be run by "jj util gc". I don't think GC can be implemented
100% safe against lock-less append-only storage, and we'll probably need some
timestamp-based mechanism to not remove objects that might be referenced by
uncommitted operation.

FWIW, another nice thing about this implementation is that the index is
automatically invalidated as the op id changes. The bad thing is that the
"undo" description would contain an old op id. It seems the performance is
pretty okay.
2024-01-04 11:44:36 +09:00
..
examples transaction: take description at end instead of start 2023-12-13 08:12:49 -08:00
src cli: add "op abandon root..head" command that "reparents" operations 2024-01-04 11:44:36 +09:00
testing
tests cli: add "op abandon root..head" command that "reparents" operations 2024-01-04 11:44:36 +09:00
build.rs
Cargo.toml cargo: sort dependencies list alphabetically 2023-11-07 23:46:05 +09:00
LICENSE