6eabcf809156

show where things stand in koh status — the save you are on, its age and the save count — and say so in help: status is where things stand, diff is what changed (3.2.6)

time
2026-09-28 17:19 UTC · 2 weeks ago
machine
Junes-MacBook-Pro.local
agent
claude-opus-5-5
session
status wording
parent
a4eddf199042
5 files VERSION+1 −1src/cli/cli.v+2 −2src/cli/cmd_status.v+4 −1tests/cli_test.v+13 −2v.mod+1 −1
VERSION+1 −1
@@ -1 +1 @@1-3.2.51+3.2.6

view file

src/cli/cli.v+2 −2
@@ -17,9 +17,9 @@1717 	commands := [1818 		['save', 'snapshot your work'],1919 		['checkpoint', 'mark a place to come back to'],20-		['status', 'what changed'],20+		['status', 'where things stand'],2121 		['view', 'browse saves and checkpoints'],22-		['diff', 'show changes'],22+		['diff', 'what changed'],2323 		['undo', 'step back'],2424 		['revert', 'throw away unsaved changes'],2525 		['load', 'go to any save'],

view file

src/cli/cmd_status.v+4 −1
@@ -1,4 +1,5 @@1-//! `koh status` — what the working tree has that head does not.1+//! `koh status` — where things stand: the save you are on, and what the working tree has that it2+//! does not.23 34 module cli45 @@ -52,6 +53,8 @@5253 		}))5354 		return 05455 	}56+	saves := history.save_count(store) or { return refuse(false, err.msg()) }57+	note('at [${head.id}] ${fmt.fit(head.message.all_before('\n'), 50)} · ${ago(head.created_at)} · ${fmt.plural(int(saves), 'save')}')5558 	if unfinished {5659 		warn(snapshot.restore_unfinished)5760 	}

view file

tests/cli_test.v+13 −2
@@ -269,6 +269,8 @@269269 		assert help.out.contains('  ${name} '), name270270 	}271271 	assert help.out.contains('koh man <command>')272+	assert help.out.contains('  status      where things stand\n')273+	assert help.out.contains('  diff        what changed\n')272274 	// No flag text anywhere on the screen.273275 	assert !help.out.contains('--'), help.out274276 	lines := help.out.split_into_lines()@@ -377,8 +379,17 @@377379 	write(dir, 'keep.txt', 'keep\n')378380 	write(dir, 'ignored.log', 'ignore\n')379381 	write(dir, 'build/output.txt', 'ignore\n')380-	assert run(dir, 'save', 'keep').code == 0381-	assert run(dir, 'status').out.contains('no changes')382+	saved := run(dir, 'save', 'keep', '--json')383+	assert saved.code == 0384+	id := saved.out.all_after('"id":"')[..12]385+	// Where things stand comes first, clean or not.386+	clean := run(dir, 'status').out387+	assert clean.contains('at [${id}] keep · '), clean388+	assert clean.contains(' · 1 save\n'), clean389+	assert clean.contains('no changes')390+	write(dir, 'keep.txt', 'changed\n')391+	assert run(dir, 'status').out.contains('at [${id}] keep · ')392+	write(dir, 'keep.txt', 'keep\n')382393 	assert !run(dir, 'status').out.contains('ignored.log')383394 	assert !run(dir, 'status').out.contains('build/output.txt')384395 	assert !run(dir, 'status').out.contains('LOG.md')

view file

v.mod+1 −1
@@ -1,6 +1,6 @@11 Module {22 	name: 'koh3'3-	version: '3.2.5'3+	version: '3.2.6'44 	description: 'One SQLite file per repo, one line of history.'55 	license: 'MIT'66 }

view file