Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 43 to 44

Compare

+20 −4 in 5 places
Lines 8–14 at 44 (were 8–13 at 43)
88import { bool, type Parsed, UsageError } from "./args.ts";
99import { readKnownBlobs, writeKnownBlobs } from "./blobs.ts";
1010import { ciText } from "./ci.ts";
11+import { CleanFiles } from "./clean-files.ts";
1112import { newerCommitNote } from "./client-version.ts";
1213import { type Env, heard, type Output, open, plural } from "./command-env.ts";
1314import {
Lines 27–33 at 44 (were 26–31 at 43)
2627 absolute,
2728 forgetKnown,
2829 isLocalOnly,
30+ knownPath,
2931 listKnown,
3032 newFileEndings,
3133 normalize,
Lines 70–93 at 44 (were 68–80 at 43)
6870 * line endings (#37: Python's text mode on Windows writes CRLF).
6971 * abso records them, and abso run sends them, with LF; a tool run here sees
7072 * CRLF. Files git would check out with CRLF are left out of the list.
73+ * With `clean` (status), a file found unchanged before is answered without reading it.
7174 */
72−export function crlfOnly(root: string): string[] {
75+export function crlfOnly(root: string, clean?: CleanFiles): string[] {
7376 const out: string[] = [];
77+ const state = stateDir(root);
7478 for (const rel of listKnown(root)) {
79+ const key = clean?.key(absolute(root, rel), knownPath(root, rel, state));
80+ const was = key && clean!.check(rel, key);
81+ if (was) {
82+ if (was.cr) out.push(rel);
83+ continue;
84+ }
7585 const disk = readText(absolute(root, rel));
7686 if (disk === undefined || !disk.includes("\r")) continue;
77− if (normalize(disk) === readKnown(root, rel)) out.push(rel);
87+ if (normalize(disk) === readKnown(root, rel, state)) {
88+ out.push(rel);
89+ if (key) clean!.mark(rel, key, true);
90+ }
7891 }
7992 const git = newFileEndings(root, out);
8093 return out.filter((rel) => git.get(rel) !== "crlf").sort();
Lines 282–292 at 44 (were 269–277 at 43)
269282 const { root, config, api } = open(env);
270283 const short = bool(args, "short");
271284 const { files: view, ...status } = short ? { ...(await api.status()), files: undefined } : await api.statusAndFiles();
272− const pending = unrecorded(root);
285+ const clean = CleanFiles.load(root);
286+ const pending = unrecorded(root, false, new Set(), clean);
273287 const local = new Set([...pending.files.keys(), ...pending.blobs.keys(), ...Object.keys(pending.modes)]);
274288 if (short) {
289+ clean.save();
275290 // One word to stamp a build with (#37): 214, coast@3, 214+unpublished.
276291 const me = status.agents.find((a) => a.agent === config.agent);
277292 const unpublished = local.size > 0 || (me?.draftChanges ?? 0) > 0;
Lines 296–303 at 44 (were 281–287 at 43)
281296 }
282297 const missing = view === undefined ? [] : missingHere(root, view.files, local);
283298 const unwritten = readUnwritten(root);
284− const crlf = crlfOnly(root);
299+ const crlf = crlfOnly(root, clean);
300+ clean.save();
285301 // Files an earlier record added to the draft and that are gone again (#37: scratch files a run
286302 // recorded, deleted after): nothing reached shared, and the next record takes them out of the draft.
287303 const deleted = [...pending.files].filter(([, text]) => text === null).map(([rel]) => rel);
MCP
compare on this site's /mcp
CLI
abso diff 43 44 client/src/status-commands.ts --json
JSON
/christopher/abso-core/compare/43..44?file=client%2Fsrc%2Fstatus-commands.ts&format=json