just-git 1.5.7 → 1.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,7 +6,11 @@
6
6
 
7
7
  Pure TypeScript git implementation. Zero dependencies. 36 commands. Works in Node, Bun, Deno, Cloudflare Workers, and the browser. [Tested against real git](docs/TESTING.md) across more than a million randomized operations.
8
8
 
9
- Two entry points: a **virtual filesystem client** for sandboxed environments (pairs with [just-bash](https://github.com/vercel-labs/just-bash), or use standalone), and an **[embeddable git server](docs/SERVER.md)** that any standard `git` client can clone, fetch, and push to.
9
+ The Git CLI, Git servers, and CI workflows are no longer just things you use to develop apps: they can be part of the apps themselves. The goal of this project is to make that practical.
10
+
11
+ - **Virtual filesystem client** for sandboxed environments. Pairs with [just-bash](https://github.com/vercel-labs/just-bash), or use standalone.
12
+ - **[Embeddable git server](docs/SERVER.md)** with pluggable storage, auth, and hooks. Supports HTTP, SSH, and in-process transport.
13
+ - **[Repo module](docs/REPO.md)** with typed functions for commits, diffs, merges, blame, and bisect that work identically against a virtual filesystem or a database.
10
14
 
11
15
  ## Install
12
16
 
@@ -122,7 +126,7 @@ Uses web-standard `Request`/`Response`. Works with Bun, Hono, Cloudflare Workers
122
126
  Everything operates on `GitRepo`, a minimal `{ objectStore, refStore }` interface shared by the client and server. A `GitRepo` can be backed by a virtual filesystem, SQLite, Postgres, or any custom storage. The same helpers work inside both client-side hooks and server-side hooks, and `createWorktree` lets you spin up a full git client against a database-backed repo.
123
127
 
124
128
  ```ts
125
- import { commit, readFileAtCommit, getChangedFiles, mergeTrees } from "just-git/repo";
129
+ import { commit, readFileAtCommit, getChangedFiles, mergeTrees, bisect } from "just-git/repo";
126
130
 
127
131
  // Commit files to a branch — handles blobs, trees, parents, and refs
128
132
  await commit(repo, {
@@ -134,7 +138,17 @@ await commit(repo, {
134
138
 
135
139
  const content = await readFileAtCommit(repo, commitHash, "src/index.ts");
136
140
  const changes = await getChangedFiles(repo, parentHash, commitHash);
137
- const result = await mergeTrees(repo, oursCommit, theirsCommit);
141
+ const merge = await mergeTrees(repo, oursCommit, theirsCommit);
142
+
143
+ // Programmatic bisect — binary-search the commit graph with a test callback
144
+ const result = await bisect(repo, {
145
+ bad: "main",
146
+ good: "v1.0.0",
147
+ test: async (hash, tree) => {
148
+ const config = await tree.readFile("src/config.ts");
149
+ return config !== null && !config.includes("broken_call");
150
+ },
151
+ });
138
152
  ```
139
153
 
140
154
  See [REPO.md](docs/REPO.md) for the full API, the `GitRepo` interface, and the hybrid worktree pattern.