89802377db7a

reformat nine files for vfmt at V b9a2d87 (3.0.55)

time
2026-09-24 20:12 UTC · 2 weeks ago
machine
koh2
agent
deepseek/deepseek-flash
session
pin V
parent
56ab9cab6ad2
10 files src/cli/cmd_back.v+1 −2src/cli/cmd_diff.v+1 −2src/cli/cmd_steal.v+1 −1src/cli/cmd_strip.v+7 −7src/history/history_test.v+2 −2src/migrate/migrate_test.v+1 −2src/remote/s3.v+1 −1src/view/view.v+1 −1tests/cli_test.v+5 −6v.mod+1 −1
src/cli/cmd_back.v+1 −2
@@ -118,8 +118,7 @@118118 		for delta in preview.deltas {119119 			println('  ${change_mark(delta.kind)} ${delta.path}')120120 		}121-		note('${fmt.plural(preview.deltas.len, 'file')} change  ·  ${fmt.plural(preview.remove.len,122-			'file')} removed')121+		note('${fmt.plural(preview.deltas.len, 'file')} change  ·  ${fmt.plural(preview.remove.len, 'file')} removed')123122 	}124123 	approved := confirm(args.flag('yes')) or { return refuse(as_json, err.msg()) }125124 	if !approved {

view file

src/cli/cmd_diff.v+1 −2
@@ -46,8 +46,7 @@4646 		added += delta.added4747 		removed += delta.removed4848 	}49-	note('${fmt.plural(deltas.len, 'file')} changed  ·  ${fmt.green('+' + added.str())} ${fmt.red(50-		'-' + removed.str())}')49+	note('${fmt.plural(deltas.len, 'file')} changed  ·  ${fmt.green('+' + added.str())} ${fmt.red('-' + removed.str())}')5150 	return 05251 }5352 

view file

src/cli/cmd_steal.v+1 −1
@@ -73,7 +73,7 @@7373 		ok('brought in ${report.fetched_saves} saves from "${report.repo}" — head is now [${report.head}]')7474 	} else {7575 		ok('brought in ${report.fetched_saves} saves from "${report.repo}"')76-		note('replayed ${report.replayed} of this machine\'s saves onto the remote head')76+		note("replayed ${report.replayed} of this machine's saves onto the remote head")7777 		if report.kept_mine > 0 {7878 			note('kept mine for ${fmt.plural(report.kept_mine, 'file')}')7979 		}

view file

src/cli/cmd_strip.v+7 −7
@@ -54,8 +54,7 @@5454 	} else {5555 		where := if only_save == '' { 'every save' } else { 'save ${only_save}' }5656 		println('  ${fmt.red(fmt.glyph_fail)} this cannot be undone — strip is the only command that destroys information')57-		println('  ${fmt.amber('!')} ${fmt.plural(scope.files, 'file')} in ${fmt.plural(scope.saves,58-			'save')}, ${fmt.plural(scope.objects, 'object')} — ${where}')57+		println('  ${fmt.amber('!')} ${fmt.plural(scope.files, 'file')} in ${fmt.plural(scope.saves, 'save')}, ${fmt.plural(scope.objects, 'object')} — ${where}')5958 		println('  ${fmt.dim('strip removes the path from history; the file on disk is left alone')}')6059 		approved := confirm(false) or { return refuse(args.json(), err.msg()) }6160 		if !approved {@@ -86,8 +85,7 @@8685 		return 08786 	}8887 	if scope.files > 0 {89-		ok('stripped ${path} from ${fmt.plural(local.files_removed, 'file')} across ${fmt.plural(scope.saves,90-			'save')}')88+		ok('stripped ${path} from ${fmt.plural(local.files_removed, 'file')} across ${fmt.plural(scope.saves, 'save')}')9189 		note('${local.objects_dropped} objects dropped')9290 	}9391 	if !push.skipped {@@ -115,9 +113,11 @@115113 			skipped: true116114 		}117115 	}118-	mut backend := this_machine_backend() or { return PushOutcome{119-		failed: err.msg()120-	} }116+	mut backend := this_machine_backend() or {117+		return PushOutcome{118+			failed: err.msg()119+		}120+	}121121 	report := exchange.push_strip(store, mut backend, path) or {122122 		return PushOutcome{123123 			failed: err.msg()

view file

src/history/history_test.v+2 −2
@@ -169,8 +169,8 @@169169 	write_file(dir, 'a.txt', 'two\n')!170170 	other := commit_files(store, dir,171171 		snapshot.walk(store, dir, snapshot.Ignore{})!.filter(it.path == 'a.txt'), SaveInput{172-		message: 'somebody else'173-	})!172+			message: 'somebody else'173+		})!174174 	store.begin()!175175 	saved := commit_walk(store, dir, SaveInput{176176 		message: 'mine'

view file

src/migrate/migrate_test.v+1 −2
@@ -102,8 +102,7 @@102102 		if !name.ends_with('.json') {103103 			continue104104 		}105-		record := json2.decode[Manifest](106-			os.read_file(os.join_path(fixture.dir, '.koh', 'snapshots', name))!)!105+		record := json2.decode[Manifest](os.read_file(os.join_path(fixture.dir, '.koh', 'snapshots', name))!)!107106 		mut files := []string{}108107 		for file in record.files {109108 			files << '${file.path} ${bare_hash(file.hash)}'

view file

src/remote/s3.v+1 −1
@@ -65,7 +65,7 @@6565 				body:  response.body.bytes()6666 				// Sent back as-is in If-Match: an RFC 7232 server compares the6767 				// quoted entity-tag, and a lenient one strips the quotes itself.68-				tag: header_of(response, 'ETag').trim_space()68+				tag:   header_of(response, 'ETag').trim_space()6969 			}7070 		}7171 		else {

view file

src/view/view.v+1 −1
@@ -569,7 +569,7 @@569569 // copy_id puts the ID on the clipboard through OSC 52, which works over ssh and570570 // in any terminal without a helper program.571571 fn copy_id(save_id string) {572-	paint('\x1b]52;c;${base64.encode(save_id.bytes())}\x07')572+	paint('\x1b]52;c;${base64.encode(save_id.bytes())}\a')573573 }574574 575575 fn parent_tree(store &storage.Store, save history.Save) snapshot.Tree {

view file

tests/cli_test.v+5 −6
@@ -47,7 +47,7 @@4747 	for arg in args {4848 		command += ' ${q(arg)}'4949 	}50-	shell := 'cd ${q(repo)} && ${command} </dev/null >${q(out_path)} 2>${q(err_path)}; printf "%s" $? >${q(code_path)}'50+	shell := 'cd ${q(repo)} && ${command} </dev/null >${q(out_path)} 2>${q(err_path)}; printf "%s" \$? >${q(code_path)}'5151 	result := os.execute(shell)5252 	if result.exit_code != 0 {5353 		panic('could not run test command: ${result.output}')@@ -95,8 +95,7 @@9595 	assert run(dir, 'unknown-command').code == 29696 	assert run(dir, 'unknown-command').err.contains('unknown command')9797 	// An agent asking for JSON gets JSON for a usage mistake too, exit 2.98-	for args in [['unknown-command', '--json'], ['save', '--json'],99-		['save', 'x', '--nope', '--json']] {98+	for args in [['unknown-command', '--json'], ['save', '--json'], ['save', 'x', '--nope', '--json']] {10099 		r2 := run(dir, ...args)101100 		assert r2.code == 2102101 		assert r2.out == ''@@ -111,8 +110,8 @@111110 	write(dir, 'tracked.txt', 'one\n')112111 	r := run(dir, 'save', 'first message', '--agent', 'agent-7', '--session', 'session-a', '--json')113112 	assert r.code == 0114-	for key in ['id', 'parent', 'message', 'created_at', 'machine', 'is_checkpoint', 'agent',115-		'session', 'files', 'size_bytes'] {113+	for key in ['id', 'parent', 'message', 'created_at', 'machine', 'is_checkpoint', 'agent', 'session',114+		'files', 'size_bytes'] {116115 		read_json_has(r.out, key)117116 	}118117 	assert r.out.contains('"message":"first message"')@@ -836,7 +835,7 @@836835 	for arg in args {837836 		command += ' ${q(arg)}'838837 	}839-	shell := 'cd ${q(repo)} && ${command} </dev/null >${q(out_path)} 2>${q(err_path)}; printf "%s" $? >${q(code_path)}'838+	shell := 'cd ${q(repo)} && ${command} </dev/null >${q(out_path)} 2>${q(err_path)}; printf "%s" \$? >${q(code_path)}'840839 	result := os.execute(shell)841840 	if result.exit_code != 0 {842841 		panic('could not run test command: ${result.output}')

view file

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

view file