{"draft":null,"from":20,"to":318,"files":[{"path":"client/src/changes.ts","added":87,"removed":14,"diff":"--- a/client/src/changes.ts\n+++ b/client/src/changes.ts\n@@ -28,11 +28,12 @@\n import { byWhom } from \"./history-answers.ts\";\n import { applyMode, PLAIN, readKnownModes, writeKnownModes } from \"./modes.ts\";\n import { refusedText, screenAnswer } from \"./safety.ts\";\n+import { refusalText, withoutArg, withoutHeading } from \"./without.ts\";\n \n-/** The space to read: --draft (where \"shared\" means shared), else the one this agent is in. */\n+/** The space to read: --draft (where \"shared\" means shared), else the one this agent is in (shared, in a folder with no agent). */\n function space(args: Parsed, agent: string): Where {\n \tconst named = str(args, \"draft\");\n-\tif (named === undefined) return { agent };\n+\tif (named === undefined) return agent === \"\" ? { draft: null } : { agent };\n \treturn { draft: named === \"shared\" ? null : named };\n }\n \n@@ -87,7 +88,7 @@\n \treturn {\n \t\ttext: [\n \t\t\tmine\n-\t\t\t\t? `Your view holds ${what}: ${spaceName(answer.draft)} at version ${answer.version}, with your unpublished changes.${missing.size > 0 ? ` ${missing.size} of them ${missing.size === 1 ? \"is\" : \"are\"} missing from this folder (abso sync --full writes them).` : \"\"}`\n+\t\t\t\t? `Your view holds ${what}: ${spaceName(answer.draft)} at version ${answer.version}, with your unpushed changes.${missing.size > 0 ? ` ${missing.size} of them ${missing.size === 1 ? \"is\" : \"are\"} missing from this folder (abso pull --full writes them).` : \"\"}`\n \t\t\t\t: `${spaceName(answer.draft)} at version ${answer.version} holds ${what}.`,\n \t\t\t...files.map((f) => (missing.has(f) ? `${f}  (missing from this folder)` : f)),\n \t\t].join(\"\\n\"),\n@@ -141,6 +142,25 @@\n \t\t\t.filter((p) => only.length > 1 || !existsHere(root, p))\n \t\t\t.map((p) => nothingAt(root, p));\n \n+\t// --agent: someone else's draft, to review it. What they've recorded, not their folder; nothing here is recorded.\n+\tconst other = str(args, \"agent\");\n+\tif (other !== undefined) {\n+\t\tif (between || str(args, \"draft\") !== undefined)\n+\t\t\tthrow new UsageError(\"--agent shows that agent's unpushed changes: abso diff [file...] --agent <name>\");\n+\t\tconst answer = await api.diffOf(other);\n+\t\tconst files = pick(answer.files);\n+\t\tconst d = diffs(files);\n+\t\tconst where = `${spaceName(answer.draft)}${answer.base === null ? \"\" : ` (on version ${answer.base})`}`;\n+\t\tconst head =\n+\t\t\tfiles.length === 0\n+\t\t\t\t? `${other} has no recorded, unpushed changes${inPaths(only, \"to\")} in ${where}.`\n+\t\t\t\t: `${other}'s recorded, unpushed changes${inPaths(only, \"to\")} in ${where}: ${totals(files)}.`;\n+\t\treturn {\n+\t\t\ttext: [head, ...d.text].join(\"\\n\"),\n+\t\t\tjson: { agent: other, draft: answer.draft, base: answer.base, files: d.json, unmatched: unmatched(files) },\n+\t\t};\n+\t}\n+\n \tif (between) {\n \t\tconst from = version(words[0]!);\n \t\tconst to = version(words[1]!);\n@@ -160,7 +180,7 @@\n \n \tif (str(args, \"draft\") !== undefined)\n \t\tthrow new UsageError(\n-\t\t\t\"--draft goes with two versions (abso diff <from> <to>); abso diff alone shows your own unpublished changes\",\n+\t\t\t\"--draft goes with two versions (abso diff <from> <to>); abso diff alone shows your own unpushed changes\",\n \t\t);\n \t// Folder-only edits count as unpublished changes too.\n \tconst recorded = await recordFolder(root, api);\n@@ -170,8 +190,8 @@\n \tconst where = `${spaceName(answer.draft)}${answer.base === null ? \"\" : ` (on version ${answer.base})`}`;\n \tconst head =\n \t\tfiles.length === 0\n-\t\t\t? `No unpublished changes${inPaths(only, \"to\")} in ${where}.`\n-\t\t\t: `Your unpublished changes${inPaths(only, \"to\")} in ${where}: ${totals(files)}.`;\n+\t\t\t? `No unpushed changes${inPaths(only, \"to\")} in ${where}.`\n+\t\t\t: `Your unpushed changes${inPaths(only, \"to\")} in ${where}: ${totals(files)}.`;\n \tconst pre = recordedFirst(recorded);\n \treturn {\n \t\ttext: [...pre, head, ...notes(files), ...d.text].join(\"\\n\"),\n@@ -268,7 +288,7 @@\n \tif (v.drops && v.drops.length > 0)\n \t\tout.push(`  drops ${v.drops.length === 1 ? \"version\" : \"versions\"} ${v.drops.join(\", \")}`);\n \tif (v.droppedIn !== undefined) out.push(`  dropped in version ${v.droppedIn}: shared no longer has these changes`);\n-\tif (v.originalMessage !== undefined) out.push(`  amended; first published as: ${v.originalMessage}`);\n+\tif (v.originalMessage !== undefined) out.push(`  amended; first pushed as: ${v.originalMessage}`);\n \treturn out;\n }\n \n@@ -311,6 +331,8 @@\n \tconst rawLimit = str(args, \"limit\");\n \tconst limit = rawLimit === undefined ? undefined : version(rawLimit, \"-n\");\n \tif (limit === 0) throw new UsageError(\"-n is how many versions to show; give 1 or more\");\n+\tconst rawBefore = str(args, \"before\");\n+\tconst before = rawBefore === undefined ? undefined : version(rawBefore, \"--before\");\n \t// The server filters by one file; a folder (or the whole folder) is filtered here, from a longer log.\n \tconst folder = path !== undefined && (path === \"\" || /[/]$/.test(typed!) || isFolder(root, path));\n \t// --since, --by and --count (#37, Reporter's progress reports) filter here, from a longer log.\n@@ -332,6 +354,7 @@\n \t\tspace(args, config.agent),\n \t\tfolder || filtering ? FOLDER_LOG : limit,\n \t\tfolder ? undefined : path,\n+\t\tbefore,\n \t);\n \tconst found = folder\n \t\t? {\n@@ -392,12 +415,60 @@\n \t\t]),\n \t];\n \tconst oldest = answer.versions[answer.versions.length - 1];\n-\tif (path === undefined && !filtering && oldest !== undefined && oldest.version > 0)\n-\t\tlines.push(`Older versions: abso log -n ${answer.versions.length + 50}`);\n+\tif (!filtering && !folder && raw.next !== undefined && oldest !== undefined)\n+\t\tlines.push(`Older versions: abso log${typed === undefined ? \"\" : ` ${typed}`} --before ${oldest.version}`);\n \tif (filtering && answer.versions.length === 0) lines.push(\"No version matches.\");\n+\t// A filter or a folder reads the newest FOLDER_LOG versions; say so when older ones were left unread.\n+\tif ((filtering || folder) && raw.next !== undefined)\n+\t\tlines.push(\n+\t\t\t`Only the newest ${FOLDER_LOG} versions${before === undefined ? \"\" : ` below ${before}`} were read; --before ${raw.next} reads older ones.`,\n+\t\t);\n \treturn { text: lines.join(\"\\n\"), json: { ...answer } };\n }\n \n+/** abso show <version>[:<file>] --without <versions>: what differs with them left out, or that file then. */\n+async function showWithout(\n+\tapi: Api,\n+\troot: string,\n+\tcwd: string,\n+\tword: string,\n+\twhere: Where,\n+\tleave: readonly number[],\n+): Promise<Output> {\n+\tif (\"draft\" in where && where.draft !== null) throw new UsageError(\"--without reads shared, not a named draft\");\n+\tconst colon = word.indexOf(\":\");\n+\tconst v = version(colon >= 0 ? word.slice(0, colon) : word);\n+\tconst path = colon >= 0 ? fileArg(root, cwd, word.slice(colon + 1)) : undefined;\n+\tconst answer = await api.without(v, leave);\n+\tif (!answer.ok)\n+\t\treturn {\n+\t\t\texit: EXIT.refused,\n+\t\t\ttext: refusalText(answer, (vs) => `abso show ${word} --without ${vs.join(\",\")}`),\n+\t\t\tjson: { ...answer },\n+\t\t};\n+\tif (path !== undefined) {\n+\t\tconst file = answer.files.find((f) => f.path === path);\n+\t\tif (file === undefined) {\n+\t\t\tconst same = await api.fileAt(path, v, { draft: null });\n+\t\t\tif (same.text !== null) return { text: same.text, json: { ...same, without: answer.without } };\n+\t\t} else if (file.after !== null) return { text: file.after, json: { ...file, without: answer.without } };\n+\t\treturn {\n+\t\t\texit: EXIT.error,\n+\t\t\ttext: `${path} isn't in version ${v} of shared without them.`,\n+\t\t\tjson: { path, version: v, without: answer.without },\n+\t\t};\n+\t}\n+\tconst changed = pairRenames(answer.files);\n+\tconst d = diffs(changed);\n+\tconst lines = [\n+\t\t...withoutHeading(answer),\n+\t\tchanged.length === 0 ? `No file differs from version ${v}.` : `Compared with version ${v}: ${totals(changed)}.`,\n+\t\t`The files hash to ${answer.tree}; the same ask gives the same hash. Shared doesn't change.`,\n+\t\t...d.text,\n+\t];\n+\treturn { text: lines.join(\"\\n\"), json: { ...answer, files: d.json } };\n+}\n+\n export async function runShow(args: Parsed, env: Env): Promise<Output> {\n \tif (args.positionals.length !== 1)\n \t\tthrow new UsageError(\"show takes one version: abso show <version> or abso show <version>:<file>\");\n@@ -405,6 +476,8 @@\n \tconst word = args.positionals[0]!;\n \tconst colon = word.indexOf(\":\");\n \tconst where = space(args, config.agent);\n+\tconst leave = withoutArg(args);\n+\tif (leave !== undefined) return showWithout(api, root, env.cwd, word, where, leave);\n \n \tif (colon >= 0) {\n \t\tconst v = version(word.slice(0, colon));\n@@ -434,7 +507,7 @@\n /**\n  * A file's text with the draft's hunks that touch lines `from`-`to` (of the\n  * file as it is now, as abso diff numbers them) put back as they were at the\n- * base; the other hunks stay (#37, Builder 2: drop my copy of a teammate's\n+ * base; the other hunks stay (#37: drop my copy of a teammate's\n  * half and keep the rest). A hunk that only deleted lines touches the line\n  * where they were.\n  */\n@@ -490,7 +563,7 @@\n \t// Folder-only edits go to the server first, so they are discarded with the rest.\n \tawait recordFolder(root, api);\n \tif (ranged.length > 0) {\n-\t\t// Some lines of a file: put those hunks back here, then record the file (#37, Builder 2).\n+\t\t// Some lines of a file: put those hunks back here, then record the file (#37).\n \t\tconst diff = await api.diff();\n \t\tconst lines: string[] = [];\n \t\tfor (const r of ranged) {\n@@ -571,12 +644,12 @@\n \t);\n \tconst lines = [\n \t\trestored.length + deleted.length === 0\n-\t\t\t? \"Nothing to restore: no unpublished changes there.\"\n-\t\t\t: `Discarded your unpublished changes to ${plural(restored.length + deleted.length, \"file\")}:`,\n+\t\t\t? \"Nothing to restore: no unpushed changes there.\"\n+\t\t\t: `Discarded your unpushed changes to ${plural(restored.length + deleted.length, \"file\")}:`,\n \t\t...restored.map((f) => `  restored ${f}`),\n \t\t...deleted.map((f) => `  deleted ${f} (it is new in your draft)`),\n \t\t...(untouched.length > 0 && restored.length + deleted.length > 0\n-\t\t\t? [`No unpublished changes to: ${untouched.join(\", \")}`]\n+\t\t\t? [`No unpushed changes to: ${untouched.join(\", \")}`]\n \t\t\t: []),\n \t\t...refusedText(refused),\n \t];"}],"unmatched":[]}