Versions 33 to 318
new file, 305 lines
15+
23+
24+/** New blob bytes per push before the push out splits into parts: Artifacts refuses a push much over 20 MB. */
26+
32+
33+/** Every file in a tree, and every folder's tree oid ("" is the root), read from tree objects only. */
52+
54+ * Hash the Git header and content separately so export does not allocate a second whole-file buffer.
59+
64+
66+ * The tree for `files`, written bottom up. A folder with nothing changed under it keeps its old tree oid (`before`),
77+ for (const path of changed) for (let d = parentOf(path); d !== ""; d = parentOf(d)) dirty.add(d);
99+ : await git.writeTree({ fs, dir, tree: [...kids.get(d)!].map(([path, e]) => ({ path, ...e })) });
101+ else folder(parentOf(d)).set(d.slice(d.lastIndexOf("/") + 1), { mode: "040000", oid, type: "tree" });
105+
107+ * A project's Artifacts repo: abso-<project>. Project names are letters, digits, ".", "_" and "-" (validName), which
113+
116+ return repo.startsWith("abso-") && repo.length > "abso-".length ? repo.slice("abso-".length) : null;
118+
130+ const created = await artifacts.create(name, { description: `abso project ${name}`, setDefaultBranch: "main" });
134+
142+
144+ * Shared's files as commits on top of `head` (null: a repo with no main yet), in the repo at `dir`. `part` is called
145+ * with each earlier part's commit when the new blobs are too big for one push. Answers the last commit and how many
171+ for (const path of old.files.keys()) if (!(path in shared.files) && !(path in blobs)) changed.add(path);
172+ // A file whose blob and mode match the last push keeps its entry; only a new blob is compressed and written.
179+ // Each file goes into the tree as a blob with its mode (#27): 100755 for exec, 120000 for a link, whose blob is
185+ const say = (p: string) => `${shared.last?.message ?? "Start the project"}${p}\n\nabso-version: ${shared.version}\n`;
239+
246+ disk?: { storage: SqliteStorage; maxPackBytes: number; maxObjectBytes: number; maxDecodedBytes: number },
252+ using contents = disk ? new GitFileContents(disk.storage, disk.maxObjectBytes, disk.maxDecodedBytes) : undefined;
254+ ? new GitDiskIntake(disk.storage, disk.maxPackBytes, disk.maxObjectBytes, disk.maxDecodedBytes)
266+ const refs = await git.listServerRefs({ http: transport, url: remote, onAuth, prefix: "refs/heads/main" });
289+ const push = () => git.push({ fs, http: transport, cache, dir, url: remote, ref: "main", remoteRef: "main", onAuth });
302+ `push ${project} v${shared.version}: clone ${t1 - t0} ms, files ${t2 - t1} ms (${changed} changed), push ${Date.now() - t2} ms`,
- MCP
- compare on this site's /mcp
- CLI
- abso diff 33 318 server/src/push.ts --json
- JSON
- /christopher/abso-core/compare/33..318?file=server%2Fsrc%2Fpush.ts&format=json