@mutmutco/cli 4.3.53 → 4.3.55

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 (2) hide show
  1. package/dist/main.cjs +32 -13
  2. package/package.json +1 -1
package/dist/main.cjs CHANGED
@@ -4777,7 +4777,22 @@ async function isFastForward(run, ancestor, descendant) {
4777
4777
  return false;
4778
4778
  }
4779
4779
  }
4780
- async function syncOneBranch(run, branch, currentBranch2, warn) {
4780
+ async function checkedOutWorktrees(run) {
4781
+ const map = /* @__PURE__ */ new Map();
4782
+ let out = "";
4783
+ try {
4784
+ out = await run("git", ["worktree", "list", "--porcelain"]);
4785
+ } catch {
4786
+ return map;
4787
+ }
4788
+ let path2 = "";
4789
+ for (const line of out.split(/\r?\n/)) {
4790
+ if (line.startsWith("worktree ")) path2 = line.slice("worktree ".length);
4791
+ else if (line.startsWith("branch refs/heads/") && path2) map.set(line.slice("branch refs/heads/".length), path2);
4792
+ }
4793
+ return map;
4794
+ }
4795
+ async function syncOneBranch(run, branch, currentBranch2, worktrees, warn) {
4781
4796
  const localSha = await revParse(run, `refs/heads/${branch}`);
4782
4797
  if (!localSha) {
4783
4798
  return { branch, status: "skipped", reason: "no-local-branch", note: `${branch}: no local branch \u2014 skipped` };
@@ -4794,13 +4809,16 @@ async function syncOneBranch(run, branch, currentBranch2, warn) {
4794
4809
  warn?.(note);
4795
4810
  return { branch, status: "skipped", reason: "diverged", note };
4796
4811
  }
4812
+ const linked = branch === currentBranch2 ? void 0 : worktrees.get(branch);
4813
+ const inTree = linked ? ["-C", linked] : [];
4797
4814
  try {
4798
- if (branch === currentBranch2) {
4799
- const porcelain = await run("git", ["status", "--porcelain"]);
4815
+ if (branch === currentBranch2 || linked) {
4816
+ const porcelain = await run("git", [...inTree, "status", "--porcelain"]);
4800
4817
  if (porcelainHasBlockingChanges(porcelain)) {
4801
- return { branch, status: "skipped", reason: "current-dirty", note: `${branch}: checked out with local changes \u2014 skipped (commit/stash, then rerun)` };
4818
+ const where = linked ? ` in worktree ${linked}` : "";
4819
+ return { branch, status: "skipped", reason: "current-dirty", note: `${branch}: checked out${where} with local changes \u2014 skipped (commit/stash, then rerun)` };
4802
4820
  }
4803
- await run("git", ["merge", "--ff-only", `origin/${branch}`]);
4821
+ await run("git", [...inTree, "merge", "--ff-only", `origin/${branch}`]);
4804
4822
  } else {
4805
4823
  await run("git", ["fetch", "origin", `${branch}:${branch}`]);
4806
4824
  }
@@ -4828,9 +4846,10 @@ async function syncLocalTrainBranches(run, options = {}) {
4828
4846
  } catch {
4829
4847
  currentBranch2 = "";
4830
4848
  }
4849
+ const worktrees = await checkedOutWorktrees(run);
4831
4850
  const results = [];
4832
4851
  for (const branch of branches) {
4833
- results.push(await syncOneBranch(run, branch, currentBranch2, options.warn));
4852
+ results.push(await syncOneBranch(run, branch, currentBranch2, worktrees, options.warn));
4834
4853
  }
4835
4854
  return { branches: results, changed: results.some((r) => r.status === "synced") };
4836
4855
  }
@@ -15858,10 +15877,10 @@ var rollout_plan_default = {
15858
15877
  note: "The v4.0.0 stamp happens at cut time (D6e #4463); until then the candidate is the origin/development head artifacts (built cli/dist + npm pack), identity proven by dist content hash (D6a)."
15859
15878
  },
15860
15879
  baseline: {
15861
- version: "4.3.53",
15862
- tag: "v4.3.53",
15863
- commit: "8877c0336b18",
15864
- npm: "@mutmutco/cli@4.3.53"
15880
+ version: "4.3.55",
15881
+ tag: "v4.3.55",
15882
+ commit: "7f7f602ac9bc",
15883
+ npm: "@mutmutco/cli@4.3.55"
15865
15884
  },
15866
15885
  exitCriterion: "fleet-n-of-n",
15867
15886
  hubOnlyShortcut: "forbidden",
@@ -15878,14 +15897,14 @@ var rollout_plan_default = {
15878
15897
  repo: "mutmutco/mmi-hub",
15879
15898
  role: "canary",
15880
15899
  schedule: "train",
15881
- v3Target: "v4.3.53"
15900
+ v3Target: "v4.3.55"
15882
15901
  }
15883
15902
  ],
15884
15903
  rollbackTrigger: "Any red inside the post-contract soak window: `devops train gate` FAIL attributable to the v4 doors, Hub endpoint health probe failure, a pre-v4 client admitted instead of receiving actionable HTTP 426, or npm consumer install/doctor failure on the v4-only dist.",
15885
15904
  rollback: {
15886
15905
  independent: true,
15887
- mechanism: "npm dist-tag latest -> 4.3.53 and redeploy the Hub Lambda from tag v4.3.53 (8877c0336b18); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
15888
- v3Target: "v4.3.53 (@mutmutco/cli@4.3.53, tag commit 8877c0336b18 \u2014 last known-good release carrying the repo-index v4-only contract)"
15906
+ mechanism: "npm dist-tag latest -> 4.3.55 and redeploy the Hub Lambda from tag v4.3.55 (7f7f602ac9bc); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
15907
+ v3Target: "v4.3.55 (@mutmutco/cli@4.3.55, tag commit 7f7f602ac9bc \u2014 last known-good release carrying the repo-index v4-only contract)"
15889
15908
  }
15890
15909
  },
15891
15910
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/cli",
3
- "version": "4.3.53",
3
+ "version": "4.3.55",
4
4
  "description": "MMI Future CLI — the org dev toolbox and shared cross-IDE engine for every registry-declared MMI coding surface.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",