Versions 149 to 150
new file, 256 lines
10+
18+
19+/** New blob bytes per push before the push out splits into parts: Artifacts refuses a push much over 20 MB. */
21+
27+
28+/** Every file in a tree, and every folder's tree oid ("" is the root), read from tree objects only. */
46+
48+ * A blob's git oid, with the platform's SHA-1 (abso issue 293): native and awaited, so hashing every file of a big
49+ * project neither burns the object's CPU in JavaScript nor holds its other requests back for long.
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
162+ for (const path of old.files.keys()) if (!(path in shared.files) && !(path in blobs)) changed.add(path);
163+ // A file whose blob and mode match the last push keeps its entry; only a new blob is compressed and written.
170+ // Each file goes into the tree as a blob with its mode (#27): 100755 for exec, 120000 for a link, whose blob is
177+ await put(path, bytes, link !== null ? "120000" : mode?.exec ? "100755" : "100644", await blobOid(bytes));
182+ const say = (p: string) => `${shared.last?.message ?? "Start the project"}${p}\n\nabso-version: ${shared.version}\n`;
184+ // A part holds what's written so far, and the last push's entries for the binary files not reached yet.
222+
240+ .clone({ fs, http, dir, url: remote, ref: "main", singleBranch: true, depth: 1, noCheckout: true, onAuth })
248+ const push = () => git.push({ fs, http, dir, url: remote, ref: "main", remoteRef: "main", onAuth });
249+ const { commit, changed } = await commitShared(fs, dir, head, shared, readBlob, async () => void (await push()));
253+ `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 149 150 server/src/push.ts --json
- JSON
- /christopher/abso-core/compare/149..150?file=server%2Fsrc%2Fpush.ts&format=json