@amalgm/live 0.2.81-preview.45244924054 → 0.2.81-preview.45708334404
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/apply/settling.d.ts +1 -1
- package/dist/apply/settling.js +1 -1
- package/dist/clash/echo.d.ts +15 -29
- package/dist/clash/echo.d.ts.map +1 -1
- package/dist/clash/echo.js +17 -41
- package/dist/clash/echo.js.map +1 -1
- package/dist/detection/record-proposal.d.ts +10 -8
- package/dist/detection/record-proposal.d.ts.map +1 -1
- package/dist/detection/record-proposal.js +3 -3
- package/dist/detection/record-proposal.js.map +1 -1
- package/dist/git/commands.d.ts +3 -0
- package/dist/git/commands.d.ts.map +1 -0
- package/dist/git/commands.js +35 -0
- package/dist/git/commands.js.map +1 -0
- package/dist/git/index.d.ts +2 -2
- package/dist/git/index.d.ts.map +1 -1
- package/dist/git/index.js +2 -2
- package/dist/git/index.js.map +1 -1
- package/dist/git/play.d.ts +26 -16
- package/dist/git/play.d.ts.map +1 -1
- package/dist/git/play.js +65 -18
- package/dist/git/play.js.map +1 -1
- package/dist/git/tag.d.ts +54 -0
- package/dist/git/tag.d.ts.map +1 -0
- package/dist/git/tag.js +68 -0
- package/dist/git/tag.js.map +1 -0
- package/dist/git/turns.d.ts +105 -75
- package/dist/git/turns.d.ts.map +1 -1
- package/dist/git/turns.js +131 -91
- package/dist/git/turns.js.map +1 -1
- package/dist/records/contracts.d.ts.map +1 -1
- package/dist/records/contracts.js +3 -2
- package/dist/records/contracts.js.map +1 -1
- package/dist-cjs/apply/settling.js +1 -1
- package/dist-cjs/clash/echo.js +18 -42
- package/dist-cjs/clash/echo.js.map +1 -1
- package/dist-cjs/detection/record-proposal.js +3 -3
- package/dist-cjs/detection/record-proposal.js.map +1 -1
- package/dist-cjs/git/commands.js +39 -0
- package/dist-cjs/git/commands.js.map +1 -0
- package/dist-cjs/git/index.js +2 -2
- package/dist-cjs/git/index.js.map +1 -1
- package/dist-cjs/git/play.js +65 -18
- package/dist-cjs/git/play.js.map +1 -1
- package/dist-cjs/git/tag.js +72 -0
- package/dist-cjs/git/tag.js.map +1 -0
- package/dist-cjs/git/turns.js +136 -96
- package/dist-cjs/git/turns.js.map +1 -1
- package/dist-cjs/records/contracts.js +3 -2
- package/dist-cjs/records/contracts.js.map +1 -1
- package/package.json +5 -5
- package/dist/git/hooks.d.ts +0 -140
- package/dist/git/hooks.d.ts.map +0 -1
- package/dist/git/hooks.js +0 -240
- package/dist/git/hooks.js.map +0 -1
- package/dist/git/line.d.ts +0 -116
- package/dist/git/line.d.ts.map +0 -1
- package/dist/git/line.js +0 -412
- package/dist/git/line.js.map +0 -1
- package/dist-cjs/git/hooks.js +0 -249
- package/dist-cjs/git/hooks.js.map +0 -1
- package/dist-cjs/git/line.js +0 -418
- package/dist-cjs/git/line.js.map +0 -1
package/dist/git/play.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A repository record played onto the state here
|
|
3
|
-
* the size of a whole Git directory.
|
|
2
|
+
* A repository record played onto the state here.
|
|
4
3
|
*
|
|
5
4
|
* A record states the Git directory its sender's change was made from (V,
|
|
6
5
|
* its artifact's basis) and what it became (Y). The state here is the line
|
|
@@ -9,12 +8,18 @@
|
|
|
9
8
|
* records in the same order makes the same state, since nothing here names
|
|
10
9
|
* the machine playing:
|
|
11
10
|
*
|
|
12
|
-
* -
|
|
13
|
-
*
|
|
14
|
-
* - Every other ref and every other Git-directory file is the record's when
|
|
15
|
-
* the record changed it from V, else L's: a record moves what it moved, and
|
|
11
|
+
* - Every ref and every other Git-directory file is the record's when the
|
|
12
|
+
* record changed it from V, else L's: a record moves what it moved, and
|
|
16
13
|
* what it left alone stays as the line holds it. A ref the record removed
|
|
17
14
|
* stays removed.
|
|
15
|
+
* - A branch the line moved too is never rolled back. It follows the record
|
|
16
|
+
* only where the record's commit was built on the line's, as Git's own
|
|
17
|
+
* fast-forward. A record that diverged (made offline, or with no turn:
|
|
18
|
+
* docs/git-turns.md) leaves the line's branch where it stands, and its
|
|
19
|
+
* commits are kept beside it on a branch of their own,
|
|
20
|
+
* `amalgm/<branch>-<id>` (`GitPlayed.aside`). The next record made on those
|
|
21
|
+
* commits moves that same branch on, so one computer's offline work is one
|
|
22
|
+
* branch however many commits it holds.
|
|
18
23
|
* - A reflog keeps L's lines less those the record removed, then the
|
|
19
24
|
* record's new ones. When its ref ends where none of those lines put it,
|
|
20
25
|
* one more line moves it there, so `@{0}` names where the ref stands. The
|
|
@@ -37,7 +42,6 @@
|
|
|
37
42
|
import { utf8Decode, utf8Encode } from '../entities/bytes.js';
|
|
38
43
|
import { GIT_ALTERNATES_PATH } from './alternates.js';
|
|
39
44
|
import { gitBlobId } from './artifact.js';
|
|
40
|
-
import { GitLine } from './line.js';
|
|
41
45
|
import { gitChainReflog, gitDropPackedRefs, gitLooseRef, gitPackedRefs, gitReflogPlay, gitReflogTop } from './refs.js';
|
|
42
46
|
import { gitBytesForm, gitSelfHeld, gitSharesGitDir, gitSharesObjects, isGitOid } from './state.js';
|
|
43
47
|
import { compareGitText } from './text.js';
|
|
@@ -104,6 +108,12 @@ const isLooseRef = (file) => file.mode !== FOLDER
|
|
|
104
108
|
const isRefFile = (file) => isLooseRef(file) || file.path === 'packed-refs';
|
|
105
109
|
const isReflogPath = (path) => path.startsWith('logs/');
|
|
106
110
|
const STASH = 'refs/stash';
|
|
111
|
+
const BRANCHES = 'refs/heads/';
|
|
112
|
+
/** Where aside branches stand, and the least of a commit's ID one is named by. */
|
|
113
|
+
const ASIDE = `${BRANCHES}amalgm`;
|
|
114
|
+
const ASIDE_ID = 7;
|
|
115
|
+
const ASIDE_NAMED = /^[0-9a-f]{7,}$/;
|
|
116
|
+
const beneath = (path, folder) => path.startsWith(`${folder}/`);
|
|
107
117
|
/** The record played onto the line. `bytes` reads any blob a side's files
|
|
108
118
|
* name. */
|
|
109
119
|
export async function gitPlayRecord(sides, bytes, git, sha256) {
|
|
@@ -171,25 +181,61 @@ export async function gitPlayRecord(sides, bytes, git, sha256) {
|
|
|
171
181
|
else
|
|
172
182
|
played.set(stashLog, make(stashLog, stash));
|
|
173
183
|
}
|
|
174
|
-
const branches = new GitLine(git);
|
|
175
184
|
const finals = new Map();
|
|
185
|
+
const diverged = [];
|
|
176
186
|
for (const name of [...names].sort(compareGitText)) {
|
|
177
187
|
const [line, basis, record] = await Promise.all(SIDES.map(side => value(side, name)));
|
|
178
|
-
let final;
|
|
188
|
+
let final = basis !== record ? record : line;
|
|
179
189
|
if (name === STASH) {
|
|
180
190
|
if (stash === null)
|
|
181
191
|
continue;
|
|
182
192
|
final = gitReflogTop(stash);
|
|
183
193
|
}
|
|
184
|
-
else if (name.startsWith(
|
|
185
|
-
&& [line,
|
|
186
|
-
|
|
194
|
+
else if (name.startsWith(BRANCHES) && line !== null && line !== basis && final !== line
|
|
195
|
+
&& [line, record].every(oid => oid === null || isGitOid(sides.record.format, oid))) {
|
|
196
|
+
// Both sides moved this branch: the line's stands unless the record's
|
|
197
|
+
// was built on it.
|
|
198
|
+
if (record === null || !await git.builtOn(record, line)) {
|
|
199
|
+
final = line;
|
|
200
|
+
if (record !== null && !await git.builtOn(line, record))
|
|
201
|
+
diverged.push({ name, basis, record });
|
|
202
|
+
}
|
|
187
203
|
}
|
|
188
|
-
else
|
|
189
|
-
final = basis !== record ? record : line;
|
|
190
204
|
if (final !== line)
|
|
191
205
|
finals.set(name, final);
|
|
192
206
|
}
|
|
207
|
+
// Each diverged commit goes to the aside branch that stood at the commit it
|
|
208
|
+
// was made from, else to a new one named by as much of its ID as leaves the
|
|
209
|
+
// name free. Where no name can stand, since Git holds no branch beneath
|
|
210
|
+
// another, the commit is kept by its branch's reflog alone.
|
|
211
|
+
const aside = [];
|
|
212
|
+
if (diverged.length > 0) {
|
|
213
|
+
const held = new Map();
|
|
214
|
+
for (const name of new Set([...files.line.keys(), ...(await packedOf('line')).keys(), ...finals.keys()])) {
|
|
215
|
+
if (name !== ASIDE && !beneath(name, ASIDE))
|
|
216
|
+
continue;
|
|
217
|
+
const oid = finals.has(name) ? finals.get(name) : await value('line', name);
|
|
218
|
+
if (oid !== null)
|
|
219
|
+
held.set(name, oid);
|
|
220
|
+
}
|
|
221
|
+
const free = (name, commit) => (held.get(name) ?? commit) === commit
|
|
222
|
+
&& ![...held.keys()].some(other => beneath(name, other) || beneath(other, name));
|
|
223
|
+
for (const { name, basis, record } of diverged) {
|
|
224
|
+
const stem = `${ASIDE}/${name.slice(BRANCHES.length)}-`;
|
|
225
|
+
let branch = [...held.keys()].sort(compareGitText).find(other => held.get(other) === basis
|
|
226
|
+
&& other.startsWith(stem) && ASIDE_NAMED.test(other.slice(stem.length)));
|
|
227
|
+
for (let size = ASIDE_ID; branch === undefined && size <= record.length; size += 1) {
|
|
228
|
+
if (free(stem + record.slice(0, size), record))
|
|
229
|
+
branch = stem + record.slice(0, size);
|
|
230
|
+
}
|
|
231
|
+
if (branch === undefined)
|
|
232
|
+
continue;
|
|
233
|
+
if (await value('line', branch) !== record)
|
|
234
|
+
finals.set(branch, record);
|
|
235
|
+
held.set(branch, record);
|
|
236
|
+
aside.push({ branch, from: name, commit: record });
|
|
237
|
+
}
|
|
238
|
+
}
|
|
193
239
|
// The line's ref files, with each ref that ends elsewhere written loose or
|
|
194
240
|
// dropped.
|
|
195
241
|
for (const [path, file] of [...played])
|
|
@@ -248,10 +294,11 @@ export async function gitPlayRecord(sides, bytes, git, sha256) {
|
|
|
248
294
|
// The index follows HEAD: the record claims it when it changed the index
|
|
249
295
|
// or the commit HEAD names.
|
|
250
296
|
const headOf = (side) => value(side, 'HEAD').then(head => commitOf(head, name => value(side, name)));
|
|
251
|
-
const
|
|
252
|
-
const claims = sides.record.index?.meaning !== sides.basis?.index?.meaning
|
|
297
|
+
const recordHead = await headOf('record');
|
|
298
|
+
const claims = sides.record.index?.meaning !== sides.basis?.index?.meaning
|
|
299
|
+
|| recordHead !== (sides.basis === null ? null : await headOf('basis'));
|
|
253
300
|
const [chosen, from] = claims
|
|
254
|
-
? [sides.record.index,
|
|
301
|
+
? [sides.record.index, recordHead]
|
|
255
302
|
: [sides.line.index, await headOf('line')];
|
|
256
303
|
let index = chosen;
|
|
257
304
|
if (chosen?.files.length === 1 && from !== null && headCommit !== null && from !== headCommit) {
|
|
@@ -265,7 +312,7 @@ export async function gitPlayRecord(sides, bytes, git, sha256) {
|
|
|
265
312
|
return {
|
|
266
313
|
state: { format: sides.record.format, home: sides.record.home, files: asTree(played, files.record), index },
|
|
267
314
|
made,
|
|
268
|
-
|
|
315
|
+
aside,
|
|
269
316
|
};
|
|
270
317
|
}
|
|
271
318
|
//# sourceMappingURL=play.js.map
|
package/dist/git/play.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"play.js","sourceRoot":"","sources":["../../src/git/play.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAmB,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACvH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,QAAQ,EAA8C,MAAM,YAAY,CAAC;AAChJ,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAgC3C;;;;;;;;4DAQ4D;AAC5D,MAAM,UAAU,YAAY,CAAC,MAG5B;IACC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,QAAQ,IAAI,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AE;QAC3G,IAAI;QACJ,KAAK;KACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tag: what makes a repository answer only to our Git.
|
|
3
|
+
*
|
|
4
|
+
* Git refuses a repository whose own configuration names an extension it
|
|
5
|
+
* does not know. Ours is `extensions.amalgm`, which only our Git knows: in
|
|
6
|
+
* a tagged repository our Git asks this computer's runtime before every
|
|
7
|
+
* command (turns.ts), and any other Git stops with one line and changes
|
|
8
|
+
* nothing. So no Git command can run in a tagged repository without asking.
|
|
9
|
+
*
|
|
10
|
+
* - **On.** Every repository the cloud holds carries the tag, from the pass
|
|
11
|
+
* that first records it: a usable `.git` found in registered ground,
|
|
12
|
+
* inside the home or outside through a durable link, nested, a submodule,
|
|
13
|
+
* a linked worktree, or made there by any other Git. The tag is written
|
|
14
|
+
* in the configuration of the repository's common directory, so one tag
|
|
15
|
+
* covers every worktree of that storage. A repository `.amalgmignore` has
|
|
16
|
+
* always kept from the cloud is never tagged: no other computer has it,
|
|
17
|
+
* so there is nobody to take turns with.
|
|
18
|
+
* - **It travels.** A repository's own configuration is part of its state,
|
|
19
|
+
* so the tag is one more change: a repository that arrives on another
|
|
20
|
+
* computer arrives tagged, and nothing tags it twice.
|
|
21
|
+
* - **Kept.** Inside registered ground the tag is ours. A hand that takes
|
|
22
|
+
* it off, or an older state applied over it, is one more change the next
|
|
23
|
+
* pass reads, and that pass puts the tag back. A repository newly kept
|
|
24
|
+
* from sharing stays tagged: the cloud still holds it.
|
|
25
|
+
* - **Only with our Git.** A computer tags nothing unless its own Git opens
|
|
26
|
+
* a tagged repository. It would otherwise lock itself out of every
|
|
27
|
+
* project it tagged.
|
|
28
|
+
* - **Off.** Uninstalling Amalgm takes the tag off every repository this
|
|
29
|
+
* computer enrolled, so any Git opens them again. A repository carried
|
|
30
|
+
* out of registered ground by hand keeps the tag: our Git opens it and
|
|
31
|
+
* the runtime, knowing nothing of it, says go at once; on a computer
|
|
32
|
+
* with only another Git the person runs `GIT_TAG_OFF` once.
|
|
33
|
+
*/
|
|
34
|
+
/** The extension only our Git knows. */
|
|
35
|
+
export declare const GIT_TAG = "extensions.amalgm";
|
|
36
|
+
/** What a person runs, in a tagged repository's folder, to open it with a
|
|
37
|
+
* Git that is not ours. Where `.git` is a file (a submodule, a linked
|
|
38
|
+
* worktree), the tag is in the storage that file names, in its common
|
|
39
|
+
* directory for a linked worktree: the person names that `config` instead. */
|
|
40
|
+
export declare const GIT_TAG_OFF = "git config --file .git/config --unset-all extensions.amalgm";
|
|
41
|
+
/** One `git config --file <configuration>` edit, as the arguments after the
|
|
42
|
+
* file. */
|
|
43
|
+
export type GitTagEdit = readonly string[];
|
|
44
|
+
/**
|
|
45
|
+
* The edits that make one configuration file carry the tag (`on`) or not.
|
|
46
|
+
* `listing` is that file as `git config --file <it> --list -z` prints it.
|
|
47
|
+
* Empty when it already agrees.
|
|
48
|
+
*
|
|
49
|
+
* Git reads extensions only in format version 1. Taking the tag off puts
|
|
50
|
+
* the version back to 0 only when no other extension is left, so a
|
|
51
|
+
* repository that needs version 1 for its own reasons keeps it.
|
|
52
|
+
*/
|
|
53
|
+
export declare function gitTagEdits(listing: string, on: boolean): readonly GitTagEdit[];
|
|
54
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/git/tag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,wCAAwC;AACxC,eAAO,MAAM,OAAO,sBAAsB,CAAC;AAI3C;;;8EAG8E;AAC9E,eAAO,MAAM,WAAW,gEAAyD,CAAC;AAElF;WACW;AACX,MAAM,MAAM,UAAU,GAAG,SAAS,MAAM,EAAE,CAAC;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,GAAG,SAAS,UAAU,EAAE,CAe/E"}
|
package/dist/git/tag.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tag: what makes a repository answer only to our Git.
|
|
3
|
+
*
|
|
4
|
+
* Git refuses a repository whose own configuration names an extension it
|
|
5
|
+
* does not know. Ours is `extensions.amalgm`, which only our Git knows: in
|
|
6
|
+
* a tagged repository our Git asks this computer's runtime before every
|
|
7
|
+
* command (turns.ts), and any other Git stops with one line and changes
|
|
8
|
+
* nothing. So no Git command can run in a tagged repository without asking.
|
|
9
|
+
*
|
|
10
|
+
* - **On.** Every repository the cloud holds carries the tag, from the pass
|
|
11
|
+
* that first records it: a usable `.git` found in registered ground,
|
|
12
|
+
* inside the home or outside through a durable link, nested, a submodule,
|
|
13
|
+
* a linked worktree, or made there by any other Git. The tag is written
|
|
14
|
+
* in the configuration of the repository's common directory, so one tag
|
|
15
|
+
* covers every worktree of that storage. A repository `.amalgmignore` has
|
|
16
|
+
* always kept from the cloud is never tagged: no other computer has it,
|
|
17
|
+
* so there is nobody to take turns with.
|
|
18
|
+
* - **It travels.** A repository's own configuration is part of its state,
|
|
19
|
+
* so the tag is one more change: a repository that arrives on another
|
|
20
|
+
* computer arrives tagged, and nothing tags it twice.
|
|
21
|
+
* - **Kept.** Inside registered ground the tag is ours. A hand that takes
|
|
22
|
+
* it off, or an older state applied over it, is one more change the next
|
|
23
|
+
* pass reads, and that pass puts the tag back. A repository newly kept
|
|
24
|
+
* from sharing stays tagged: the cloud still holds it.
|
|
25
|
+
* - **Only with our Git.** A computer tags nothing unless its own Git opens
|
|
26
|
+
* a tagged repository. It would otherwise lock itself out of every
|
|
27
|
+
* project it tagged.
|
|
28
|
+
* - **Off.** Uninstalling Amalgm takes the tag off every repository this
|
|
29
|
+
* computer enrolled, so any Git opens them again. A repository carried
|
|
30
|
+
* out of registered ground by hand keeps the tag: our Git opens it and
|
|
31
|
+
* the runtime, knowing nothing of it, says go at once; on a computer
|
|
32
|
+
* with only another Git the person runs `GIT_TAG_OFF` once.
|
|
33
|
+
*/
|
|
34
|
+
/** The extension only our Git knows. */
|
|
35
|
+
export const GIT_TAG = 'extensions.amalgm';
|
|
36
|
+
const FORMAT = 'core.repositoryformatversion';
|
|
37
|
+
/** What a person runs, in a tagged repository's folder, to open it with a
|
|
38
|
+
* Git that is not ours. Where `.git` is a file (a submodule, a linked
|
|
39
|
+
* worktree), the tag is in the storage that file names, in its common
|
|
40
|
+
* directory for a linked worktree: the person names that `config` instead. */
|
|
41
|
+
export const GIT_TAG_OFF = `git config --file .git/config --unset-all ${GIT_TAG}`;
|
|
42
|
+
/**
|
|
43
|
+
* The edits that make one configuration file carry the tag (`on`) or not.
|
|
44
|
+
* `listing` is that file as `git config --file <it> --list -z` prints it.
|
|
45
|
+
* Empty when it already agrees.
|
|
46
|
+
*
|
|
47
|
+
* Git reads extensions only in format version 1. Taking the tag off puts
|
|
48
|
+
* the version back to 0 only when no other extension is left, so a
|
|
49
|
+
* repository that needs version 1 for its own reasons keeps it.
|
|
50
|
+
*/
|
|
51
|
+
export function gitTagEdits(listing, on) {
|
|
52
|
+
const entries = new Map(listing.split('\0').filter(entry => entry !== '').map((entry) => {
|
|
53
|
+
const at = entry.indexOf('\n');
|
|
54
|
+
return at < 0 ? [entry, 'true'] : [entry.slice(0, at), entry.slice(at + 1)];
|
|
55
|
+
}));
|
|
56
|
+
const tagged = entries.has(GIT_TAG);
|
|
57
|
+
if (on) {
|
|
58
|
+
return [
|
|
59
|
+
...(entries.get(FORMAT) === '1' ? [] : [[FORMAT, '1']]),
|
|
60
|
+
...(entries.get(GIT_TAG) === 'true' ? [] : [[GIT_TAG, 'true']]),
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
if (!tagged)
|
|
64
|
+
return [];
|
|
65
|
+
const others = [...entries.keys()].some(key => key.startsWith('extensions.') && key !== GIT_TAG);
|
|
66
|
+
return [['--unset-all', GIT_TAG], ...(others ? [] : [[FORMAT, '0']])];
|
|
67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AO,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;SAChE,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,MAAM,MAAM,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,GAAG,KAAK,OAAO,CAAC,CAAC;IACjG,OAAO,CAAC,CAAC,aAAa,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACxE,CAAC"}
|
package/dist/git/turns.d.ts
CHANGED
|
@@ -1,54 +1,61 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Git turns: one waiting line per repository, shared by every computer that
|
|
3
|
-
* holds it, so two of them never
|
|
3
|
+
* holds it, so two of them never change the repository with Git at once.
|
|
4
4
|
*
|
|
5
|
-
* A turn is not a new rail.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
5
|
+
* A turn is not a new rail. Every Git command in a tagged repository
|
|
6
|
+
* (tag.ts) asks this computer's runtime before it reads or locks anything,
|
|
7
|
+
* and a command that may change the repository (commands.ts) needs this
|
|
8
|
+
* computer to hold the turn. Asking for the turn is one record on the
|
|
9
|
+
* repository's own channel (`turnProposal`): it goes to the Outbox, the
|
|
10
|
+
* authority gives it the channel's next position, and it comes back in every
|
|
11
|
+
* computer's Inbox like any other record. The waiting line is nothing but
|
|
12
|
+
* those records read in channel order, so every computer derives the same
|
|
13
|
+
* line, and each record's place among the repository's changes says exactly
|
|
14
|
+
* what happened before it.
|
|
12
15
|
*
|
|
13
|
-
* - **Ask.**
|
|
14
|
-
*
|
|
15
|
-
* computer has
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
16
|
+
* - **Ask.** A command that may change the repository waits while its
|
|
17
|
+
* computer asks for the turn. The ask joins the end of the line. A
|
|
18
|
+
* computer that already has a turn in the line asks nothing more: the
|
|
19
|
+
* turn is the computer's, and every command it runs uses it. Except one
|
|
20
|
+
* that arrives while that turn is first and another computer waits behind
|
|
21
|
+
* it (`gitTurnTakes`): it waits for its computer's next turn, so
|
|
22
|
+
* computers take turns however many commands each of them runs.
|
|
23
|
+
* - **Go.** The command goes when its computer's turn is first in the line
|
|
24
|
+
* and this computer has nothing of the repository still to apply from
|
|
25
|
+
* another computer up to the record that made it first
|
|
26
|
+
* (`GitTurnLine.first`): the results of the turn before it are among
|
|
27
|
+
* them. Only the Git command waits: Receive and Apply go on, or the
|
|
28
|
+
* result it waits for could never arrive.
|
|
29
|
+
* - **End.** A turn is ended by the computer that holds it. Git's own end
|
|
30
|
+
* is the signal: once no command of its that may change the repository is
|
|
31
|
+
* running or waiting, the computer records what they left and says the
|
|
32
|
+
* end, at once when another computer waits behind it and else after the
|
|
33
|
+
* repository has been quiet for `GIT_TURN_QUIET_MS` (`gitTurnRest`).
|
|
34
|
+
* Per-computer Outbox order then gives the channel ask, results, end, so
|
|
35
|
+
* whoever is next has every result before its own go.
|
|
36
|
+
* - **Check.** A computer waiting behind a turn that has been first for
|
|
37
|
+
* `GIT_TURN_CHECK_MS` asks its holder once. A holder with a command still
|
|
38
|
+
* running says so and keeps its turn, however slow the command is; one
|
|
39
|
+
* with none ends its turn. A check nobody answers for
|
|
40
|
+
* `GIT_TURN_ANSWER_MS` lets any computer end the turn: its holder is
|
|
41
|
+
* skipped, and a command of its that finishes later is one more record,
|
|
42
|
+
* played after the one before it like every file change. Every wait is
|
|
43
|
+
* counted on the authority's own stamps.
|
|
36
44
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* them; a computer that cannot reach it asks nobody and Git goes ahead.
|
|
45
|
+
* A command that only reads takes no turn. The authority orders turns and
|
|
46
|
+
* never polices them; a computer that cannot reach it asks nobody and Git
|
|
47
|
+
* goes ahead.
|
|
41
48
|
*/
|
|
42
49
|
import type { GitTurn } from '../detection/record-proposal.js';
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export declare const
|
|
50
|
+
/** How long a turn may be first, or have gone on since its holder last said
|
|
51
|
+
* a command of its was running, before a waiting computer may check on it. */
|
|
52
|
+
export declare const GIT_TURN_CHECK_MS = 30000;
|
|
53
|
+
/** How long a check may stand unanswered before any computer may end the
|
|
54
|
+
* turn it asked about. */
|
|
55
|
+
export declare const GIT_TURN_ANSWER_MS = 5000;
|
|
56
|
+
/** How long a computer keeps a turn nobody waits for after its last command
|
|
57
|
+
* that may change the repository ended. */
|
|
58
|
+
export declare const GIT_TURN_QUIET_MS = 30000;
|
|
52
59
|
/** One turn record as the authority accepted it. */
|
|
53
60
|
export interface GitTurnRecord {
|
|
54
61
|
readonly sequence: number;
|
|
@@ -61,37 +68,54 @@ export interface GitOpenTurn {
|
|
|
61
68
|
/** The mutation id of the ask. */
|
|
62
69
|
readonly ask: string;
|
|
63
70
|
readonly deviceId: string;
|
|
64
|
-
readonly event: string;
|
|
65
71
|
}
|
|
66
|
-
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
72
|
+
/** What the channel says of the first turn. `sequence` is the record that
|
|
73
|
+
* made it first: its ask when the line was empty, else the end of the turn
|
|
74
|
+
* before it. `heldAt` is when its holder was last known to hold it, by the
|
|
75
|
+
* authority's stamp: when it became first, or its holder's newest answer to
|
|
76
|
+
* a check. `checkedAt` is the stamp of the check standing unanswered, or
|
|
77
|
+
* null. */
|
|
78
|
+
export interface GitFirstTurn {
|
|
79
|
+
readonly sequence: number;
|
|
80
|
+
readonly heldAt: number;
|
|
81
|
+
readonly checkedAt: number | null;
|
|
82
|
+
}
|
|
83
|
+
/** A repository's waiting line after some prefix of its channel. `first`
|
|
84
|
+
* speaks of `open[0]` and is null while the line is empty. */
|
|
69
85
|
export interface GitTurnLine {
|
|
70
86
|
readonly open: readonly GitOpenTurn[];
|
|
71
|
-
readonly
|
|
72
|
-
readonly sequence: number;
|
|
73
|
-
readonly acceptedAt: number;
|
|
74
|
-
} | null;
|
|
87
|
+
readonly first: GitFirstTurn | null;
|
|
75
88
|
}
|
|
76
89
|
export declare const GIT_TURN_LINE_EMPTY: GitTurnLine;
|
|
77
90
|
/**
|
|
78
91
|
* The line with one more turn record played, in channel order.
|
|
79
92
|
*
|
|
80
|
-
* An ask joins the end; a computer has one turn per repository, so its
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
93
|
+
* - An ask joins the end; a computer has one turn per repository, so its
|
|
94
|
+
* earlier open turn ends with it.
|
|
95
|
+
* - A check counts when another computer says it of the first turn, no
|
|
96
|
+
* check stands, and the turn has been held for the check wait.
|
|
97
|
+
* - A running counts when the turn's own computer answers a standing check:
|
|
98
|
+
* the turn is held from that stamp and may be checked again.
|
|
99
|
+
* - An end closes the turn it names when its author is the turn's own
|
|
100
|
+
* computer, or when a check of it has stood unanswered for the answer
|
|
101
|
+
* wait.
|
|
102
|
+
*
|
|
103
|
+
* Every other record, and one naming a turn already closed, plays as
|
|
104
|
+
* nothing.
|
|
85
105
|
*/
|
|
86
106
|
export declare function playGitTurn(line: GitTurnLine, record: GitTurnRecord): GitTurnLine;
|
|
87
|
-
/**
|
|
88
|
-
* milliseconds:
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
|
|
107
|
+
/** What a computer waiting behind the first turn says next, and in how many
|
|
108
|
+
* milliseconds: a check once the turn has been held for the check wait, or,
|
|
109
|
+
* while a check stands, the end once it has gone unanswered for the answer
|
|
110
|
+
* wait. `acceptedAt` is the newest acceptance this computer has read on the
|
|
111
|
+
* channel, so a turn left open long ago is checked at once. Null while the
|
|
112
|
+
* line is empty. */
|
|
113
|
+
export declare function gitTurnDue(line: GitTurnLine, acceptedAt: number): {
|
|
114
|
+
readonly act: 'check' | 'end';
|
|
115
|
+
readonly in: number;
|
|
116
|
+
} | null;
|
|
93
117
|
/** Where one ask stands: `first` with the channel position this computer
|
|
94
|
-
* must have applied through before its
|
|
118
|
+
* must have applied through before its commands go, `waiting` behind
|
|
95
119
|
* another computer's turn, or `closed` when it is no longer in the line. */
|
|
96
120
|
export type GitTurnStanding = {
|
|
97
121
|
readonly state: 'first';
|
|
@@ -102,15 +126,21 @@ export type GitTurnStanding = {
|
|
|
102
126
|
readonly state: 'closed';
|
|
103
127
|
};
|
|
104
128
|
export declare function gitTurnStanding(line: GitTurnLine, ask: string): GitTurnStanding;
|
|
105
|
-
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
*
|
|
115
|
-
export declare
|
|
129
|
+
/** Whether a command that arrives now uses its computer's turn `ask`. Not
|
|
130
|
+
* when that turn is first and another computer waits behind it: the turn
|
|
131
|
+
* ends with the commands already using it, and this one waits for its
|
|
132
|
+
* computer's next turn, asked once that end is said. */
|
|
133
|
+
export declare function gitTurnTakes(line: GitTurnLine, ask: string): boolean;
|
|
134
|
+
/** Whether a waiting command goes (`gitTurnStanding` of its computer's
|
|
135
|
+
* ask). `owed` is whether this computer still has another computer's change
|
|
136
|
+
* of the repository to apply before the go. A turn no longer in the line
|
|
137
|
+
* goes at once: nothing is left to wait in, and its result is one more
|
|
138
|
+
* record like any other. */
|
|
139
|
+
export declare function gitTurnGoes(standing: GitTurnStanding, owed: boolean): boolean;
|
|
140
|
+
/** How many more milliseconds a computer keeps its turn `ask` once no
|
|
141
|
+
* command of its that may change the repository is running or waiting, the
|
|
142
|
+
* last of them having ended `quietMs` ago. Nothing when another computer is
|
|
143
|
+
* in the line, or when the turn is not first: a turn nobody here uses never
|
|
144
|
+
* keeps another computer waiting. */
|
|
145
|
+
export declare function gitTurnRest(line: GitTurnLine, ask: string, quietMs: number): number;
|
|
116
146
|
//# sourceMappingURL=turns.d.ts.map
|
package/dist/git/turns.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turns.d.ts","sourceRoot":"","sources":["../../src/git/turns.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"turns.d.ts","sourceRoot":"","sources":["../../src/git/turns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAE/D;8EAC8E;AAC9E,eAAO,MAAM,iBAAiB,QAAS,CAAC;AAExC;0BAC0B;AAC1B,eAAO,MAAM,kBAAkB,OAAQ,CAAC;AAExC;2CAC2C;AAC3C,eAAO,MAAM,iBAAiB,QAAS,CAAC;AAExC,oDAAoD;AACpD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC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