{"draft":null,"from":11,"to":12,"files":[{"path":"client/src/commands.ts","added":66,"removed":3,"diff":"--- a/client/src/commands.ts\n+++ b/client/src/commands.ts\n@@ -75,6 +75,8 @@\n \tstaleModText,\n } from \"./status-commands.ts\";\n \n+import { gitMarkerLine } from \"./settle.ts\";\n+\n // --- record ---\n \n interface Recorded {\n@@ -91,6 +93,10 @@\n \treadonly news: News;\n \treadonly leftOut: readonly LeftOut[];\n \treadonly turnedBinary: readonly TurnedBinary[];\n+\t/** Text files sent that hold what looks like a git conflict (a merge git left unfinished, or markers typed by hand). */\n+\treadonly gitMarkers?: readonly { path: string; line: number }[];\n+\t/** Sent files whose path is long enough to fail on Windows, here or in another agent's folder. */\n+\treadonly longPaths?: readonly { path: string; length: number }[];\n }\n \n /** The warning for text files that turned binary: what, where, and what to do. Empty when there are none. */\n@@ -239,14 +245,63 @@\n \t\t...(answer.spelling ?? []).map(spellingText),\n \t\t...(answer.uncomposed ?? []).map(uncomposedText),\n \t]);\n-\treturn { sent, paths, deleted, added, changed: answer.changed, news: answer.news, leftOut, turnedBinary };\n+\tconst longPaths = longPathsOf(\n+\t\troot,\n+\t\t[...files].filter(([, text]) => text !== null).map(([path]) => path),\n+\t);\n+\tconst gitMarkers = [...files]\n+\t\t.flatMap(([path, text]) => {\n+\t\t\tconst line = text === null ? undefined : gitMarkerLine(text);\n+\t\t\treturn line === undefined ? [] : [{ path, line }];\n+\t\t})\n+\t\t.sort((a, b) => (a.path < b.path ? -1 : 1));\n+\treturn {\n+\t\tsent,\n+\t\tpaths,\n+\t\tdeleted,\n+\t\tadded,\n+\t\tchanged: answer.changed,\n+\t\tnews: answer.news,\n+\t\tleftOut,\n+\t\tturnedBinary,\n+\t\tgitMarkers,\n+\t\tlongPaths,\n+\t};\n }\n \n+/** A note per file that holds what looks like a git conflict: abso records it as it is, as text, and does not call it a collision. */\n+export function gitMarkerText(list: readonly { path: string; line: number }[] | undefined): string[] {\n+\treturn (list ?? []).map(\n+\t\t(m) =>\n+\t\t\t`Note: ${m.path} has lines that look like a git conflict (from line ${m.line}). abso records them as ordinary text and will publish them as they are. If a merge was left unfinished, fix the file first.`,\n+\t);\n+}\n+\n+/** Windows stops at 260 characters for a whole path, and another agent's folder may sit deeper than this one. */\n+const LONG_FULL_PATH = 240;\n+const LONG_RELATIVE_PATH = 160;\n+\n+/** The sent files whose path will likely fail to write on Windows: the whole path is near its limit here, or the part inside the folder is already long. */\n+export function longPathsOf(root: string, paths: Iterable<string>): { path: string; length: number }[] {\n+\treturn [...paths]\n+\t\t.map((path) => ({ path, length: absolute(root, path).length }))\n+\t\t.filter((p) => p.length >= LONG_FULL_PATH || p.path.length >= LONG_RELATIVE_PATH)\n+\t\t.sort((a, b) => (a.path < b.path ? -1 : 1));\n+}\n+\n+/** A note per long path: abso keeps it, but a Windows agent may not be able to write the file. */\n+export function longPathText(list: readonly { path: string; length: number }[] | undefined): string[] {\n+\treturn (list ?? []).map(\n+\t\t(p) =>\n+\t\t\t`Note: ${p.path} is ${p.path.length} characters inside the folder (${p.length} with this folder's location). Windows stops at 260 for a whole path, so an agent on Windows may be unable to write it. A shorter path avoids that.`,\n+\t);\n+}\n+\n /** \"Recorded 3 files first: a, b, c.\" (names cut short past 8), or a word that the folder is paused. Empty when nothing was sent. */\n export function recordedFirst(r: Recorded): string[] {\n \tif (r.paused) return [\"Recording is paused (abso resume): your folder's changes were not sent first.\"];\n \tif (r.sent === 0) return [];\n-\treturn [`Recorded first: ${recordedList(r)}.`];\n+\treturn [`Recorded first: ${recordedList(r)}.`, ...gitMarkerText(r.gitMarkers), ...longPathText(r.longPaths)];\n }\n \n /** \"2 changed (a, b), 3 deleted (x, y, z)\": deletions said as such (#37, Builder 2 read its rm'd files as edits). */\n@@ -307,13 +362,21 @@\n \t\t\t: `Recorded ${recordedList(r)}${changed === undefined ? \"\" : `; ${changed} changed on the server`}.`;\n \treturn withLeftOut(\n \t\t{\n-\t\t\ttext: [...turnedBinaryText(r.turnedBinary), text, ...leftOutText(r.leftOut)].join(\"\\n\"),\n+\t\t\ttext: [\n+\t\t\t\t...turnedBinaryText(r.turnedBinary),\n+\t\t\t\ttext,\n+\t\t\t\t...gitMarkerText(r.gitMarkers),\n+\t\t\t\t...longPathText(r.longPaths),\n+\t\t\t\t...leftOutText(r.leftOut),\n+\t\t\t].join(\"\\n\"),\n \t\t\tjson: {\n \t\t\t\tsent: r.sent,\n \t\t\t\tchanged: r.changed ?? null,\n \t\t\t\tnews: newsLines(r.news),\n \t\t\t\tleftOut: r.leftOut,\n \t\t\t\tturnedBinary: r.turnedBinary,\n+\t\t\t\tgitMarkers: r.gitMarkers ?? [],\n+\t\t\t\tlongPaths: r.longPaths ?? [],\n \t\t\t},\n \t\t},\n \t\tr.leftOut,"}],"unmatched":[]}