@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.
Files changed (63) hide show
  1. package/dist/apply/settling.d.ts +1 -1
  2. package/dist/apply/settling.js +1 -1
  3. package/dist/clash/echo.d.ts +15 -29
  4. package/dist/clash/echo.d.ts.map +1 -1
  5. package/dist/clash/echo.js +17 -41
  6. package/dist/clash/echo.js.map +1 -1
  7. package/dist/detection/record-proposal.d.ts +10 -8
  8. package/dist/detection/record-proposal.d.ts.map +1 -1
  9. package/dist/detection/record-proposal.js +3 -3
  10. package/dist/detection/record-proposal.js.map +1 -1
  11. package/dist/git/commands.d.ts +3 -0
  12. package/dist/git/commands.d.ts.map +1 -0
  13. package/dist/git/commands.js +35 -0
  14. package/dist/git/commands.js.map +1 -0
  15. package/dist/git/index.d.ts +2 -2
  16. package/dist/git/index.d.ts.map +1 -1
  17. package/dist/git/index.js +2 -2
  18. package/dist/git/index.js.map +1 -1
  19. package/dist/git/play.d.ts +26 -16
  20. package/dist/git/play.d.ts.map +1 -1
  21. package/dist/git/play.js +65 -18
  22. package/dist/git/play.js.map +1 -1
  23. package/dist/git/tag.d.ts +54 -0
  24. package/dist/git/tag.d.ts.map +1 -0
  25. package/dist/git/tag.js +68 -0
  26. package/dist/git/tag.js.map +1 -0
  27. package/dist/git/turns.d.ts +105 -75
  28. package/dist/git/turns.d.ts.map +1 -1
  29. package/dist/git/turns.js +131 -91
  30. package/dist/git/turns.js.map +1 -1
  31. package/dist/records/contracts.d.ts.map +1 -1
  32. package/dist/records/contracts.js +3 -2
  33. package/dist/records/contracts.js.map +1 -1
  34. package/dist-cjs/apply/settling.js +1 -1
  35. package/dist-cjs/clash/echo.js +18 -42
  36. package/dist-cjs/clash/echo.js.map +1 -1
  37. package/dist-cjs/detection/record-proposal.js +3 -3
  38. package/dist-cjs/detection/record-proposal.js.map +1 -1
  39. package/dist-cjs/git/commands.js +39 -0
  40. package/dist-cjs/git/commands.js.map +1 -0
  41. package/dist-cjs/git/index.js +2 -2
  42. package/dist-cjs/git/index.js.map +1 -1
  43. package/dist-cjs/git/play.js +65 -18
  44. package/dist-cjs/git/play.js.map +1 -1
  45. package/dist-cjs/git/tag.js +72 -0
  46. package/dist-cjs/git/tag.js.map +1 -0
  47. package/dist-cjs/git/turns.js +136 -96
  48. package/dist-cjs/git/turns.js.map +1 -1
  49. package/dist-cjs/records/contracts.js +3 -2
  50. package/dist-cjs/records/contracts.js.map +1 -1
  51. package/package.json +5 -5
  52. package/dist/git/hooks.d.ts +0 -140
  53. package/dist/git/hooks.d.ts.map +0 -1
  54. package/dist/git/hooks.js +0 -240
  55. package/dist/git/hooks.js.map +0 -1
  56. package/dist/git/line.d.ts +0 -116
  57. package/dist/git/line.d.ts.map +0 -1
  58. package/dist/git/line.js +0 -412
  59. package/dist/git/line.js.map +0 -1
  60. package/dist-cjs/git/hooks.js +0 -249
  61. package/dist-cjs/git/hooks.js.map +0 -1
  62. package/dist-cjs/git/line.js +0 -418
  63. package/dist-cjs/git/line.js.map +0 -1
@@ -1,249 +0,0 @@
1
- "use strict";
2
- /**
3
- * Amalgm hears a person's Git through Git's own configuration hooks:
4
- * `hook.<name>.command` and `hook.<name>.event`, which Git 2.54 and later
5
- * runs beside, and before, whatever hook the repository's own hook directory
6
- * holds. An older Git reads the same lines as nothing and runs no hook of
7
- * ours (`gitRunsConfigurationHooks`).
8
- *
9
- * Nothing is written inside any repository. `.git/hooks` and `.git/config`
10
- * are Git state and travel byte for byte (state.ts), and the hook slot there
11
- * is the person's, or husky's, or whatever `core.hooksPath` names. A
12
- * repository therefore owes our hooks nothing and cannot lose them: one that
13
- * appears, vanishes and returns, breaks and is mended, is replaced, arrives
14
- * through Add or Apply, or nests inside another has them whenever Git can
15
- * use it at all.
16
- *
17
- * Three things decide where our hooks run, all in this lane's local-only
18
- * control tree, none in any ground:
19
- *
20
- * - the person's global configuration holds one line, `include.path` naming
21
- * this lane's scope file. Git reads a missing include as nothing, so the
22
- * line costs nothing while the runtime is stopped;
23
- * - the scope file exists only while the runtime runs. It holds
24
- * `includeIf "gitdir/i:<scope>"` and `"gitdir/i:<scope>/"` per scope: the
25
- * Git storage Watch covers, which is each root and each storage directory
26
- * outside every root that a checkout inside one uses. Git tests the
27
- * condition against the repository's Git directory, then its real path, so
28
- * a scope is a real path;
29
- * - the events file names one hook per event, `<lane>/<event>`, so two lanes
30
- * on one computer each keep their own and none can equal an event name.
31
- *
32
- * Each hook is one line of `sh` held in the events file itself, so no second
33
- * file can be missing when Git runs it. It writes what Git handed it, the
34
- * event, where it ran, its arguments and its standard input, as one record
35
- * in the lane's spool. A missing spool is a stopped runtime and writes
36
- * nothing.
37
- *
38
- * Every hook but a waiting one then ends with 0: it never fails, never waits
39
- * and never changes what Git does. A waiting hook (`gitHookCommand`'s
40
- * `waits`, the before-hooks that ask for a Git turn, turns.ts) stays while
41
- * its record file stands. The runtime answers through that same file: taking
42
- * it away is go, and the hook ends with 0; renaming it to `<name>.no` is no,
43
- * and the hook tells the person to run the command again and ends with 1,
44
- * which is Git's own answer when another Git process holds a repository. A
45
- * runtime that stops takes its spool with it, so every waiting command goes;
46
- * so does one that waited `GIT_HOOK_WAIT_SECONDS` unanswered.
47
- *
48
- * The person keeps every switch Git gives: `hook.<lane>/<event>.enabled
49
- * = false` silences one of ours, `hook.<event>.enabled = false` every
50
- * configured hook of an event. Ours never set `enabled`, so theirs always
51
- * wins.
52
- */
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.GIT_HOOK_NO = exports.GIT_HOOK_WAIT_SECONDS = exports.GIT_HOOK_INPUT_EVENTS = exports.GIT_HOOK_EVENTS = void 0;
55
- exports.gitRunsConfigurationHooks = gitRunsConfigurationHooks;
56
- exports.gitHookScopes = gitHookScopes;
57
- exports.gitHookScopeConfig = gitHookScopeConfig;
58
- exports.gitHookCommand = gitHookCommand;
59
- exports.gitHookEventsConfig = gitHookEventsConfig;
60
- exports.readGitHookRecord = readGitHookRecord;
61
- const turns_js_1 = require("./turns.js");
62
- /** The events our hooks hear: each one Git runs once per thing it does, a
63
- * commit, a rebase step, a checkout, a merge, a push, a rewrite, an `am`
64
- * patch, a gc, a received push. Two are left out because Git runs them many
65
- * times inside one command, and each run starts a process: an earlier
66
- * measurement with them made a rebase on Windows 23 times slower, against
67
- * 2.9 times without them, `reference-transaction` (three times per ref
68
- * update) and `post-index-change` (each index write). `fsmonitor-watchman`,
69
- * `proc-receive` and `push-to-checkout` are left out because a hook for any
70
- * of them is Git's cue to hand it work. */
71
- exports.GIT_HOOK_EVENTS = [
72
- 'applypatch-msg', 'pre-applypatch', 'post-applypatch',
73
- 'pre-commit', 'pre-merge-commit', 'prepare-commit-msg', 'commit-msg', 'post-commit',
74
- 'pre-rebase', 'post-checkout', 'post-merge', 'pre-push',
75
- 'pre-receive', 'update', 'post-receive', 'post-update',
76
- 'pre-auto-gc', 'post-rewrite', 'sendemail-validate',
77
- 'p4-changelist', 'p4-prepare-changelist', 'p4-post-changelist', 'p4-pre-submit',
78
- ];
79
- /** The events Git hands lines on standard input: the refs a push moves, the
80
- * commits a rewrite replaced. Every other event's input is empty, and its
81
- * hook reads none. */
82
- exports.GIT_HOOK_INPUT_EVENTS = ['pre-push', 'pre-receive', 'post-receive', 'post-rewrite'];
83
- /** Whether the Git that answered `git version` with `text` runs
84
- * configuration hooks: 2.54 or later. Null when the text names no version. */
85
- function gitRunsConfigurationHooks(text) {
86
- const version = /^git version (\d+)\.(\d+)/.exec(text.trim());
87
- if (!version)
88
- return null;
89
- const [major, minor] = [Number(version[1]), Number(version[2])];
90
- return major > 2 || (major === 2 && minor >= 54);
91
- }
92
- /** A glob character Git's `gitdir:` pattern would read as one. */
93
- const GLOB = /[\\*?[]/g;
94
- const representable = (text) => text.length > 0 && !/[\0\n]/.test(text);
95
- const quoted = (value) => `"${value.replace(/[\\"]/g, match => `\\${match}`)}"`;
96
- const shQuoted = (value) => `'${value.replace(/'/g, `'\\''`)}'`;
97
- const folded = (path) => path.toLowerCase();
98
- const within = (parent, child) => child === parent || child.startsWith(parent.endsWith('/') ? parent : `${parent}/`);
99
- /** The scopes no other scope contains, each once, compared without case as
100
- * the scope file's conditions are. A path is absolute, real, and spelled as
101
- * Git spells a Git directory, with `/` between names. One Git cannot
102
- * represent (empty, or holding a NUL or line break) is left out. */
103
- function gitHookScopes(paths) {
104
- const candidates = [...new Set(paths.filter(representable).map(path => path.replace(/\/+$/, '') || '/'))]
105
- .sort((left, right) => left.length - right.length || (left < right ? -1 : 1));
106
- const kept = [];
107
- for (const path of candidates) {
108
- if (!kept.some(scope => within(folded(scope), folded(path))))
109
- kept.push(path);
110
- }
111
- return kept.sort();
112
- }
113
- /** The scope file: two conditions per scope, each including the events file.
114
- * Git reads a pattern ending in `/` as everything beneath it and never the
115
- * folder itself, so a scope that is itself a Git directory (a bare
116
- * repository, separated storage) needs the exact pattern too; the two never
117
- * match the same Git directory. Git compares without case (`gitdir/i:`) on
118
- * every system: on a disk that tells case apart, a repository whose path
119
- * differs from a scope's only in case hears our hooks too, and the runtime,
120
- * which reads its own roots, finds it outside them; on one that does not, no
121
- * spelling of a path is missed. Git compares bytes, and a name with an
122
- * accent has two spellings a disk may hand Git, so a scope whose composed and
123
- * decomposed forms differ is written in both. */
124
- function gitHookScopeConfig(scopes, eventsFile) {
125
- if (!representable(eventsFile))
126
- throw new Error('A hook events file is a path without a NUL or line break.');
127
- const condition = (pattern) => `[includeIf ${quoted(`gitdir/i:${pattern}`)}]\n\tpath = ${quoted(eventsFile)}\n`;
128
- return gitHookScopes(scopes)
129
- .flatMap(scope => [...new Set([scope, scope.normalize('NFC'), scope.normalize('NFD')])])
130
- .map(scope => {
131
- const literal = scope.replace(GLOB, match => `\\${match}`);
132
- return scope === '/' ? condition('/') : condition(literal) + condition(`${literal}/`);
133
- })
134
- .join('');
135
- }
136
- const RECORD_MARK = 'amalgm-git-hook 1';
137
- const RECORD_END = '\0end\n';
138
- /** The longest a waiting hook stays before its command goes unanswered. */
139
- exports.GIT_HOOK_WAIT_SECONDS = 120;
140
- /** What a waiting hook's record file is renamed to when the answer is no. */
141
- exports.GIT_HOOK_NO = '.no';
142
- /** A waiting hook's tail. A command nobody is ahead of is answered within
143
- * a tenth of a second, so the hook looks four times in it; after that it
144
- * looks every tenth of a second where `sleep` takes a fraction, else every
145
- * second. It says once why the command is waiting, and reads the answer when
146
- * the record file is gone. Each look is one `sleep` started, so the limit
147
- * counts looks: a system slow to start a process waits longer than the
148
- * seconds named. */
149
- const WAIT = [
150
- 'r="$d/$$-$n"; t=0.1; m=10; w=0',
151
- 'for q in 0.02 0.02 0.03 0.03; do [ -e "$r" ] || break; sleep $q 2>/dev/null || { t=1; m=1; break; }; done',
152
- `while [ -e "$r" ] && [ $w -lt $((m*${exports.GIT_HOOK_WAIT_SECONDS})) ]; do sleep $t 2>/dev/null || break; w=$((w+1));`
153
- + ` [ $w -ne $((m*2)) ] || echo 'amalgm: waiting for a turn on this repository; another computer is changing it' >&2; done`,
154
- `[ ! -e "$r${exports.GIT_HOOK_NO}" ] || { rm -f "$r${exports.GIT_HOOK_NO}"; echo 'amalgm: this repository changed on another computer. Run the command again.' >&2; return 1; }`,
155
- ];
156
- /** The command Git runs for one event, writing into `spool`: one line of
157
- * `sh` builtins. A record file is made with `set -C` (an exclusive create),
158
- * then filled with the header fields and arguments, each ended by a NUL, the
159
- * event's standard input as its lines, and the end mark. A record without
160
- * its end mark is still being written, or was cut off. The folder is asked
161
- * of the shell, in the spelling Windows programs use where the shell has one
162
- * (`pwd -W`), since Git's shell there names folders its own way. A hook
163
- * that `waits` then stays for the runtime's answer. */
164
- function gitHookCommand(event, spool, waits = false) {
165
- if (!representable(spool))
166
- throw new Error('A hook spool is a path without a NUL or line break.');
167
- const input = exports.GIT_HOOK_INPUT_EVENTS.includes(event)
168
- ? [`while IFS= read -r l || [ -n "$l" ]; do printf '%s\\n' "$l"; done`]
169
- : [];
170
- const record = [
171
- `printf '${RECORD_MARK}\\0%s\\0%s\\0%s\\0%s\\0%s\\0%s\\0%s\\0' ${event} "$(pwd -W 2>/dev/null || pwd)"`
172
- + ' "${GIT_DIR-}" "${GIT_INDEX_FILE-}" "${GIT_PREFIX-}" "${GIT_REFLOG_ACTION-}" "$#"',
173
- `for a; do printf '%s\\0' "$a"; done`,
174
- ...input,
175
- `printf '\\0end\\n'`,
176
- ];
177
- return [
178
- `f(){ d=${shQuoted(spool)}`,
179
- '[ -d "$d" ] || return 0',
180
- 'n=0',
181
- 'set -C',
182
- 'until { : > "$d/$$-$n"; } 2>/dev/null; do n=$((n+1)); [ $n -lt 50 ] || return 0; done',
183
- `{ ${record.join('; ')}; } >> "$d/$$-$n" 2>/dev/null`,
184
- ...(waits ? WAIT : []),
185
- 'return 0; }',
186
- 'f',
187
- ].join('; ');
188
- }
189
- /** One hook per event, named `<lane>/<event>`; the lane is any text naming
190
- * this runtime's lane on this computer. The before-hooks that ask for a Git
191
- * turn wait for their answer. */
192
- function gitHookEventsConfig(lane, spool) {
193
- if (!representable(lane))
194
- throw new Error('A hook lane is nonempty text without a NUL or line break.');
195
- return exports.GIT_HOOK_EVENTS
196
- .map(event => `[hook ${quoted(`${lane}/${event}`)}]\n\tcommand = ${quoted(gitHookCommand(event, spool, (0, turns_js_1.asksGitTurn)(event)))}\n\tevent = ${event}\n`)
197
- .join('');
198
- }
199
- const EVENTS = new Set(exports.GIT_HOOK_EVENTS);
200
- const HEADER_FIELDS = 8;
201
- /** One spool file read back. Partial is a record without its end mark;
202
- * invalid is anything a hook does not write. */
203
- function readGitHookRecord(bytes) {
204
- const text = new TextDecoder().decode(bytes);
205
- if (!text.endsWith(RECORD_END))
206
- return RECORD_MARK.startsWith(text.slice(0, RECORD_MARK.length)) ? { state: 'partial' } : { state: 'invalid' };
207
- const body = text.slice(0, -RECORD_END.length);
208
- let at = 0;
209
- const field = () => {
210
- const end = body.indexOf('\0', at);
211
- if (end < 0)
212
- return null;
213
- const value = body.slice(at, end);
214
- at = end + 1;
215
- return value;
216
- };
217
- const header = [];
218
- for (let count = 0; count < HEADER_FIELDS; count += 1) {
219
- const value = field();
220
- if (value === null)
221
- return { state: 'invalid' };
222
- header.push(value);
223
- }
224
- const [mark, event, directory, gitDir, indexFile, prefix, action, argc] = header;
225
- if (mark !== RECORD_MARK || !EVENTS.has(event) || directory === '' || !/^(0|[1-9][0-9]*)$/.test(argc))
226
- return { state: 'invalid' };
227
- const args = [];
228
- for (let count = 0; count < Number(argc); count += 1) {
229
- const value = field();
230
- if (value === null)
231
- return { state: 'invalid' };
232
- args.push(value);
233
- }
234
- const set = (value) => value === '' ? null : value;
235
- return {
236
- state: 'complete',
237
- record: {
238
- event: event,
239
- directory,
240
- gitDir: set(gitDir),
241
- indexFile: set(indexFile),
242
- prefix: set(prefix),
243
- action: set(action),
244
- args,
245
- input: body.slice(at),
246
- },
247
- };
248
- }
249
- //# sourceMappingURL=hooks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/git/hooks.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;;;AA+BH,8DAKC;AAoBD,sCAQC;AAaD,gDAUC;AAkCD,wCAuBC;AAKD,kDAKC;AAuCD,8CAwCC;AAvOD,yCAAyC;AAEzC;;;;;;;;2CAQ2C;AAC9B,QAAA,eAAe,GAAG;IAC7B,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB;IACrD,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa;IACnF,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU;IACvD,aAAa,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa;IACtD,aAAa,EAAE,cAAc,EAAE,oBAAoB;IACnD,eAAe,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,eAAe;CACvE,CAAC;AAIX;;sBAEsB;AACT,QAAA,qB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