- MCP
- show on this site's /mcp
- CLI
- abso show 12 --json
- JSON
- /christopher/abso-core/versions/12?format=json
record and publish note two things git users know the hard way, without blocking. (1) A file that holds what looks like a git conflict (a '<<<<<<< ' line, a '=======' line, then a '>>>>>>> ' line, other than abso's own blocks) gets: 'Note: <file> has lines that look like a git conflict (from line N)...'. (2) A sent path of 160+ characters inside the folder, or 240+ with the folder's location, gets a note that Windows stops at 260. Both are one line per file, only when the file is sent, and the JSON carries gitMarkers and longPaths. gitMarkerLine is in settle.ts, longPathsOf in commands.ts. Tests: three new ones; the whole suite passes (702) and biome ci is clean.
of shared·review··Not checked
Version 11 · Files at version 12
3 files, 126 lines added, 4 removed.
--- a/client/src/commands.ts
+++ b/client/src/commands.ts
@@ -75,6 +75,8 @@
7777
79+
7981
@@ -91,6 +93,10 @@
96+ /** Text files sent that hold what looks like a git conflict (a merge git left unfinished, or markers typed by hand). */
98+ /** Sent files whose path is long enough to fail on Windows, here or in another agent's folder. */
95101
96102/** The warning for text files that turned binary: what, where, and what to do. Empty when there are none. */
@@ -239,14 +245,63 @@
242− return { sent, paths, deleted, added, changed: answer.changed, news: answer.news, leftOut, turnedBinary };
244271
272+/** 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. */
273+export function gitMarkerText(list: readonly { path: string; line: number }[] | undefined): string[] {
276+ `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.`,
279+
280+/** Windows stops at 260 characters for a whole path, and another agent's folder may sit deeper than this one. */
283+
284+/** 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. */
285+export function longPathsOf(root: string, paths: Iterable<string>): { path: string; length: number }[] {
291+
292+/** A note per long path: abso keeps it, but a Windows agent may not be able to write the file. */
293+export function longPathText(list: readonly { path: string; length: number }[] | undefined): string[] {
296+ `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.`,
299+
245300/** "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. */
247302 if (r.paused) return ["Recording is paused (abso resume): your folder's changes were not sent first."];
249− return [`Recorded first: ${recordedList(r)}.`];
304+ return [`Recorded first: ${recordedList(r)}.`, ...gitMarkerText(r.gitMarkers), ...longPathText(r.longPaths)];
251306
252307/** "2 changed (a, b), 3 deleted (x, y, z)": deletions said as such (#37, Builder 2 read its rm'd files as edits). */
@@ -307,13 +362,21 @@
307362 : `Recorded ${recordedList(r)}${changed === undefined ? "" : `; ${changed} changed on the server`}.`;
310− text: [...turnedBinaryText(r.turnedBinary), text, ...leftOutText(r.leftOut)].join("\n"),
--- a/client/src/settle.ts
+++ b/client/src/settle.ts
@@ -100,3 +100,22 @@
103+
105+ * The first line (1-based) of what looks like a git conflict left in a text: a "<<<<<<< " line, then a "=======" line,
106+ * then a ">>>>>>> " line. abso's own blocks are not these (their opening line is exact, and `abso settle` finds them);
107+ * a merge done by git, or markers typed or pasted by hand, are plain text to abso, which would publish them as they are.
--- a/client/test/client.test.ts
+++ b/client/test/client.test.ts
@@ -51,7 +51,7 @@
54−import { findBlocks, keepFrom, settleText } from "../src/settle.ts";
5757
@@ -4340,3 +4340,43 @@
4343+
4345+ it("finds what looks like a git conflict, and not abso's own blocks or a lone marker", () => {
4349+ assert.equal(gitMarkerLine("a\n=======\nb\n"), undefined, "a lone ======= is a heading underline");
4352+ '<<<<<<< yours (unpublished)\nx\n||||||| before (version 3)\ny\n=======\nz\n>>>>>>> theirs: bob, version 4 "m"\n';
4353+ assert.equal(gitMarkerLine(mine), undefined, "abso's own blocks are settled with abso settle");
4355+
4359+ writeFileSync(join(dir, "a.txt"), "a\n<<<<<<< HEAD\nmine\n=======\ntheirs\n>>>>>>> feature\n");
4362+ assert.match(said.stdout, /Note: a\.txt has lines that look like a git conflict \(from line 2\)/);
4367+