oh-my-space 2.0.2 → 2.0.3
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/build-info.json +1 -1
- package/dist/oms.js +50 -29
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"commit":"
|
|
1
|
+
{"commit":"4b2d752a2ebab84cca6b4ce34ec540123c2e9d54","skills":{"oms-branch":{"version":"1.2.0","omsVersion":">=1.0.0-0"},"oms-pointer":{"version":"1.2.0","omsVersion":">=1.0.0-0"},"oms-workspace":{"version":"1.4.0","omsVersion":">=1.2.0-0"}}}
|
package/dist/oms.js
CHANGED
|
@@ -15220,19 +15220,37 @@ var operationMarkers = [
|
|
|
15220
15220
|
["BISECT_LOG", "bisect"],
|
|
15221
15221
|
["sequencer", "cherry-pick or revert"]
|
|
15222
15222
|
];
|
|
15223
|
+
var rootOperationMarkers = operationMarkers.filter(([marker]) => marker !== "sequencer");
|
|
15224
|
+
var sourcePathArgs = ["rev-parse", ...operationMarkers.flatMap(([marker]) => ["--git-path", marker])];
|
|
15225
|
+
var rootPathArgs = ["rev-parse", ...rootOperationMarkers.flatMap(([marker]) => ["--git-path", marker])];
|
|
15223
15226
|
function inspectOperations(dir, strict, includeSequencer) {
|
|
15224
|
-
|
|
15225
|
-
|
|
15226
|
-
|
|
15227
|
+
const markers = includeSequencer ? operationMarkers : rootOperationMarkers;
|
|
15228
|
+
const lookup = runGit(dir, includeSequencer ? sourcePathArgs : rootPathArgs);
|
|
15229
|
+
const paths = lookup.stdout.trimEnd().split("\n");
|
|
15230
|
+
if (strict && (!lookup.success || lookup.stderr.trim() || paths.length < markers.length)) {
|
|
15231
|
+
return { kind: "unreadable", marker: markers[0][0], access: false };
|
|
15232
|
+
}
|
|
15233
|
+
const batched = lookup.success && paths.length === markers.length;
|
|
15234
|
+
for (let index = 0; index < markers.length; index++) {
|
|
15235
|
+
const [marker, label] = markers[index];
|
|
15236
|
+
let path;
|
|
15237
|
+
if (batched) {
|
|
15238
|
+
path = paths[index].trim();
|
|
15239
|
+
} else {
|
|
15240
|
+
const result = runGit(dir, ["rev-parse", "--git-path", marker]);
|
|
15241
|
+
if (strict && (!result.success || result.stderr.trim())) return { kind: "unreadable", marker, access: false };
|
|
15242
|
+
if (!result.success) continue;
|
|
15243
|
+
path = result.stdout.trim();
|
|
15244
|
+
}
|
|
15227
15245
|
if (strict) {
|
|
15228
|
-
if (!path
|
|
15246
|
+
if (!path) return { kind: "unreadable", marker, access: false };
|
|
15229
15247
|
try {
|
|
15230
|
-
lstatSync2(resolve4(dir, path
|
|
15248
|
+
lstatSync2(resolve4(dir, path));
|
|
15231
15249
|
return { kind: "active", label };
|
|
15232
15250
|
} catch (error) {
|
|
15233
15251
|
if (error.code !== "ENOENT") return { kind: "unreadable", marker, access: true };
|
|
15234
15252
|
}
|
|
15235
|
-
} else if (
|
|
15253
|
+
} else if (existsSync5(resolve4(dir, path))) {
|
|
15236
15254
|
return { kind: "active", label };
|
|
15237
15255
|
}
|
|
15238
15256
|
}
|
|
@@ -15495,10 +15513,18 @@ __name(inspectCleanSourceSafety, "inspectCleanSourceSafety");
|
|
|
15495
15513
|
// scripts/lib/branch-baseline.ts
|
|
15496
15514
|
import { existsSync as existsSync7, readFileSync as readFileSync4 } from "node:fs";
|
|
15497
15515
|
import { join as join6 } from "node:path";
|
|
15498
|
-
function readGitConfigValues(
|
|
15499
|
-
const
|
|
15500
|
-
|
|
15501
|
-
|
|
15516
|
+
function readGitConfigValues(entries2, key) {
|
|
15517
|
+
const prefix = `${key}
|
|
15518
|
+
`;
|
|
15519
|
+
const values = [];
|
|
15520
|
+
for (const entry of entries2) {
|
|
15521
|
+
if (!entry.startsWith(prefix)) continue;
|
|
15522
|
+
for (const line of entry.slice(prefix.length).split("\n")) {
|
|
15523
|
+
const value = line.trim();
|
|
15524
|
+
if (value) values.push(value);
|
|
15525
|
+
}
|
|
15526
|
+
}
|
|
15527
|
+
return values;
|
|
15502
15528
|
}
|
|
15503
15529
|
__name(readGitConfigValues, "readGitConfigValues");
|
|
15504
15530
|
function countSectionHeaders(content, path) {
|
|
@@ -15560,22 +15586,20 @@ function collectSources(repoRoot) {
|
|
|
15560
15586
|
}
|
|
15561
15587
|
__name(collectSources, "collectSources");
|
|
15562
15588
|
function observeSource(repoRoot, source, path) {
|
|
15563
|
-
const problem = /* @__PURE__ */ __name((message
|
|
15589
|
+
const problem = /* @__PURE__ */ __name((message) => ({
|
|
15564
15590
|
ok: false,
|
|
15565
15591
|
warning: `${source.label} ${message}`,
|
|
15566
|
-
refusal: `${source.label} ${message}
|
|
15592
|
+
refusal: `${source.label} ${message}; repair it, then retry`
|
|
15567
15593
|
}), "problem");
|
|
15568
|
-
if (countSectionHeaders(source.rawContent, path) > 1) return problem(`has duplicate "${path}" submodule sections
|
|
15569
|
-
|
|
15570
|
-
|
|
15571
|
-
|
|
15572
|
-
const paths = readGitConfigValues(
|
|
15573
|
-
if (
|
|
15574
|
-
|
|
15575
|
-
|
|
15576
|
-
|
|
15577
|
-
if (branches.values.length > 1) return problem(`has multiple "branch" values for "${path}"`, true);
|
|
15578
|
-
return { ok: true, source: source.label, branch: branches.values[0] ?? null };
|
|
15594
|
+
if (countSectionHeaders(source.rawContent, path) > 1) return problem(`has duplicate "${path}" submodule sections`);
|
|
15595
|
+
const parsed = productionGitRunner(repoRoot, ["config", "--file", "-", "--null", "--list"], Buffer.from(source.rawContent));
|
|
15596
|
+
if (!parsed.success) return problem("has invalid Git config syntax");
|
|
15597
|
+
const entries2 = parsed.stdout.split("\0");
|
|
15598
|
+
const paths = readGitConfigValues(entries2, `submodule.${path}.path`);
|
|
15599
|
+
if (paths.length > 1) return problem(`has multiple "path" values for "${path}"`);
|
|
15600
|
+
const branches = readGitConfigValues(entries2, `submodule.${path}.branch`);
|
|
15601
|
+
if (branches.length > 1) return problem(`has multiple "branch" values for "${path}"`);
|
|
15602
|
+
return { ok: true, source: source.label, branch: branches[0] ?? null };
|
|
15579
15603
|
}
|
|
15580
15604
|
__name(observeSource, "observeSource");
|
|
15581
15605
|
function observeMetadata(repoRoot, alias) {
|
|
@@ -17405,14 +17429,11 @@ function captureContext(root, alias) {
|
|
|
17405
17429
|
if (!new RegExp(`^160000 [0-9a-f]{40,64} 0\\t${path.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\0$`).test(index.stdout)) {
|
|
17406
17430
|
throw new Error(`Selected registration is inconsistent; run "oms sync ${alias}" first.`);
|
|
17407
17431
|
}
|
|
17408
|
-
const
|
|
17432
|
+
const keyPrefix = `submodule.${path}.`;
|
|
17409
17433
|
const snapshots = [];
|
|
17410
17434
|
for (const args of [["--blob", "HEAD:.gitmodules"], ["--blob", ":.gitmodules"], ["--file", ".gitmodules"], ["--local"]]) {
|
|
17411
|
-
checked(root, ["config", ...args, "--list"], "Cannot inspect selected registration configuration");
|
|
17412
|
-
const
|
|
17413
|
-
const absentLocal = args[0] === "--local" && result.exitCode === 1 && !result.stderr.trim();
|
|
17414
|
-
if (!result.success && !absentLocal || result.stderr.trim()) throw new Error("Selected registration information could not be inspected; repair registration with oms sync, then retry.");
|
|
17415
|
-
const entries2 = result.stdout.split("\0").filter(Boolean).sort();
|
|
17435
|
+
const result = checked(root, ["config", ...args, "--null", "--list"], "Cannot inspect selected registration configuration");
|
|
17436
|
+
const entries2 = result.stdout.split("\0").filter((entry) => entry.startsWith(keyPrefix)).sort();
|
|
17416
17437
|
if (args[0] !== "--local" && !entries2.includes(`submodule.${path}.path
|
|
17417
17438
|
${path}`)) throw new Error("Selected registration path changed or is inconsistent; run oms sync first.");
|
|
17418
17439
|
snapshots.push(JSON.stringify(entries2));
|