README.md

3.7 KB · raw

rendered · source

1# Koh23**Version control designed for the solo developer.**45Most version control is built for teams, with branches to keep people out of6each other's way, pull requests to argue in, and merge tools for when two people7edited the same line. On your own you need none of that. You need to save your8work, see what changed, go back when something breaks, and pick up on your9laptop where you left off on your desktop.1011That's all Koh does.1213```sh14koh init15koh save "sketch the parser"16koh status17koh view18koh undo            # step back one save, without losing it19koh offer           # send your saves to your bucket20koh steal           # on the other machine: bring them in21```2223## How it thinks2425**Nothing is erased.** Your history is one straight line, and every command adds26to it. Undo, revert and load don't rewind anything. They record a new save27that puts the files back, so the save you stepped away from is still there28tomorrow. The only exception is `strip`, for the day a secret gets saved,29and it makes you type the path twice before it does anything.3031**Everything lives in one file.** A repo's whole history is `.koh`, a single32SQLite file at the root, and there's nothing else to maintain. Copy that file33and you've copied the whole history.3435**Your machines, not a server.** Point Koh at an S3 bucket or a folder on a36disk once per machine with `koh remote`, and every save is offered to it37automatically. If you worked on both machines without syncing, `koh steal`38combines them file by file. A file changed on only one side just comes along.39A file changed on both sides is shown to you, and you pick which version to40keep. Your version isn't thrown away either way: the save it came from stays41in history.4243**Safe to hand to an agent.** Every command has `--json`, never waits for44input when nothing is typing, and exits 0, 1 or 2. Saves record which agent45made them and in which session, so `koh undo --session` can take back an46agent's whole run in one step. A person has to be at the keyboard to `strip`.4748**Small on purpose.** Koh 3 has 17 commands, down from Koh 2's 45, and a hard49ceiling of 10,000 lines of V. A feature that doesn't fit gets cut, so one50person can still read all of it.5152## Setting up sync5354```sh55koh remote          # asks: a folder, or an S3 bucket?56```5758It tests the remote before saving anything. Scripts can skip the questions:5960```sh61KOH_ACCESS_KEY=... KOH_SECRET_KEY=... \62  koh remote s3 https://s3.fr-par.scw.cloud my-bucket fr-par63koh remote folder /Volumes/usb/koh64```6566Or write the two files yourself. `koh man remote` shows the format.6768```69~/.config/koh/remote        kind, endpoint, bucket, region (or path)70~/.config/koh/credentials   access_key, secret_key, mode 60071```7273## In your prompt7475`shell/koh3.plugin.zsh` puts the repo in your zsh prompt and adds tab76completion:7778```79kiln · v2.1.0 · 6 saves · 4.2 MB !80→81```8283`!` means unsaved changes, and `⚑` means the save you're on has been flagged.84Source it from `~/.zshrc`. The comments at the top cover Starship,85Powerlevel10k and using your own prompt.8687## Status8889Koh 3 is a rewrite of Koh 2 in V, for macOS and Linux. While it's being built90the binary is called `koh3`. At the cut-over it becomes `koh`, Koh 2 becomes91`koh2`, and `koh migrate` converts a Koh 2 repo in place. The specification92is `/Users/june/Downloads/Koh 3 — God Document.md`.9394## Building9596```sh97v -o build/koh3 src/koh3.v            # or -prod for a release build98v test src/ && v test tests/99v fmt -verify src/ tests/100```101102Koh is pinned to V master at `b9a2d87`, because V master can break it. SQLite1033.49.1 is vendored and compiled in, so there are no other dependencies.104`AGENTS.md` has the install steps for the pinned V, the Linux notes and the105layout.