@ref0/git 0.12.0 → 0.14.0
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/dist/access/private-refs.mjs +3 -3
- package/dist/auth/auth.d.mts +2 -2
- package/dist/auth/auth.mjs +3 -6
- package/dist/auth/authorize.mjs +1 -17
- package/dist/auth/helpers.mjs +3 -11
- package/dist/auth/host-services.mjs +11 -0
- package/dist/auth/policy.d.mts +27 -7
- package/dist/auth/policy.mjs +8 -4
- package/dist/auth/tokens-layer.d.mts +1 -2
- package/dist/auth/tokens-layer.mjs +2 -3
- package/dist/auth/tokens-public.d.mts +3 -3
- package/dist/auth/tokens.d.mts +1 -8
- package/dist/auth/tokens.mjs +1 -8
- package/dist/auth.d.mts +1 -4
- package/dist/auth.mjs +1 -3
- package/dist/client/git-http.mjs +18 -4
- package/dist/client/push-upload.mjs +33 -7
- package/dist/client/remote.mjs +94 -28
- package/dist/client/slice-push.d.mts +1 -1
- package/dist/contracts/access.d.mts +8 -8
- package/dist/contracts/actors.d.mts +2 -34
- package/dist/contracts/blobs.d.mts +2 -2
- package/dist/contracts/client.d.mts +8 -3
- package/dist/contracts/commits.d.mts +10 -2
- package/dist/contracts/commits.mjs +9 -1
- package/dist/contracts/files.d.mts +2 -2
- package/dist/contracts/forks.d.mts +11 -1
- package/dist/contracts/git.d.mts +18 -7
- package/dist/contracts/git.mjs +3 -2
- package/dist/contracts/lfs.d.mts +0 -7
- package/dist/contracts/objects.d.mts +80 -10
- package/dist/contracts/operations.d.mts +3 -0
- package/dist/contracts/operations.mjs +12 -2
- package/dist/contracts/push-uploads.d.mts +44 -5
- package/dist/contracts/push-uploads.mjs +7 -3
- package/dist/contracts/refs.d.mts +28 -6
- package/dist/contracts/remote.mjs +1 -3
- package/dist/contracts/repo-records.d.mts +1 -0
- package/dist/contracts/repos.d.mts +90 -2
- package/dist/contracts/repos.mjs +29 -2
- package/dist/contracts/result.d.mts +23 -18
- package/dist/contracts/result.mjs +17 -4
- package/dist/contracts/rules.d.mts +22 -22
- package/dist/contracts/server.d.mts +28 -77
- package/dist/contracts/signin.d.mts +1 -1
- package/dist/contracts/sync.d.mts +79 -19
- package/dist/contracts/sync.mjs +34 -10
- package/dist/contracts/tokens.d.mts +1 -6
- package/dist/contracts/tokens.mjs +1 -2
- package/dist/contracts/topics.d.mts +0 -5
- package/dist/contracts/work.d.mts +66 -2
- package/dist/contracts/work.mjs +8 -1
- package/dist/core/access.mjs +27 -5
- package/dist/core/ancestry.d.mts +9 -0
- package/dist/core/ancestry.mjs +6 -6
- package/dist/core/asked.mjs +42 -4
- package/dist/core/call-names.mjs +1 -0
- package/dist/core/call-services.mjs +2 -1
- package/dist/core/events/deliver.mjs +10 -2
- package/dist/core/forks.mjs +3 -3
- package/dist/core/imports.mjs +147 -9
- package/dist/core/index-job.mjs +9 -6
- package/dist/core/job-view.mjs +8 -9
- package/dist/core/mirror-rows.mjs +19 -4
- package/dist/core/objects/commits.mjs +16 -6
- package/dist/core/parts.d.mts +6 -1
- package/dist/core/parts.mjs +1 -4
- package/dist/core/purge.mjs +76 -6
- package/dist/core/push-decide.mjs +1 -1
- package/dist/core/push-files.d.mts +12 -0
- package/dist/core/push-files.mjs +225 -0
- package/dist/core/push-repo.d.mts +8 -0
- package/dist/core/push-repo.mjs +56 -0
- package/dist/core/push.d.mts +17 -0
- package/dist/core/push.mjs +98 -26
- package/dist/core/receipts.mjs +26 -10
- package/dist/core/ref-view.mjs +59 -5
- package/dist/core/refs.mjs +13 -8
- package/dist/core/repack.mjs +11 -8
- package/dist/core/repo-info.mjs +16 -9
- package/dist/core/repos.mjs +30 -14
- package/dist/core/seam.mjs +2 -2
- package/dist/core/view.d.mts +6 -0
- package/dist/core/view.mjs +45 -12
- package/dist/core/work.mjs +47 -22
- package/dist/effect.d.mts +3 -1
- package/dist/effect.mjs +3 -1
- package/dist/engine/reads.mjs +13 -6
- package/dist/engine/walk.mjs +4 -4
- package/dist/event-streams/event-streams.d.mts +1 -1
- package/dist/event-streams/event-streams.mjs +1 -1
- package/dist/event-streams/stream.d.mts +1 -1
- package/dist/event-streams/stream.mjs +1 -1
- package/dist/extend.d.mts +3 -3
- package/dist/extend.mjs +2 -2
- package/dist/http/answers.mjs +4 -2
- package/dist/http/core-parts.mjs +64 -15
- package/dist/http/handler.mjs +2 -2
- package/dist/http/node.mjs +5 -4
- package/dist/http/parts.d.mts +1 -0
- package/dist/http/push-upload-job.mjs +503 -0
- package/dist/http/push-uploads.d.mts +1 -0
- package/dist/http/push-uploads.mjs +114 -56
- package/dist/http/upload-pack.mjs +7 -6
- package/dist/index.d.mts +23 -24
- package/dist/index.mjs +4 -7
- package/dist/lfs/base.d.mts +7 -3
- package/dist/lfs/base.mjs +2 -1
- package/dist/lfs/copy.d.mts +46 -0
- package/dist/lfs/copy.mjs +26 -0
- package/dist/lfs/layer.mjs +4 -2
- package/dist/lfs/objects.d.mts +6 -0
- package/dist/lfs/objects.mjs +68 -41
- package/dist/lfs/rows.d.mts +13 -0
- package/dist/lfs/service.d.mts +1 -7
- package/dist/lfs/service.mjs +1 -9
- package/dist/lfs/upload-most.mjs +5 -5
- package/dist/node.d.mts +2 -2
- package/dist/protocol/bytes/sha256-hasher.d.mts +15 -0
- package/dist/protocol/bytes/sha256.d.mts +32 -0
- package/dist/protocol/bytes/sha256.mjs +105 -49
- package/dist/protocol/wire/advertisement.mjs +9 -4
- package/dist/protocol/wire/lines.d.mts +4 -2
- package/dist/protocol/wire/lines.mjs +11 -5
- package/dist/protocol/wire/push-uploads.mjs +13 -1
- package/dist/protocol/wire/v2.mjs +2 -2
- package/dist/protocol.d.mts +3 -1
- package/dist/protocol.mjs +3 -1
- package/dist/queue/advance.mjs +1 -1
- package/dist/queue/host.d.mts +1 -7
- package/dist/queue/host.mjs +1 -7
- package/dist/queue/layer.mjs +1 -1
- package/dist/queue/trim.mjs +1 -1
- package/dist/rest/blobs.d.mts +31 -23
- package/dist/rest/blobs.mjs +1 -1
- package/dist/rest/caller.d.mts +49 -9
- package/dist/rest/caller.mjs +1 -1
- package/dist/rest/client.d.mts +10 -3
- package/dist/rest/client.mjs +4 -0
- package/dist/rest/commits.d.mts +273 -240
- package/dist/rest/errors.d.mts +24 -4
- package/dist/rest/events.d.mts +9 -6
- package/dist/rest/events.mjs +1 -2
- package/dist/rest/files.d.mts +127 -115
- package/dist/rest/forks.d.mts +121 -97
- package/dist/rest/handler.mjs +4 -57
- package/dist/rest/handlers.d.mts +1 -1
- package/dist/rest/handlers.mjs +18 -4
- package/dist/rest/layer.mjs +2 -1
- package/dist/rest/me.d.mts +8 -4
- package/dist/rest/merges.d.mts +8 -4
- package/dist/rest/paths.mjs +1 -0
- package/dist/rest/queue.d.mts +282 -226
- package/dist/rest/refs.d.mts +205 -176
- package/dist/rest/repos.d.mts +108 -80
- package/dist/rest/tags.d.mts +24 -12
- package/dist/rest/tokens.d.mts +235 -211
- package/dist/rest/topics.d.mts +53 -33
- package/dist/rest/trees.d.mts +105 -89
- package/dist/rest/work.d.mts +467 -20
- package/dist/rest/work.mjs +8 -0
- package/dist/server/edge-node.d.mts +9 -13
- package/dist/server/edge-node.mjs +9 -12
- package/dist/server/git-layer.d.mts +1 -6
- package/dist/server/git-layer.mjs +2 -2
- package/dist/server/git-namespace.d.mts +3 -3
- package/dist/server/joined.d.mts +15 -22
- package/dist/server/joined.mjs +5 -29
- package/dist/server/lifecycle.mjs +107 -23
- package/dist/server/registry.mjs +9 -1
- package/dist/server/server.mjs +133 -212
- package/dist/storage/budget.mjs +2 -2
- package/dist/storage/clean-up.mjs +13 -10
- package/dist/storage/fetch.mjs +13 -8
- package/dist/storage/file-limits.mjs +24 -0
- package/dist/storage/index-build.d.mts +1 -0
- package/dist/storage/index-build.mjs +106 -62
- package/dist/storage/index-fetch.mjs +16 -3
- package/dist/storage/index-reach.mjs +33 -5
- package/dist/storage/index-remap.mjs +8 -1
- package/dist/storage/index-shallow.mjs +5 -3
- package/dist/storage/largest-files.mjs +48 -0
- package/dist/storage/lfs-pointers.mjs +10 -1
- package/dist/storage/loose.mjs +3 -1
- package/dist/storage/memory-budget.mjs +28 -4
- package/dist/storage/pack-reads.mjs +8 -8
- package/dist/storage/pack-receive.mjs +83 -25
- package/dist/storage/packs.mjs +37 -21
- package/dist/storage/prune-keep.mjs +203 -34
- package/dist/storage/prune-walk.mjs +54 -16
- package/dist/storage/prune.mjs +629 -196
- package/dist/storage/push-uploads.mjs +36 -12
- package/dist/storage/quarantine.mjs +9 -9
- package/dist/storage/ready.mjs +47 -19
- package/dist/storage/receive-bounds.mjs +29 -8
- package/dist/storage/receive-state.mjs +8 -0
- package/dist/storage/receive-steps.mjs +71 -18
- package/dist/storage/repack.d.mts +1 -1
- package/dist/storage/repack.mjs +1 -8
- package/dist/storage/rows.mjs +12 -1
- package/dist/storage/shallow.d.mts +1 -0
- package/dist/storage/shallow.mjs +26 -4
- package/dist/storage/stream-whole.mjs +5 -2
- package/dist/storage/visible.mjs +29 -1
- package/dist/storage/walk.mjs +2 -1
- package/dist/store/catalogue.mjs +1 -0
- package/dist/store/cursor-seal-namespace.d.mts +2 -0
- package/dist/store/cursor-seal-public.d.mts +5 -0
- package/dist/store/cursor-seal-public.mjs +5 -0
- package/dist/store/cursor-seal.d.mts +16 -2
- package/dist/store/cursor-seal.mjs +26 -14
- package/dist/store/errors.mjs +9 -1
- package/dist/store/records.d.mts +2 -0
- package/dist/store/records.mjs +9 -6
- package/dist/store/repo-record.d.mts +9 -7
- package/dist/store/repo-record.mjs +102 -19
- package/dist/store/scopes.mjs +10 -2
- package/dist/sync/bound.d.mts +2 -0
- package/dist/sync/bound.mjs +11 -2
- package/dist/sync/github.d.mts +6 -1
- package/dist/sync/github.mjs +55 -43
- package/dist/sync/http.mjs +36 -1
- package/dist/sync/import.mjs +1 -0
- package/dist/sync/layer.mjs +6 -2
- package/dist/sync/lfs-batch.mjs +119 -0
- package/dist/sync/lfs-copy.mjs +251 -0
- package/dist/sync/mirror.mjs +210 -137
- package/dist/sync/smart-http.mjs +4 -2
- package/dist/sync/step.mjs +25 -5
- package/dist/sync/tries.mjs +45 -14
- package/dist/sync.d.mts +2 -2
- package/dist/topics/host.mjs +1 -19
- package/dist/topics/layer.mjs +1 -1
- package/package.json +3 -8
- package/dist/auth/bridge.mjs +0 -30
- package/dist/auth/helpers.d.mts +0 -17
- package/dist/core/purge.d.mts +0 -8
- package/dist/core/registered-rows.d.mts +0 -5
- package/dist/core/repack.d.mts +0 -11
- package/dist/http/handler.d.mts +0 -2
- package/dist/rest/handler.d.mts +0 -21
- package/dist/rest.d.mts +0 -2
- package/dist/rest.mjs +0 -1
- package/dist/server/registry.d.mts +0 -16
- package/dist/server/server.d.mts +0 -36
- package/dist/storage/repack-job.d.mts +0 -3
- package/dist/topics/host.d.mts +0 -7
package/dist/client/remote.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { SealedObjects } from "../core/view.mjs";
|
|
|
6
6
|
import { refNameOf } from "../core/objects/writing.mjs";
|
|
7
7
|
import { pushFetched } from "../core/push.mjs";
|
|
8
8
|
import { maxRefLimit } from "../core/refs.mjs";
|
|
9
|
+
import { infiniteDepth } from "../storage/shallow.mjs";
|
|
9
10
|
import { heldOf } from "../storage/wants.mjs";
|
|
10
11
|
import { joinedBytes } from "../protocol/bytes/joined.mjs";
|
|
11
12
|
import { isOid } from "../protocol/bytes/text.mjs";
|
|
@@ -17,7 +18,8 @@ import { encodeV2Request, lsRefsArguments, readLsRefsAnswer, readV2Capabilities
|
|
|
17
18
|
import { objectsFace, oneShotReads } from "../storage/calls.mjs";
|
|
18
19
|
import { decodePacks } from "../store/git-store.mjs";
|
|
19
20
|
import { WholeRepo, wholeRefs } from "../store/ref-rows.mjs";
|
|
20
|
-
import {
|
|
21
|
+
import { rootsOf } from "../store/repo-record.mjs";
|
|
22
|
+
import { collections, repoRootsKey } from "../store/scopes.mjs";
|
|
21
23
|
import { advertisementRefused } from "./answer.mjs";
|
|
22
24
|
import { heldBody } from "./git-http.mjs";
|
|
23
25
|
import { localRepo } from "./local.mjs";
|
|
@@ -145,15 +147,22 @@ const remoteRefs = /* @__PURE__ */ Effect.fnUntraced(function* (http, input = {}
|
|
|
145
147
|
});
|
|
146
148
|
/** `effect` over the local repo's parts and its `Authorize`, the local side built first. */
|
|
147
149
|
const overLocal = (local, effect) => Effect.flatMap(local.built, ({ needs }) => Effect.provideContext(effect, needs));
|
|
148
|
-
/**
|
|
150
|
+
/**
|
|
151
|
+
* The local repo at one read: its list for the objects, its refs by name, and its roots, the
|
|
152
|
+
* commits a shallow fetch's history stops at.
|
|
153
|
+
*/
|
|
149
154
|
const openedLocal = /* @__PURE__ */ Effect.fnUntraced(function* (local) {
|
|
150
155
|
const stored = yield* ObjectsParts;
|
|
151
156
|
const operation = {
|
|
152
157
|
kind: "read",
|
|
153
158
|
repo: localRepo
|
|
154
159
|
};
|
|
155
|
-
const resolved = yield* openRepo(local.caller, operation, [
|
|
156
|
-
|
|
160
|
+
const resolved = yield* openRepo(local.caller, operation, [
|
|
161
|
+
refsRead,
|
|
162
|
+
packsRead,
|
|
163
|
+
repoRootsKey
|
|
164
|
+
]);
|
|
165
|
+
const [, refRows = [], packRows = [], rootRows] = resolved.snapshot.results;
|
|
157
166
|
const packs = yield* decodePacks(packRows);
|
|
158
167
|
return {
|
|
159
168
|
stored,
|
|
@@ -162,7 +171,8 @@ const openedLocal = /* @__PURE__ */ Effect.fnUntraced(function* (local) {
|
|
|
162
171
|
version: resolved.snapshot.version,
|
|
163
172
|
packs
|
|
164
173
|
},
|
|
165
|
-
refs: yield* wholeRefs(clientWhole, refRows)
|
|
174
|
+
refs: yield* wholeRefs(clientWhole, refRows),
|
|
175
|
+
roots: yield* rootsOf(rootRows)
|
|
166
176
|
};
|
|
167
177
|
});
|
|
168
178
|
/** `name` as a full name: a branch's short name, such as `main`, is `refs/heads/main`. */
|
|
@@ -172,25 +182,63 @@ const fullName = (name) => {
|
|
|
172
182
|
};
|
|
173
183
|
/** `refs` as full names, each as `fullName` says. */
|
|
174
184
|
const fullNames = (refs) => Effect.forEach(refs, fullName);
|
|
175
|
-
/**
|
|
176
|
-
const
|
|
185
|
+
/** No tips held: a deepen asks every tip, as Git's does. */
|
|
186
|
+
const noTips = /* @__PURE__ */ new Set();
|
|
187
|
+
/**
|
|
188
|
+
* The deepen a fetch asks: `depth` commits from each tip, `deepen` more past the local edge, as
|
|
189
|
+
* Git's `deepen-relative`, or `unshallow`, the whole history, as Git's largest depth.
|
|
190
|
+
*/
|
|
191
|
+
const deepenOf = (input) => {
|
|
192
|
+
if (input.depth !== void 0) return { depth: input.depth };
|
|
193
|
+
if (input.deepen !== void 0) return {
|
|
194
|
+
depth: input.deepen,
|
|
195
|
+
deepenRelative: true
|
|
196
|
+
};
|
|
197
|
+
return input.unshallow === true ? { depth: infiniteDepth } : void 0;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Whether `depth`, `deepen` and `filter` are what a request can say: whole numbers, a depth from 1
|
|
201
|
+
* to Git's largest, and at most one of `depth`, `deepen` and `unshallow`, as Git takes them.
|
|
202
|
+
*/
|
|
203
|
+
const checkedPartial = (input) => {
|
|
204
|
+
const { depth, deepen, unshallow, filter } = input;
|
|
177
205
|
const whole = (value) => Number.isSafeInteger(value) && value >= 0;
|
|
178
|
-
|
|
206
|
+
const deep = (value) => whole(value) && value > 0 && value <= 2147483647;
|
|
207
|
+
if (depth !== void 0 && !deep(depth)) return fail("INVALID_ARGUMENT", `A fetch's depth is a whole number from 1 to ${infiniteDepth}, not ${depth}`);
|
|
208
|
+
if (deepen !== void 0 && !deep(deepen)) return fail("INVALID_ARGUMENT", `A fetch deepens by a whole number from 1 to ${infiniteDepth}, not ${deepen}`);
|
|
209
|
+
const asked = [
|
|
210
|
+
...depth === void 0 ? [] : ["depth"],
|
|
211
|
+
...deepen === void 0 ? [] : ["deepen"],
|
|
212
|
+
...unshallow === true ? ["unshallow"] : []
|
|
213
|
+
];
|
|
214
|
+
if (asked.length > 1) return fail("INVALID_ARGUMENT", `A fetch takes one of depth, deepen and unshallow, not ${asked.join(" and ")}`);
|
|
179
215
|
if (filter?.kind === "blob:limit" && !whole(filter.bytes)) return fail("INVALID_ARGUMENT", `A blob limit is a whole number of bytes, not ${filter.bytes}`);
|
|
180
216
|
if (filter?.kind === "tree" && !whole(filter.depth)) return fail("INVALID_ARGUMENT", `A tree filter's depth is a whole number, not ${filter.depth}`);
|
|
181
217
|
return Effect.void;
|
|
182
218
|
};
|
|
183
|
-
/**
|
|
184
|
-
const
|
|
219
|
+
/** What a fetch asks of the remote's `shallow`: a deepen's, or sending a shallow repo's edge. */
|
|
220
|
+
const shallowAsk = (input, shallowed) => {
|
|
221
|
+
if (input.depth !== void 0) return "a shallow fetch";
|
|
222
|
+
if (input.deepen !== void 0) return "a deepen";
|
|
223
|
+
if (input.unshallow === true) return "an unshallow";
|
|
224
|
+
return shallowed ? "a fetch into a shallow repo" : void 0;
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* How the remote's upload-pack takes a fetch, once it's known to take what `input` asks: a
|
|
228
|
+
* deepen, or `shallowed`, a local repo with roots, which sends them, needs its `shallow`.
|
|
229
|
+
*/
|
|
230
|
+
const fetchTerms = /* @__PURE__ */ Effect.fnUntraced(function* (upload, input, shallowed) {
|
|
185
231
|
const { capabilities } = upload;
|
|
186
232
|
const features = upload.version === "v2" ? featuresOf(capabilities, "fetch") ?? [] : capabilities;
|
|
187
|
-
|
|
233
|
+
const shallowing = shallowAsk(input, shallowed === true);
|
|
234
|
+
if (shallowing !== void 0 && !features.includes("shallow")) return yield* Effect.fail(notOffered(shallowing, "shallow"));
|
|
235
|
+
if (input.deepen !== void 0 && upload.version === "v0" && !features.includes("deepen-relative")) return yield* Effect.fail(notOffered("a deepen", "deepen-relative"));
|
|
188
236
|
if (input.filter !== void 0 && !features.includes("filter")) return yield* Effect.fail(notOffered("a filtered fetch", "filter"));
|
|
189
237
|
const offered = (word) => capabilities.includes(word);
|
|
190
238
|
const acks = offered("multi_ack_detailed") ? "multi_ack_detailed" : offered("multi_ack") ? "multi_ack" : "plain";
|
|
191
239
|
const sideBand = upload.version === "v2" || offered("side-band-64k") ? "side-band-64k" : "side-band";
|
|
192
240
|
if (upload.version === "v0" && !offered(sideBand)) return yield* Effect.fail(notOffered("a fetch this client reads", "side-band-64k"));
|
|
193
|
-
const asked = [...
|
|
241
|
+
const asked = [...shallowing === void 0 ? [] : ["shallow"], ...input.filter === void 0 ? [] : ["filter"]];
|
|
194
242
|
const sent = sentCapabilities(capabilities, upload.version);
|
|
195
243
|
return {
|
|
196
244
|
acks,
|
|
@@ -203,10 +251,12 @@ const fetchTerms = /* @__PURE__ */ Effect.fnUntraced(function* (upload, input) {
|
|
|
203
251
|
* `fetch`: the refs asked for, each branch and tag when none is, read from the remote; each
|
|
204
252
|
* tip the local repo doesn't hold fetched, in rounds, and kept; and each local ref of the same
|
|
205
253
|
* name moved to the remote's tip, unless it holds commits the tip doesn't, which is refused as
|
|
206
|
-
* `diverged`, or with `force`, moved anyway.
|
|
254
|
+
* `diverged`, or with `force`, moved anyway. A shallow local repo sends its roots as `shallow`
|
|
255
|
+
* lines, and the answer's `shallow` and `unshallow` lines move them in the commit that lands the
|
|
256
|
+
* pack. A deepen, `depth`, `deepen` or `unshallow`, asks every tip, held or not, as Git's does.
|
|
207
257
|
*/
|
|
208
258
|
const fetchInto = (http, local, input = {}) => overLocal(local, Effect.gen(function* () {
|
|
209
|
-
yield* checkedPartial(input
|
|
259
|
+
yield* checkedPartial(input);
|
|
210
260
|
const asked = input.refs === void 0 ? void 0 : yield* fullNames(input.refs);
|
|
211
261
|
const upload = yield* discover(http);
|
|
212
262
|
const remote = yield* remoteRefsOf(http, upload, asked ?? ["refs/heads/", "refs/tags/"]);
|
|
@@ -216,11 +266,13 @@ const fetchInto = (http, local, input = {}) => overLocal(local, Effect.gen(funct
|
|
|
216
266
|
name,
|
|
217
267
|
oid: remote.get(name) ?? noObject
|
|
218
268
|
}));
|
|
219
|
-
const terms = yield* fetchTerms(upload, input);
|
|
220
269
|
const opened = yield* openedLocal(local);
|
|
270
|
+
if (input.unshallow === true && opened.roots.size === 0) return yield* fail("FAILED_PRECONDITION", "A fetch can't unshallow a repo that isn't shallow", { hint: "Fetch without unshallow" });
|
|
271
|
+
const terms = yield* fetchTerms(upload, input, opened.roots.size > 0);
|
|
221
272
|
const objects = objectsFace(SealedObjects.whole(opened.stored.objects, clientWhole));
|
|
222
273
|
const tips = [...new Set(refs.map((ref) => ref.oid))];
|
|
223
|
-
const
|
|
274
|
+
const deepens = deepenOf(input);
|
|
275
|
+
const held = deepens === void 0 ? yield* heldOf(objects, opened.listed, tips) : noTips;
|
|
224
276
|
const wants = tips.filter((oid) => !held.has(oid));
|
|
225
277
|
const edits = refs.flatMap((ref) => {
|
|
226
278
|
const from = opened.refs.get(ref.name) ?? null;
|
|
@@ -230,18 +282,19 @@ const fetchInto = (http, local, input = {}) => overLocal(local, Effect.gen(funct
|
|
|
230
282
|
to: ref.oid
|
|
231
283
|
}];
|
|
232
284
|
});
|
|
233
|
-
if (edits.length === 0) return {
|
|
285
|
+
if (edits.length === 0 && wants.length === 0) return {
|
|
234
286
|
refs,
|
|
235
287
|
shallow: [],
|
|
236
288
|
unshallow: [],
|
|
237
289
|
updates: []
|
|
238
290
|
};
|
|
291
|
+
const shallows = [...opened.roots].sort();
|
|
239
292
|
const request = {
|
|
240
293
|
wants,
|
|
241
|
-
shallows
|
|
242
|
-
includeTag: false
|
|
294
|
+
shallows,
|
|
295
|
+
includeTag: false,
|
|
296
|
+
...deepens
|
|
243
297
|
};
|
|
244
|
-
if (input.depth !== void 0) request.depth = input.depth;
|
|
245
298
|
if (input.filter !== void 0) request.filter = input.filter;
|
|
246
299
|
const negotiated = wants.length === 0 ? void 0 : yield* negotiate({
|
|
247
300
|
http,
|
|
@@ -253,7 +306,14 @@ const fetchInto = (http, local, input = {}) => overLocal(local, Effect.gen(funct
|
|
|
253
306
|
tips: [...new Set(opened.refs.values())]
|
|
254
307
|
});
|
|
255
308
|
const shallow = [.../* @__PURE__ */ new Set([...upload.version === "v0" ? upload.shallows : [], ...negotiated?.shallow ?? []])];
|
|
256
|
-
const
|
|
309
|
+
const unshallow = negotiated?.unshallow ?? [];
|
|
310
|
+
const sent = new Set(shallows);
|
|
311
|
+
const stray = unshallow.find((oid) => !sent.has(oid));
|
|
312
|
+
if (stray !== void 0) {
|
|
313
|
+
negotiated?.pack.cancel();
|
|
314
|
+
return yield* fail("DATA_LOSS", `The remote unshallowed ${stray}, which this fetch didn't send as shallow`);
|
|
315
|
+
}
|
|
316
|
+
const partial = deepens !== void 0 || input.filter !== void 0 || shallow.length > 0 || sent.size > 0;
|
|
257
317
|
const pack = negotiated === void 0 ? void 0 : {
|
|
258
318
|
bytes: negotiated.pack.bytes,
|
|
259
319
|
objects: negotiated.pack.objects,
|
|
@@ -265,20 +325,26 @@ const fetchInto = (http, local, input = {}) => overLocal(local, Effect.gen(funct
|
|
|
265
325
|
source: "import",
|
|
266
326
|
edits,
|
|
267
327
|
atomic: false,
|
|
268
|
-
fetched: {
|
|
328
|
+
fetched: {
|
|
329
|
+
force: input.force === true,
|
|
330
|
+
roots: {
|
|
331
|
+
shallow,
|
|
332
|
+
unshallow,
|
|
333
|
+
sent: shallows
|
|
334
|
+
}
|
|
335
|
+
}
|
|
269
336
|
};
|
|
270
337
|
if (pack !== void 0) push.pack = pack;
|
|
271
338
|
const stopped = new AbortController();
|
|
272
339
|
push.signal = stopped.signal;
|
|
273
|
-
const updates = yield* pushFetched(push).pipe(Effect.mapError((error) => negotiated?.pack.failure() ?? error), Effect.onInterrupt(() => Effect.sync(() => {
|
|
274
|
-
stopped.abort();
|
|
275
|
-
negotiated?.pack.cancel();
|
|
276
|
-
})));
|
|
277
340
|
return {
|
|
278
341
|
refs,
|
|
279
342
|
shallow,
|
|
280
|
-
unshallow
|
|
281
|
-
updates
|
|
343
|
+
unshallow,
|
|
344
|
+
updates: yield* pushFetched(push).pipe(Effect.mapError((error) => negotiated?.pack.failure() ?? error), Effect.onInterrupt(() => Effect.sync(() => {
|
|
345
|
+
stopped.abort();
|
|
346
|
+
negotiated?.pack.cancel();
|
|
347
|
+
})))
|
|
282
348
|
};
|
|
283
349
|
}));
|
|
284
350
|
/**
|
|
@@ -68,7 +68,7 @@ export declare const pushSlices: (push: {
|
|
|
68
68
|
};
|
|
69
69
|
}[];
|
|
70
70
|
};
|
|
71
|
-
reason: "ambiguous" | "atomic-partner" | "awaiting-index" | "body-ended" | "boundary-not-in-pack" | "busy" | "call-budget" | "candidate-cancelled" | "candidate-superseded" | "changed-while-checked" | "cursor-expired" | "delta-too-large" | "diff-limit" | "diverged" | "entry-gone" | "entry-unpublishable" | "event-version" | "events-undelivered" | "events-waiting" | "fetch-depth-unsupported" | "fetch-plan-too-large" | "files-refused" | "fsck" | "graph-length" | "history-not-imported" | "import-cancelled" | "importing" | "job-step-calls" | "job-step-yielded" | "key-reused" | "link-wrong-type" | "may-have-saved" | "merge-conflict" | "merge-incomplete" | "merges-off" | "name-churn" | "newer-format" | "no-copy-rows" | "no-queue" | "no-releases" | "no-sync" | "no-topics" | "not-a-fork" | "object-missing" | "object-too-large" | "ofs-delta" | "own-repo" | "packs-awaiting-repack" | "provider-unknown" | "prune-walk-too-large" | "queue-full" | "queue-targets-full" | "rate-limited" | "ref-conflict" | "remote-refused" | "response-too-large" | "shallow-root" | "shallow-upload" | "stage-gone" | "tag-target-missing" | "too-many-gitmodules-and-gitattributes" | "too-many-parents" | "too-many-pointers" | "too-many-short-ids" | "too-many-store-calls" | "too-many-writes" | "unrelated-histories" | "unsupported-attribute" | "unsupported-virtual-base" | "walk-limit" | undefined;
|
|
71
|
+
reason: "ambiguous" | "atomic-partner" | "awaiting-index" | "body-ended" | "boundary-not-in-pack" | "busy" | "call-budget" | "candidate-cancelled" | "candidate-superseded" | "changed-while-checked" | "cursor-expired" | "delta-too-large" | "diff-limit" | "diverged" | "entry-gone" | "entry-unpublishable" | "event-version" | "events-undelivered" | "events-waiting" | "fetch-depth-unsupported" | "fetch-plan-too-large" | "files-refused" | "fsck" | "graph-length" | "history-not-imported" | "import-cancelled" | "importing" | "job-step-calls" | "job-step-yielded" | "key-reused" | "link-wrong-type" | "may-have-saved" | "merge-conflict" | "merge-incomplete" | "merges-off" | "name-churn" | "newer-format" | "no-copy-rows" | "no-queue" | "no-releases" | "no-sync" | "no-topics" | "not-a-fork" | "object-missing" | "object-too-large" | "ofs-delta" | "own-repo" | "packs-awaiting-repack" | "provider-unknown" | "prune-walk-too-large" | "queue-full" | "queue-targets-full" | "rate-limited" | "ref-conflict" | "remote-refused" | "repo-too-large" | "response-too-large" | "shallow-root" | "shallow-upload" | "stage-gone" | "starting" | "tag-target-missing" | "too-many-gitmodules-and-gitattributes" | "too-many-parents" | "too-many-pointers" | "too-many-short-ids" | "too-many-store-calls" | "too-many-writes" | "unrelated-histories" | "unsupported-attribute" | "unsupported-virtual-base" | "walk-limit" | undefined;
|
|
72
72
|
};
|
|
73
73
|
} | {
|
|
74
74
|
refusal?: never;
|
|
@@ -24,9 +24,10 @@ export type HiddenSpan = typeof HiddenSpan.Type;
|
|
|
24
24
|
/**
|
|
25
25
|
* Which refs one caller sees, from its `refs.private` answer. A ref it doesn't see answers as a
|
|
26
26
|
* missing one on every surface. `whole` is true when it reads every pattern: then it sees every
|
|
27
|
-
* ref, and nothing is filtered
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* ref, and nothing is filtered, but an owned prefix's refs, which only its owner reads: Git's view
|
|
28
|
+
* of a whole caller leaves them out, as its spans. A caller who isn't whole sees none of Git's own
|
|
29
|
+
* refs, a merge queue's candidates under `refs/queue/` and an import's staging under
|
|
30
|
+
* `refs/import/`, since they hold whatever their entries hold, private commits too.
|
|
30
31
|
*/
|
|
31
32
|
export interface RefView {
|
|
32
33
|
readonly whole: boolean;
|
|
@@ -50,12 +51,12 @@ export interface RefView {
|
|
|
50
51
|
* ref under it, and the listing answers empty with no read.
|
|
51
52
|
* - Every name in a span is hidden: a pattern the caller reads, listed before the one that
|
|
52
53
|
* hides it, ends the span, since a ref is private by the first pattern that matches it.
|
|
53
|
-
* Git's own prefixes are spans too, for a caller who isn't whole.
|
|
54
|
+
* Git's own prefixes are spans too, for a caller who isn't whole, and owned ones for any.
|
|
54
55
|
* - Every hidden name is in a span, but a classed pattern's: `refs.count` counts the prefix less
|
|
55
56
|
* the spans, with no row read out. A ref view that leaves another hidden name out of them, an
|
|
56
57
|
* empty list with `sees` left to filter included, counts that ref where no listing shows it,
|
|
57
58
|
* so a caller learns how many refs under a prefix it can't see: the count less the listing's
|
|
58
|
-
* length. `whole` answers
|
|
59
|
+
* length. `whole` answers only owned prefixes' spans.
|
|
59
60
|
* - A classed pattern's names, one with a `*` that matches no `/`, scatter through its range, so
|
|
60
61
|
* none of its own is a span, though it may end one. Where the server keeps a ref index a
|
|
61
62
|
* listing reads `plainSpans` and `classes` instead, and while the repo's index is rebuilt it
|
|
@@ -72,7 +73,7 @@ export interface RefView {
|
|
|
72
73
|
* less the names of each exact name or last-`**` pattern before it that the caller reads, and
|
|
73
74
|
* Git's own prefixes. `refs.count` counts the plain class less them and adds each of `classes`,
|
|
74
75
|
* so a span too few or too many counts a ref no listing shows, or leaves one out. `whole`
|
|
75
|
-
* answers
|
|
76
|
+
* answers only owned prefixes' spans.
|
|
76
77
|
*/
|
|
77
78
|
readonly plainSpans: (prefix: string) => readonly HiddenSpan[];
|
|
78
79
|
/**
|
|
@@ -99,8 +100,7 @@ export interface RefView {
|
|
|
99
100
|
readonly publishes: (pattern: RefName) => boolean;
|
|
100
101
|
}
|
|
101
102
|
/**
|
|
102
|
-
* Private branches, as `PrivateRefs.layer` configures them,
|
|
103
|
-
* `access`. Without it, everyone who may read a repo sees all of it, and none of this runs.
|
|
103
|
+
* Private branches, as `PrivateRefs.layer` configures them. Without it, everyone who may read a repo sees all of it, and none of this runs.
|
|
104
104
|
*/
|
|
105
105
|
export interface AccessOption {
|
|
106
106
|
/** The patterns `privateRefs` was given, as written, in order. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Operation } from "./operations.mjs";
|
|
2
2
|
import { RefAudience } from "./access.mjs";
|
|
3
|
-
import { Accepted,
|
|
3
|
+
import { Accepted, DecisionAnswer } from "./result.mjs";
|
|
4
4
|
import { TokenInfo } from "./tokens.mjs";
|
|
5
5
|
import * as Schema from "effect/Schema";
|
|
6
6
|
/**
|
|
@@ -124,8 +124,6 @@ export declare const AuthInput: Schema.Struct<{
|
|
|
124
124
|
readonly signal: Schema.declare<AbortSignal, AbortSignal>;
|
|
125
125
|
}>;
|
|
126
126
|
export type AuthInput = typeof AuthInput.Type;
|
|
127
|
-
/** Who is calling: `undefined` for a credential it doesn't know. */
|
|
128
|
-
export type GitAuth<Meta = unknown> = (input: AuthInput) => Awaitable<Actor<Meta> | undefined>;
|
|
129
127
|
/**
|
|
130
128
|
* The extension's grant resolver that identified a caller, by its `name`, for reading only: Git
|
|
131
129
|
* never trusts it, so a caller built by hand with it is a plain caller. To keep a caller's grant,
|
|
@@ -173,35 +171,5 @@ export type AuthorizeInput<Meta = unknown> = Acting<Meta> & {
|
|
|
173
171
|
readonly repo?: RepoAccess;
|
|
174
172
|
readonly signal: AbortSignal;
|
|
175
173
|
};
|
|
176
|
-
/**
|
|
177
|
-
* Whether they may. A merge queue's publish asks again, for each entry, as the caller that added
|
|
178
|
-
* it, with `at: 'queued'` and no actor `meta`: decide it from the actor's ID, and never grant on
|
|
179
|
-
* `meta`'s absence.
|
|
180
|
-
*
|
|
181
|
-
* A refusal reaches the caller exactly as it's returned when it names a code of
|
|
182
|
-
* its own, such as `FAILED_PRECONDITION`: Git can't tell who may know a repo exists, so it passes
|
|
183
|
-
* that code on. The default refusal, `reject` with no code, `NOT_ALLOWED` or `NOT_FOUND`, answers
|
|
184
|
-
* a stranger as for a repo that isn't there: `UNAUTHENTICATED` when anonymous, so Git asks to sign
|
|
185
|
-
* in, and `NOT_FOUND` when signed in. A refusal of anything but a read or a create, whatever its code,
|
|
186
|
-
* reaches only a caller you'd let read the repo; anyone else gets your answer to a read, and a
|
|
187
|
-
* name with no repo answers as a read of it would. So return the
|
|
188
|
-
* default refusal to anyone who may not know a private repo exists, and a code of your own only
|
|
189
|
-
* to a caller who may.
|
|
190
|
-
*
|
|
191
|
-
* A `token.create` names whom the token is for, its `subject`, and any `actor` acting for them,
|
|
192
|
-
* since a token's caller is its subject: refuse one a caller mints for anyone they may not act as.
|
|
193
|
-
* Decided 21 Nov by the coordinator.
|
|
194
|
-
*
|
|
195
|
-
* A `refs.private` operation, asked only of a server made with `access`, is accepted with the
|
|
196
|
-
* caller's `RefAudience`: `accept({ read, publish })`. Any other is accepted with no value. One
|
|
197
|
-
* asked with no `repo` is an import's, before it makes the repo the operation names: decide it
|
|
198
|
-
* from the caller, the name and the patterns, as `repo.create`, and read no repo, as none is
|
|
199
|
-
* there yet. An importer who reads fewer than every pattern is refused the import.
|
|
200
|
-
*
|
|
201
|
-
* Decide about a repo by its `repo.internalId`, the repo the call then acts on. A name can move
|
|
202
|
-
* between repos while you decide: swap two repos' names and back around one call, and a host that
|
|
203
|
-
* decides by `repo.name` alone answers about the other repo (the coordinator, Q871, 25 Nov).
|
|
204
|
-
*/
|
|
205
|
-
export type GitAuthorize<Meta = unknown> = (input: AuthorizeInput<Meta>) => Awaitable<AuthorizeAnswer>;
|
|
206
|
-
/** What `authorize` answers: a decision, or for `refs.private`, the caller's ref audience. */
|
|
174
|
+
/** What a `Policy` answers: a decision, or for `refs.private`, the caller's ref audience. */
|
|
207
175
|
export type AuthorizeAnswer = DecisionAnswer | Accepted<RefAudience>;
|
|
@@ -36,8 +36,8 @@ export type CreatedObject = typeof CreatedObject.Type;
|
|
|
36
36
|
export interface BlobCalls {
|
|
37
37
|
/**
|
|
38
38
|
* Any blob the repo holds, its `bytes` streamed and checked against its ID as they go: a
|
|
39
|
-
* mismatch errors the stream with `DATA_LOSS`. Its `bytes` limit has no default, so the
|
|
40
|
-
*
|
|
39
|
+
* mismatch errors the stream with `DATA_LOSS`. Its `bytes` limit has no default, so the largest
|
|
40
|
+
* file a host may let a push take, 1 GiB, caps it. `RESOURCE_EXHAUSTED` with `object-too-large` comes before the first
|
|
41
41
|
* byte for a blob past the `bytes` limit the caller sets, or one stored as a delta past 16 MiB.
|
|
42
42
|
* `milliseconds` limits the call until it answers, not the stream after it.
|
|
43
43
|
*/
|
|
@@ -35,13 +35,18 @@ export interface RemoteRefsInput {
|
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* `refs`: branch names, such as `main`, or full names; every branch and tag when left out.
|
|
38
|
-
* `depth`: commits of history from each tip, a shallow fetch
|
|
39
|
-
*
|
|
40
|
-
*
|
|
38
|
+
* `depth`: commits of history from each tip, a shallow fetch, as `git fetch --depth`. `deepen`:
|
|
39
|
+
* commits more past a shallow repo's edge, as `git fetch --deepen`. `unshallow`: the whole
|
|
40
|
+
* history of a shallow repo, as `git fetch --unshallow`, refused on a repo that isn't shallow.
|
|
41
|
+
* A fetch takes at most one of the three. `filter`: objects left out, a partial fetch, such as
|
|
42
|
+
* `{ kind: 'blob:none' }`. `force`: move a local ref that holds commits the remote's tip doesn't
|
|
43
|
+
* to that tip anyway, as `git fetch --force` does.
|
|
41
44
|
*/
|
|
42
45
|
export interface ClientFetchInput {
|
|
43
46
|
readonly refs?: readonly RefName[];
|
|
44
47
|
readonly depth?: number;
|
|
48
|
+
readonly deepen?: number;
|
|
49
|
+
readonly unshallow?: true;
|
|
45
50
|
readonly filter?: Filter;
|
|
46
51
|
readonly force?: boolean;
|
|
47
52
|
}
|
|
@@ -11,7 +11,7 @@ import * as Schema from "effect/Schema";
|
|
|
11
11
|
import { Listing } from "@ref0/infra";
|
|
12
12
|
import * as Context from "effect/Context";
|
|
13
13
|
declare namespace commits_d_exports {
|
|
14
|
-
export { CommitCalls, CommitCreate, CommitCreateFields, CommitCreateInput, CommitDiff, CommitDiffInput, CommitMessage, CommitPick, CommitPickInput, CommitRevert, CommitRevertInput, Commits, CommitsMergeBase, CommitsMergeBaseInput, Compare, CompareInput, CompareRange, ComparisonFile, ComparisonFileFields, LineCounts, Log, LogInput, RefPublication, Revision, compare, create, diff, get, list, logEmailsMost, mergeBase, pick, revert };
|
|
14
|
+
export { CommitCalls, CommitCreate, CommitCreateFields, CommitCreateInput, CommitDiff, CommitDiffInput, CommitMessage, CommitPick, CommitPickInput, CommitRevert, CommitRevertInput, Commits, CommitsMergeBase, CommitsMergeBaseInput, Compare, CompareInput, CompareRange, ComparisonFile, ComparisonFileFields, LineCounts, Log, LogInput, RefPublication, Revision, compare, create, diff, get, list, logEmailsMost, logExcludeMost, mergeBase, pick, revert };
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* A revision, as a call names a commit: a full object ID, a full ref name, `HEAD` for the
|
|
@@ -23,15 +23,23 @@ export declare const Revision: Schema.String;
|
|
|
23
23
|
export type Revision = typeof Revision.Type;
|
|
24
24
|
/** The most addresses a log's `authors` or `committers` names. */
|
|
25
25
|
export declare const logEmailsMost = 100;
|
|
26
|
+
/** The most revisions a log's `exclude` names. */
|
|
27
|
+
export declare const logExcludeMost = 100;
|
|
26
28
|
/**
|
|
27
|
-
* `git log <ref> [-- <path>]`: newest first; with `path`, only the commits that
|
|
29
|
+
* `git log <ref> [^<exclude>…] [-- <path>]`: newest first; with `path`, only the commits that
|
|
30
|
+
* changed it. `exclude` is Git's `^rev`: the commits `ref` has that none of them has, each
|
|
31
|
+
* resolved as the caller as `ref` is. Like Git's, that walk marks the whole range before its
|
|
32
|
+
* first page, so its cost is the range's, whatever the page's size; `path` doesn't take it.
|
|
28
33
|
* `authors` and `committers` keep the commits whose author's or committer's email is one they
|
|
29
34
|
* name, compared without case. `since` and `until` keep the commits committed at or after and at
|
|
30
35
|
* or before them, as `git log --since` and `--until` do, and as with `--since` the walk follows no
|
|
31
36
|
* commit committed before `since`, so it stops along each line at the first older one.
|
|
37
|
+
* In process a page holds up to `logLimitMost`, 1,001, for a caller that reads a range whole in
|
|
38
|
+
* one walk; the REST API's pages hold up to 200, as every list's do.
|
|
32
39
|
*/
|
|
33
40
|
export declare const Log: Schema.Struct<{
|
|
34
41
|
readonly ref: Schema.String;
|
|
42
|
+
readonly exclude: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
35
43
|
readonly path: Schema.optionalKey<Schema.String>;
|
|
36
44
|
readonly authors: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
37
45
|
readonly committers: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
@@ -28,6 +28,7 @@ var commits_exports = /* @__PURE__ */ __exportAll({
|
|
|
28
28
|
get: () => get,
|
|
29
29
|
list: () => list,
|
|
30
30
|
logEmailsMost: () => 100,
|
|
31
|
+
logExcludeMost: () => 100,
|
|
31
32
|
mergeBase: () => mergeBase,
|
|
32
33
|
pick: () => pick,
|
|
33
34
|
revert: () => revert
|
|
@@ -46,15 +47,22 @@ const logEmailsMost = 100;
|
|
|
46
47
|
* none, and at most `logEmailsMost`.
|
|
47
48
|
*/
|
|
48
49
|
const LogEmails = /* @__PURE__ */ Schema.Array(Schema.String).check(Schema.isMinLength(1, { message: "named no address: leave the field out instead" }), Schema.isMaxLength(100, { message: `named more than 100 addresses` }));
|
|
50
|
+
const LogExclude = /* @__PURE__ */ Schema.Array(Revision).check(Schema.isMaxLength(100, { message: `named more than 100 revisions` }));
|
|
49
51
|
/**
|
|
50
|
-
* `git log <ref> [-- <path>]`: newest first; with `path`, only the commits that
|
|
52
|
+
* `git log <ref> [^<exclude>…] [-- <path>]`: newest first; with `path`, only the commits that
|
|
53
|
+
* changed it. `exclude` is Git's `^rev`: the commits `ref` has that none of them has, each
|
|
54
|
+
* resolved as the caller as `ref` is. Like Git's, that walk marks the whole range before its
|
|
55
|
+
* first page, so its cost is the range's, whatever the page's size; `path` doesn't take it.
|
|
51
56
|
* `authors` and `committers` keep the commits whose author's or committer's email is one they
|
|
52
57
|
* name, compared without case. `since` and `until` keep the commits committed at or after and at
|
|
53
58
|
* or before them, as `git log --since` and `--until` do, and as with `--since` the walk follows no
|
|
54
59
|
* commit committed before `since`, so it stops along each line at the first older one.
|
|
60
|
+
* In process a page holds up to `logLimitMost`, 1,001, for a caller that reads a range whole in
|
|
61
|
+
* one walk; the REST API's pages hold up to 200, as every list's do.
|
|
55
62
|
*/
|
|
56
63
|
const Log = /* @__PURE__ */ Schema.Struct({
|
|
57
64
|
ref: Revision,
|
|
65
|
+
exclude: Schema.optionalKey(LogExclude),
|
|
58
66
|
path: Schema.optionalKey(Schema.String),
|
|
59
67
|
authors: Schema.optionalKey(LogEmails),
|
|
60
68
|
committers: Schema.optionalKey(LogEmails),
|
|
@@ -152,8 +152,8 @@ export declare const FileDiff: Schema.Union<readonly [Schema.Struct<{
|
|
|
152
152
|
export type FileDiff = typeof FileDiff.Type;
|
|
153
153
|
export interface FileCalls {
|
|
154
154
|
/**
|
|
155
|
-
* Files at a revision, each its `bytes` streamed as `blobs.get` streams a blob, to the
|
|
156
|
-
*
|
|
155
|
+
* Files at a revision, each its `bytes` streamed as `blobs.get` streams a blob, to the largest
|
|
156
|
+
* file a host may let a push take, 1 GiB. A page holds as many as fit 8 MiB as base64, and a file past it alone, which
|
|
157
157
|
* REST sends with no content and its client streams from the blob route. Its `bytes` limit has
|
|
158
158
|
* no default for a file's bytes: when the caller sets one, the page's files count against it.
|
|
159
159
|
*/
|
|
@@ -64,7 +64,9 @@ export interface ForkCalls {
|
|
|
64
64
|
* `repo`'s live forks, the newest first, each named as it's named now. A fork the caller may not
|
|
65
65
|
* read is left out, and nothing counts it, so a page can be short while `next` says more may
|
|
66
66
|
* follow. Each `next` is sealed for this source's list and names no fork, and one that isn't a
|
|
67
|
-
* `next` of it is `INVALID_ARGUMENT`.
|
|
67
|
+
* `next` of it is `INVALID_ARGUMENT`. Unlike `RepoCalls.list`'s names, each fork is read again
|
|
68
|
+
* once `authorize` answers, and one renamed or made public or private meanwhile is asked of again
|
|
69
|
+
* as it is now, so none is listed as it was.
|
|
68
70
|
*/
|
|
69
71
|
readonly list: (repo: RepoName, input: ForkListInput) => Promise<Result<Listing<RepoInfo>>>;
|
|
70
72
|
/**
|
|
@@ -100,6 +102,7 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
|
|
|
100
102
|
readonly defaultBranch?: string;
|
|
101
103
|
readonly public: boolean;
|
|
102
104
|
readonly upstream?: string;
|
|
105
|
+
readonly shallow: boolean;
|
|
103
106
|
readonly stats: {
|
|
104
107
|
readonly repo: string;
|
|
105
108
|
readonly refs: number;
|
|
@@ -127,6 +130,7 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
|
|
|
127
130
|
readonly defaultBranch?: string;
|
|
128
131
|
readonly public: boolean;
|
|
129
132
|
readonly upstream?: string;
|
|
133
|
+
readonly shallow: boolean;
|
|
130
134
|
readonly stats: {
|
|
131
135
|
readonly repo: string;
|
|
132
136
|
readonly refs: number;
|
|
@@ -154,6 +158,7 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
|
|
|
154
158
|
readonly defaultBranch?: string;
|
|
155
159
|
readonly public: boolean;
|
|
156
160
|
readonly upstream?: string;
|
|
161
|
+
readonly shallow: boolean;
|
|
157
162
|
readonly stats: {
|
|
158
163
|
readonly repo: string;
|
|
159
164
|
readonly refs: number;
|
|
@@ -181,6 +186,7 @@ declare const Forks_base: Context.ServiceClass<Forks, "@ref0/git/Forks", EffectC
|
|
|
181
186
|
readonly defaultBranch?: string;
|
|
182
187
|
readonly public: boolean;
|
|
183
188
|
readonly upstream?: string;
|
|
189
|
+
readonly shallow: boolean;
|
|
184
190
|
readonly stats: {
|
|
185
191
|
readonly repo: string;
|
|
186
192
|
readonly refs: number;
|
|
@@ -222,6 +228,7 @@ export declare const create: (repo: RepoName, input: ForkCreateInput, by?: Calle
|
|
|
222
228
|
readonly defaultBranch?: string;
|
|
223
229
|
readonly public: boolean;
|
|
224
230
|
readonly upstream?: string;
|
|
231
|
+
readonly shallow: boolean;
|
|
225
232
|
readonly stats: {
|
|
226
233
|
readonly repo: string;
|
|
227
234
|
readonly refs: number;
|
|
@@ -249,6 +256,7 @@ export declare const get: (repo: RepoName, input: ForkGetInput, by?: Caller) =>
|
|
|
249
256
|
readonly defaultBranch?: string;
|
|
250
257
|
readonly public: boolean;
|
|
251
258
|
readonly upstream?: string;
|
|
259
|
+
readonly shallow: boolean;
|
|
252
260
|
readonly stats: {
|
|
253
261
|
readonly repo: string;
|
|
254
262
|
readonly refs: number;
|
|
@@ -276,6 +284,7 @@ export declare const list: (repo: RepoName, input: ForkListInput, by?: Caller) =
|
|
|
276
284
|
readonly defaultBranch?: string;
|
|
277
285
|
readonly public: boolean;
|
|
278
286
|
readonly upstream?: string;
|
|
287
|
+
readonly shallow: boolean;
|
|
279
288
|
readonly stats: {
|
|
280
289
|
readonly repo: string;
|
|
281
290
|
readonly refs: number;
|
|
@@ -303,6 +312,7 @@ export declare const sync: (fork: RepoName, input: WriteInput & Pick<RepoInput,
|
|
|
303
312
|
readonly defaultBranch?: string;
|
|
304
313
|
readonly public: boolean;
|
|
305
314
|
readonly upstream?: string;
|
|
315
|
+
readonly shallow: boolean;
|
|
306
316
|
readonly stats: {
|
|
307
317
|
readonly repo: string;
|
|
308
318
|
readonly refs: number;
|
package/dist/contracts/git.d.mts
CHANGED
|
@@ -15,8 +15,9 @@ import * as Stream from "effect/Stream";
|
|
|
15
15
|
/**
|
|
16
16
|
* The host, acting as itself (Q223): the caller host code's calls name, as `hostCalls()` do. A
|
|
17
17
|
* call made by it skips the host's `authorize`, but for a push rule's bypass, sees every ref,
|
|
18
|
-
* private or not,
|
|
19
|
-
* caller built to look like it, is an anonymous
|
|
18
|
+
* private or not, but an owned prefix's, which only its owner reads, and lists every repo. Only
|
|
19
|
+
* this one value is the host: a copy of it, or any caller built to look like it, is an anonymous
|
|
20
|
+
* caller, refused what a stranger is.
|
|
20
21
|
*/
|
|
21
22
|
export declare const host: Caller;
|
|
22
23
|
/** Whether `caller` is `host` itself, the one value that is. */
|
|
@@ -40,11 +41,19 @@ export interface RegisterInput {
|
|
|
40
41
|
*/
|
|
41
42
|
readonly repoScopes?: (repo: InternalRepoId) => readonly string[];
|
|
42
43
|
/**
|
|
43
|
-
* A registered prefix, such as `refs/queue/`: a ref under it only the registration moves, and
|
|
44
|
-
* caller who reads every private pattern sees
|
|
45
|
-
*
|
|
44
|
+
* A registered prefix, such as `refs/queue/`: a ref under it only the registration moves, and
|
|
45
|
+
* only a caller who reads every private pattern sees, or with `refsReadBy: 'owner'` only the
|
|
46
|
+
* registration. No two registrations' prefixes overlap, none overlaps Git's own `refs/import/`,
|
|
47
|
+
* and none is under `refs/heads/` or `refs/tags/`.
|
|
46
48
|
*/
|
|
47
49
|
readonly refs?: `refs/${string}/`;
|
|
50
|
+
/**
|
|
51
|
+
* Who reads `refs`' refs. `readers`, when left out: a caller who reads every private pattern, as
|
|
52
|
+
* above. `owner`: the registration alone, with its `owner` on `refs.get`. No listing, count,
|
|
53
|
+
* fetch, fork or other `refs.get` shows one, whatever the caller reads, such as the drop-in's
|
|
54
|
+
* merge fences. Given with no `refs`, it fails the build.
|
|
55
|
+
*/
|
|
56
|
+
readonly refsReadBy?: 'readers' | 'owner';
|
|
48
57
|
/**
|
|
49
58
|
* Prefixes whose refs `Git.host` writes for someone with `refs.update`'s `onBehalfOf`, such as
|
|
50
59
|
* `refs/pull/`: every reader of the repo sees them, and anyone with push may move them too. Each
|
|
@@ -54,8 +63,10 @@ export interface RegisterInput {
|
|
|
54
63
|
readonly publishes?: readonly `refs/${string}/`[];
|
|
55
64
|
}
|
|
56
65
|
/**
|
|
57
|
-
* What only a registered prefix's owner holds: it moves the prefix's refs, which no one else
|
|
58
|
-
*
|
|
66
|
+
* What only a registered prefix's owner holds: it moves the prefix's refs, which no one else does,
|
|
67
|
+
* and reads them through any view. An owned prefix's, registered with `refsReadBy: 'owner'`, no
|
|
68
|
+
* one else reads either. Only Git's registry makes one, as a registration's `owner`: a copy of it
|
|
69
|
+
* owns nothing.
|
|
59
70
|
*/
|
|
60
71
|
export interface RefOwner {
|
|
61
72
|
readonly prefix: `refs/${string}/`;
|
package/dist/contracts/git.mjs
CHANGED
|
@@ -4,8 +4,9 @@ import * as Context from "effect/Context";
|
|
|
4
4
|
/**
|
|
5
5
|
* The host, acting as itself (Q223): the caller host code's calls name, as `hostCalls()` do. A
|
|
6
6
|
* call made by it skips the host's `authorize`, but for a push rule's bypass, sees every ref,
|
|
7
|
-
* private or not,
|
|
8
|
-
* caller built to look like it, is an anonymous
|
|
7
|
+
* private or not, but an owned prefix's, which only its owner reads, and lists every repo. Only
|
|
8
|
+
* this one value is the host: a copy of it, or any caller built to look like it, is an anonymous
|
|
9
|
+
* caller, refused what a stranger is.
|
|
9
10
|
*/
|
|
10
11
|
const host = Object.freeze({ actor: Object.freeze({ anonymous: true }) });
|
|
11
12
|
/** Whether `caller` is `host` itself, the one value that is. */
|
package/dist/contracts/lfs.d.mts
CHANGED
|
@@ -17,13 +17,6 @@ export interface LfsOptions {
|
|
|
17
17
|
/** The CPU one of the host's requests may use, in milliseconds, as a Worker's `limits.cpu_ms`. */
|
|
18
18
|
readonly cpuMs?: number;
|
|
19
19
|
}
|
|
20
|
-
/**
|
|
21
|
-
* Turns on Git LFS: `lfs()`, from `@ref0/git`, which `createGitServer` builds `Lfs.layer()` for,
|
|
22
|
-
* with its options. A bucket alone turns nothing on.
|
|
23
|
-
*/
|
|
24
|
-
export interface LfsFeature extends LfsOptions {
|
|
25
|
-
readonly kind: 'lfs';
|
|
26
|
-
}
|
|
27
20
|
/** An LFS object, by its oid, the SHA-256 of its bytes in 64 hex digits. */
|
|
28
21
|
export interface LfsGetInput extends ActorInput, Pick<RepoInput, 'internalId'> {
|
|
29
22
|
readonly oid: string;
|