git-stack-cli 2.2.7 → 2.3.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/js/index.js CHANGED
@@ -37296,6 +37296,7 @@ async function cli(unsafe_command, unsafe_options) {
37296
37296
  state.actions.debug(log.end(result));
37297
37297
  state.actions.debug(log.output(result));
37298
37298
  if (!options.ignoreExitCode && result.code !== 0) {
37299
+ state.actions.debug(log.non_zero_exit(result));
37299
37300
  reject(new Error(log.error(result)));
37300
37301
  } else {
37301
37302
  resolve(result);
@@ -37332,6 +37333,7 @@ cli.sync = function cli_sync(unsafe_command, unsafe_options) {
37332
37333
  state.actions.debug(log.end(result));
37333
37334
  state.actions.debug(log.output(result));
37334
37335
  if (!options.ignoreExitCode && result.code !== 0) {
37336
+ state.actions.debug(log.non_zero_exit(result));
37335
37337
  throw new Error(log.error(result));
37336
37338
  }
37337
37339
  return result;
@@ -37352,9 +37354,14 @@ var log = {
37352
37354
  return `${result.output}
37353
37355
  `;
37354
37356
  },
37355
- error(result) {
37357
+ non_zero_exit(result) {
37356
37358
  const { command, code, duration } = result;
37357
37359
  return `${command} (exit_code=${code} duration=${duration})`;
37360
+ },
37361
+ error(result) {
37362
+ const lines = [result.output, this.non_zero_exit(result)];
37363
+ return lines.join(`
37364
+ `);
37358
37365
  }
37359
37366
  };
37360
37367
 
@@ -37704,15 +37711,17 @@ function CherryPickCheck(props) {
37704
37711
  try {
37705
37712
  const git_dir = (await cli(`git rev-parse --absolute-git-dir`)).stdout;
37706
37713
  const cherry_pick_file = path2.join(git_dir, "CHERRY_PICK_HEAD");
37707
- const is_cherry_pick = await safe_exists(cherry_pick_file);
37708
- const status = is_cherry_pick ? "prompt" : "done";
37709
- patch({ status });
37714
+ if (await safe_exists(cherry_pick_file)) {
37715
+ return patch({ status: "prompt" });
37716
+ }
37717
+ const git_sequencer_dir = (await cli(`git rev-parse --git-path sequencer`)).stdout;
37718
+ if (await safe_exists(git_sequencer_dir)) {
37719
+ return patch({ status: "prompt" });
37720
+ }
37721
+ patch({ status: "done" });
37710
37722
  } catch (err) {
37711
- actions2.error("Must be run from within a git repository.");
37712
37723
  if (err instanceof Error) {
37713
- if (actions2.isDebug()) {
37714
- actions2.error(err.message);
37715
- }
37724
+ actions2.error(err.message);
37716
37725
  }
37717
37726
  actions2.exit(11);
37718
37727
  }
@@ -38552,11 +38561,8 @@ function DetectInitialPR(props) {
38552
38561
  }
38553
38562
  patch({ status: "done" });
38554
38563
  } catch (err) {
38555
- actions2.error("Must be run from within a git repository.");
38556
38564
  if (err instanceof Error) {
38557
- if (actions2.isDebug()) {
38558
- actions2.error(err.message);
38559
- }
38565
+ actions2.error(err.message);
38560
38566
  }
38561
38567
  actions2.exit(9);
38562
38568
  }
@@ -38672,11 +38678,8 @@ function DirtyCheck(props) {
38672
38678
  patch({ status: "prompt" });
38673
38679
  }
38674
38680
  } catch (err) {
38675
- actions2.error("Must be run from within a git repository.");
38676
38681
  if (err instanceof Error) {
38677
- if (actions2.isDebug()) {
38678
- actions2.error(err.message);
38679
- }
38682
+ actions2.error(err.message);
38680
38683
  }
38681
38684
  actions2.exit(12);
38682
38685
  }
@@ -38757,9 +38760,7 @@ async function run() {
38757
38760
  } catch (err) {
38758
38761
  actions.error("Unable to gather git metadata.");
38759
38762
  if (err instanceof Error) {
38760
- if (actions.isDebug()) {
38761
- actions.error(err.message);
38762
- }
38763
+ actions.error(err.message);
38763
38764
  }
38764
38765
  actions.exit(7);
38765
38766
  }
@@ -38885,9 +38886,7 @@ async function run3() {
38885
38886
  } catch (err) {
38886
38887
  actions.error("Unable to retrieve local commit status.");
38887
38888
  if (err instanceof Error) {
38888
- if (actions.isDebug()) {
38889
- actions.error(err.message);
38890
- }
38889
+ actions.error(err.message);
38891
38890
  }
38892
38891
  }
38893
38892
  }
@@ -38896,12 +38895,261 @@ async function run3() {
38896
38895
  var React45 = __toESM(require_react(), 1);
38897
38896
 
38898
38897
  // src/app/LocalMergeRebase.tsx
38899
- var React32 = __toESM(require_react(), 1);
38898
+ var React35 = __toESM(require_react(), 1);
38900
38899
 
38901
38900
  // src/commands/Rebase.tsx
38902
- var React31 = __toESM(require_react(), 1);
38901
+ var React34 = __toESM(require_react(), 1);
38903
38902
  import fs11 from "node:fs";
38904
38903
 
38904
+ // src/app/Status.tsx
38905
+ var React33 = __toESM(require_react(), 1);
38906
+
38907
+ // src/app/StatusTable.tsx
38908
+ var React32 = __toESM(require_react(), 1);
38909
+
38910
+ // src/app/Table.tsx
38911
+ var React31 = __toESM(require_react(), 1);
38912
+ function Table(props) {
38913
+ if (!props.data.length) {
38914
+ return /* @__PURE__ */ React31.createElement(Container, null, /* @__PURE__ */ React31.createElement(Text, {
38915
+ dimColor: true
38916
+ }, "No data found."));
38917
+ }
38918
+ const RowColumnList = Object.keys(props.columns);
38919
+ const max_col_width = {};
38920
+ for (const col of RowColumnList) {
38921
+ max_col_width[col] = 0;
38922
+ }
38923
+ for (const row of props.data) {
38924
+ for (const col of RowColumnList) {
38925
+ const row_col = row[col];
38926
+ max_col_width[col] = Math.max(String(row_col).length, max_col_width[col]);
38927
+ }
38928
+ }
38929
+ for (const col of RowColumnList) {
38930
+ const maxWidth = props.maxWidth?.[col];
38931
+ if (maxWidth) {
38932
+ max_col_width[col] = maxWidth(max_col_width[col]);
38933
+ }
38934
+ }
38935
+ const { stdout } = use_stdout_default();
38936
+ const available_width = stdout.columns;
38937
+ const columnGap = is_finite_value(props.columnGap) ? props.columnGap : 2;
38938
+ const breathing_room = 1;
38939
+ if (props.fillColumn) {
38940
+ let remaining_space = available_width;
38941
+ for (const col of RowColumnList) {
38942
+ if (props.fillColumn === col) {
38943
+ continue;
38944
+ }
38945
+ remaining_space -= max_col_width[col];
38946
+ }
38947
+ remaining_space -= columnGap * (RowColumnList.length - 1);
38948
+ remaining_space -= breathing_room;
38949
+ if (props.fillColumn) {
38950
+ max_col_width[props.fillColumn] = Math.min(max_col_width[props.fillColumn], remaining_space);
38951
+ }
38952
+ }
38953
+ return /* @__PURE__ */ React31.createElement(Container, null, props.data.map((row, i2) => {
38954
+ return /* @__PURE__ */ React31.createElement(Box_default, {
38955
+ key: i2,
38956
+ flexDirection: "row",
38957
+ columnGap,
38958
+ width: available_width
38959
+ }, RowColumnList.map((column) => {
38960
+ const ColumnComponent = props.columns[column];
38961
+ return /* @__PURE__ */ React31.createElement(Box_default, {
38962
+ key: String(column),
38963
+ width: max_col_width[column]
38964
+ }, /* @__PURE__ */ React31.createElement(ColumnComponent, {
38965
+ row,
38966
+ column
38967
+ }));
38968
+ }));
38969
+ }));
38970
+ }
38971
+ function Container(props) {
38972
+ return /* @__PURE__ */ React31.createElement(Box_default, {
38973
+ flexDirection: "column"
38974
+ }, /* @__PURE__ */ React31.createElement(Box_default, {
38975
+ height: 1
38976
+ }), props.children, /* @__PURE__ */ React31.createElement(Box_default, {
38977
+ height: 1
38978
+ }));
38979
+ }
38980
+
38981
+ // src/core/assertNever.ts
38982
+ function assertNever(value) {
38983
+ console.error("[assertNever]", { value });
38984
+ }
38985
+
38986
+ // src/app/StatusTable.tsx
38987
+ function StatusTable() {
38988
+ const commit_range = Store.useState((state) => state.commit_range);
38989
+ invariant(commit_range, "commit_range must exist");
38990
+ const row_list = [];
38991
+ for (const group of commit_range.group_list) {
38992
+ const row = {
38993
+ count: "",
38994
+ status: "NEW",
38995
+ title: "",
38996
+ url: ""
38997
+ };
38998
+ if (group.id === commit_range.UNASSIGNED) {
38999
+ row.status = "NEW";
39000
+ row.title = "Unassigned";
39001
+ row.count = `0/${group.commits.length}`;
39002
+ row.url = "";
39003
+ } else {
39004
+ if (group.dirty) {
39005
+ row.status = "OUTDATED";
39006
+ } else {
39007
+ row.status = "SYNCED";
39008
+ }
39009
+ if (group.pr) {
39010
+ if (group.pr.state === "MERGED") {
39011
+ row.status = "MERGED";
39012
+ }
39013
+ row.title = group.pr.title;
39014
+ row.count = `${group.pr.commits.length}/${group.commits.length}`;
39015
+ row.url = group.pr.url;
39016
+ } else {
39017
+ row.title = group.title || group.id;
39018
+ row.count = `0/${group.commits.length}`;
39019
+ }
39020
+ }
39021
+ row_list.push(row);
39022
+ }
39023
+ return /* @__PURE__ */ React32.createElement(Table, {
39024
+ data: row_list,
39025
+ fillColumn: "title",
39026
+ maxWidth: {
39027
+ status: (v3) => v3 + 2
39028
+ },
39029
+ columnGap: 3,
39030
+ columns: {
39031
+ status: StatusColumn,
39032
+ count: CountColumn,
39033
+ title: TitleColumn,
39034
+ url: UrlColumn
39035
+ }
39036
+ });
39037
+ }
39038
+ function StatusColumn(props) {
39039
+ const value = props.row[props.column];
39040
+ return /* @__PURE__ */ React32.createElement(Text, {
39041
+ color: get_status_color(props.row),
39042
+ bold: get_status_bold(props.row)
39043
+ }, get_status_icon(props.row), " ", value);
39044
+ }
39045
+ function CountColumn(props) {
39046
+ const value = props.row[props.column];
39047
+ return /* @__PURE__ */ React32.createElement(Text, {
39048
+ dimColor: true
39049
+ }, value);
39050
+ }
39051
+ function TitleColumn(props) {
39052
+ const value = props.row[props.column];
39053
+ return /* @__PURE__ */ React32.createElement(Text, {
39054
+ wrap: "truncate-end"
39055
+ }, value);
39056
+ }
39057
+ function UrlColumn(props) {
39058
+ const value = props.row[props.column];
39059
+ return /* @__PURE__ */ React32.createElement(Url, {
39060
+ dimColor: true
39061
+ }, value);
39062
+ }
39063
+ function get_status_icon(row) {
39064
+ switch (row.status) {
39065
+ case "NEW":
39066
+ return "⭑";
39067
+ case "OUTDATED":
39068
+ return "!";
39069
+ case "MERGED":
39070
+ return "↗";
39071
+ case "SYNCED":
39072
+ return "✔";
39073
+ default:
39074
+ assertNever(row.status);
39075
+ return "?";
39076
+ }
39077
+ }
39078
+ function get_status_color(row) {
39079
+ switch (row.status) {
39080
+ case "NEW":
39081
+ return colors.yellow;
39082
+ case "OUTDATED":
39083
+ return colors.red;
39084
+ case "MERGED":
39085
+ return colors.purple;
39086
+ case "SYNCED":
39087
+ return colors.green;
39088
+ default:
39089
+ assertNever(row.status);
39090
+ return colors.gray;
39091
+ }
39092
+ }
39093
+ function get_status_bold(row) {
39094
+ switch (row.status) {
39095
+ case "NEW":
39096
+ case "OUTDATED":
39097
+ return true;
39098
+ default:
39099
+ return false;
39100
+ }
39101
+ }
39102
+
39103
+ // src/app/Status.tsx
39104
+ function Status() {
39105
+ return /* @__PURE__ */ React33.createElement(Await, {
39106
+ fallback: null,
39107
+ function: run4
39108
+ });
39109
+ }
39110
+ async function run4() {
39111
+ const state = Store.getState();
39112
+ const actions = state.actions;
39113
+ const argv = state.argv;
39114
+ const commit_range = Store.getState().commit_range;
39115
+ invariant(commit_range, "commit_range must exist");
39116
+ actions.output(/* @__PURE__ */ React33.createElement(StatusTable, null));
39117
+ let needs_rebase = false;
39118
+ let needs_update = false;
39119
+ for (const group of commit_range.group_list) {
39120
+ if (group.dirty) {
39121
+ needs_update = true;
39122
+ }
39123
+ if (group.pr?.state === "MERGED") {
39124
+ needs_rebase = true;
39125
+ }
39126
+ }
39127
+ if (argv.check) {
39128
+ actions.exit(0);
39129
+ } else if (needs_rebase) {
39130
+ Store.setState((state2) => {
39131
+ state2.step = "pre-local-merge-rebase";
39132
+ });
39133
+ } else if (needs_update) {
39134
+ Store.setState((state2) => {
39135
+ state2.step = "pre-select-commit-ranges";
39136
+ });
39137
+ } else if (argv.force) {
39138
+ Store.setState((state2) => {
39139
+ state2.step = "select-commit-ranges";
39140
+ });
39141
+ } else {
39142
+ actions.output(/* @__PURE__ */ React33.createElement(Text, null, "✅ Everything up to date."));
39143
+ actions.output(/* @__PURE__ */ React33.createElement(Text, {
39144
+ color: colors.gray
39145
+ }, /* @__PURE__ */ React33.createElement(Text, null, "Run with"), /* @__PURE__ */ React33.createElement(Text, {
39146
+ bold: true,
39147
+ color: colors.yellow
39148
+ }, ` --force `), /* @__PURE__ */ React33.createElement(Text, null, "to force update all pull requests.")));
39149
+ actions.exit(0);
39150
+ }
39151
+ }
39152
+
38905
39153
  // src/core/short_id.ts
38906
39154
  import crypto2 from "node:crypto";
38907
39155
  function short_id() {
@@ -38946,14 +39194,14 @@ function encode(value) {
38946
39194
 
38947
39195
  // src/commands/Rebase.tsx
38948
39196
  function Rebase() {
38949
- return /* @__PURE__ */ React31.createElement(Await, {
38950
- fallback: /* @__PURE__ */ React31.createElement(Text, {
39197
+ return /* @__PURE__ */ React34.createElement(Await, {
39198
+ fallback: /* @__PURE__ */ React34.createElement(Text, {
38951
39199
  color: colors.yellow
38952
39200
  }, "Rebasing commits…"),
38953
39201
  function: Rebase.run
38954
39202
  });
38955
39203
  }
38956
- Rebase.run = async function run4() {
39204
+ Rebase.run = async function run5() {
38957
39205
  const state = Store.getState();
38958
39206
  const actions = state.actions;
38959
39207
  const branch_name = state.branch_name;
@@ -38965,7 +39213,7 @@ Rebase.run = async function run4() {
38965
39213
  invariant(commit_range, "commit_range must exist");
38966
39214
  invariant(repo_root, "repo_root must exist");
38967
39215
  actions.register_abort_handler(async function abort_rebase() {
38968
- actions.output(/* @__PURE__ */ React31.createElement(Text, {
39216
+ actions.output(/* @__PURE__ */ React34.createElement(Text, {
38969
39217
  color: colors.red
38970
39218
  }, "\uD83D\uDEA8 Abort"));
38971
39219
  handle_exit();
@@ -38985,34 +39233,35 @@ Rebase.run = async function run4() {
38985
39233
  const commit2 = commit_range.commit_list[i2];
38986
39234
  const commit_pr = commit_range.pr_lookup[commit2.branch_id || ""];
38987
39235
  const merged_pr = commit_pr?.state === "MERGED";
39236
+ const commit_message = /* @__PURE__ */ React34.createElement(Text, {
39237
+ color: colors.blue
39238
+ }, commit2.subject_line);
38988
39239
  if (merged_pr) {
38989
- if (actions.isDebug()) {
38990
- actions.output(/* @__PURE__ */ React31.createElement(FormatText, {
38991
- wrapper: /* @__PURE__ */ React31.createElement(Text, {
38992
- color: colors.yellow,
38993
- wrap: "truncate-end"
38994
- }),
38995
- message: "Dropping {commit_message} {pr_status}",
38996
- values: {
38997
- commit_message: /* @__PURE__ */ React31.createElement(Brackets, null, commit2.subject_line),
38998
- pr_status: /* @__PURE__ */ React31.createElement(Parens, null, "MERGED")
38999
- }
39000
- }));
39001
- }
39002
- continue;
39003
- }
39004
- if (actions.isDebug()) {
39005
- actions.output(/* @__PURE__ */ React31.createElement(FormatText, {
39006
- wrapper: /* @__PURE__ */ React31.createElement(Text, {
39240
+ actions.output(/* @__PURE__ */ React34.createElement(FormatText, {
39241
+ wrapper: /* @__PURE__ */ React34.createElement(Text, {
39007
39242
  color: colors.yellow,
39008
39243
  wrap: "truncate-end"
39009
39244
  }),
39010
- message: "Picking {commit_message}",
39245
+ message: "Dropping {pr_status} {commit_message}",
39011
39246
  values: {
39012
- commit_message: /* @__PURE__ */ React31.createElement(Brackets, null, commit2.subject_line)
39247
+ pr_status: /* @__PURE__ */ React34.createElement(Text, {
39248
+ color: colors.purple
39249
+ }, "MERGED"),
39250
+ commit_message
39013
39251
  }
39014
39252
  }));
39253
+ continue;
39015
39254
  }
39255
+ actions.output(/* @__PURE__ */ React34.createElement(FormatText, {
39256
+ wrapper: /* @__PURE__ */ React34.createElement(Text, {
39257
+ color: colors.yellow,
39258
+ wrap: "truncate-end"
39259
+ }),
39260
+ message: "Picking {commit_message}",
39261
+ values: {
39262
+ commit_message
39263
+ }
39264
+ }));
39016
39265
  picked_commit_list.push(commit2);
39017
39266
  }
39018
39267
  if (picked_commit_list.length > 0) {
@@ -39022,32 +39271,30 @@ Rebase.run = async function run4() {
39022
39271
  }
39023
39272
  await cli(`git branch -f ${branch_name} ${temp_branch_name}`);
39024
39273
  restore_git();
39025
- const next_commit_range = await range();
39026
- actions.output(/* @__PURE__ */ React31.createElement(FormatText, {
39027
- wrapper: /* @__PURE__ */ React31.createElement(Text, {
39028
- color: colors.green
39029
- }),
39030
- message: "✅ {branch_name} in sync with {origin_branch}",
39031
- values: {
39032
- branch_name: /* @__PURE__ */ React31.createElement(Brackets, null, branch_name),
39033
- origin_branch: /* @__PURE__ */ React31.createElement(Brackets, null, `origin/${master_branch}`)
39034
- }
39035
- }));
39036
39274
  actions.unregister_abort_handler();
39037
- actions.set((state2) => {
39038
- state2.commit_range = next_commit_range;
39039
- state2.step = "status";
39040
- });
39041
39275
  } catch (err) {
39042
39276
  actions.error("Unable to rebase.");
39043
39277
  if (err instanceof Error) {
39044
- if (actions.isDebug()) {
39045
- actions.error(err.message);
39046
- }
39278
+ actions.error(err.message);
39047
39279
  }
39048
- handle_exit();
39049
39280
  actions.exit(20);
39050
39281
  }
39282
+ const next_commit_range = await range();
39283
+ actions.output(/* @__PURE__ */ React34.createElement(FormatText, {
39284
+ wrapper: /* @__PURE__ */ React34.createElement(Text, {
39285
+ color: colors.green
39286
+ }),
39287
+ message: "✅ {branch_name} in sync with {origin_branch}",
39288
+ values: {
39289
+ branch_name: /* @__PURE__ */ React34.createElement(Brackets, null, branch_name),
39290
+ origin_branch: /* @__PURE__ */ React34.createElement(Brackets, null, master_branch)
39291
+ }
39292
+ }));
39293
+ actions.set((state2) => {
39294
+ state2.commit_range = next_commit_range;
39295
+ });
39296
+ actions.output(/* @__PURE__ */ React34.createElement(Status, null));
39297
+ actions.exit(0);
39051
39298
  function restore_git() {
39052
39299
  const spawn_options = { ignoreExitCode: true };
39053
39300
  cli.sync(`git reset --hard`, spawn_options);
@@ -39060,33 +39307,33 @@ Rebase.run = async function run4() {
39060
39307
  cli.sync(`pwd`, spawn_options);
39061
39308
  }
39062
39309
  function handle_exit() {
39063
- actions.output(/* @__PURE__ */ React31.createElement(Text, {
39310
+ actions.output(/* @__PURE__ */ React34.createElement(Text, {
39064
39311
  color: colors.yellow
39065
- }, "Restoring ", /* @__PURE__ */ React31.createElement(Brackets, null, branch_name), "…"));
39312
+ }, "Restoring ", /* @__PURE__ */ React34.createElement(Brackets, null, branch_name), "…"));
39066
39313
  restore_git();
39067
- actions.output(/* @__PURE__ */ React31.createElement(Text, {
39314
+ actions.output(/* @__PURE__ */ React34.createElement(Text, {
39068
39315
  color: colors.yellow
39069
- }, "Restored ", /* @__PURE__ */ React31.createElement(Brackets, null, branch_name), "."));
39316
+ }, "Restored ", /* @__PURE__ */ React34.createElement(Brackets, null, branch_name), "."));
39070
39317
  }
39071
39318
  };
39072
39319
 
39073
39320
  // src/app/LocalMergeRebase.tsx
39074
39321
  function LocalMergeRebase() {
39075
- return /* @__PURE__ */ React32.createElement(Rebase, null);
39322
+ return /* @__PURE__ */ React35.createElement(Rebase, null);
39076
39323
  }
39077
39324
 
39078
39325
  // src/app/ManualRebase.tsx
39079
- var React33 = __toESM(require_react(), 1);
39326
+ var React36 = __toESM(require_react(), 1);
39080
39327
  import fs12 from "node:fs";
39081
39328
  function ManualRebase() {
39082
- return /* @__PURE__ */ React33.createElement(Await, {
39083
- fallback: /* @__PURE__ */ React33.createElement(Text, {
39329
+ return /* @__PURE__ */ React36.createElement(Await, {
39330
+ fallback: /* @__PURE__ */ React36.createElement(Text, {
39084
39331
  color: colors.yellow
39085
39332
  }, "Rebasing commits…"),
39086
- function: run5
39333
+ function: run6
39087
39334
  });
39088
39335
  }
39089
- async function run5() {
39336
+ async function run6() {
39090
39337
  const state = Store.getState();
39091
39338
  const actions = state.actions;
39092
39339
  const argv = state.argv;
@@ -39099,7 +39346,7 @@ async function run5() {
39099
39346
  invariant(commit_map, "commit_map must exist");
39100
39347
  invariant(repo_root, "repo_root must exist");
39101
39348
  actions.register_abort_handler(async function abort_manual_rebase() {
39102
- actions.output(/* @__PURE__ */ React33.createElement(Text, {
39349
+ actions.output(/* @__PURE__ */ React36.createElement(Text, {
39103
39350
  color: colors.red
39104
39351
  }, "\uD83D\uDEA8 Abort"));
39105
39352
  handle_exit();
@@ -39168,7 +39415,6 @@ async function run5() {
39168
39415
  if (!argv.verbose) {
39169
39416
  actions.error("Try again with `--verbose` to see more information.");
39170
39417
  }
39171
- handle_exit();
39172
39418
  actions.exit(16);
39173
39419
  }
39174
39420
  function restore_git() {
@@ -39183,247 +39429,49 @@ async function run5() {
39183
39429
  cli.sync(`pwd`, spawn_options);
39184
39430
  }
39185
39431
  function handle_exit() {
39186
- actions.output(/* @__PURE__ */ React33.createElement(Text, {
39432
+ actions.output(/* @__PURE__ */ React36.createElement(Text, {
39187
39433
  color: colors.yellow
39188
- }, "Restoring ", /* @__PURE__ */ React33.createElement(Brackets, null, branch_name), "…"));
39434
+ }, "Restoring ", /* @__PURE__ */ React36.createElement(Brackets, null, branch_name), "…"));
39189
39435
  restore_git();
39190
- actions.output(/* @__PURE__ */ React33.createElement(Text, {
39436
+ actions.output(/* @__PURE__ */ React36.createElement(Text, {
39191
39437
  color: colors.yellow
39192
- }, "Restored ", /* @__PURE__ */ React33.createElement(Brackets, null, branch_name), "."));
39193
- }
39194
- }
39195
-
39196
- // src/app/PostRebaseStatus.tsx
39197
- var React36 = __toESM(require_react(), 1);
39198
-
39199
- // src/app/StatusTable.tsx
39200
- var React35 = __toESM(require_react(), 1);
39201
-
39202
- // src/app/Table.tsx
39203
- var React34 = __toESM(require_react(), 1);
39204
- function Table(props) {
39205
- if (!props.data.length) {
39206
- return /* @__PURE__ */ React34.createElement(Container, null, /* @__PURE__ */ React34.createElement(Text, {
39207
- dimColor: true
39208
- }, "No data found."));
39209
- }
39210
- const RowColumnList = Object.keys(props.columns);
39211
- const max_col_width = {};
39212
- for (const col of RowColumnList) {
39213
- max_col_width[col] = 0;
39214
- }
39215
- for (const row of props.data) {
39216
- for (const col of RowColumnList) {
39217
- const row_col = row[col];
39218
- max_col_width[col] = Math.max(String(row_col).length, max_col_width[col]);
39219
- }
39220
- }
39221
- for (const col of RowColumnList) {
39222
- const maxWidth = props.maxWidth?.[col];
39223
- if (maxWidth) {
39224
- max_col_width[col] = maxWidth(max_col_width[col]);
39225
- }
39226
- }
39227
- const { stdout } = use_stdout_default();
39228
- const available_width = stdout.columns;
39229
- const columnGap = is_finite_value(props.columnGap) ? props.columnGap : 2;
39230
- const breathing_room = 1;
39231
- if (props.fillColumn) {
39232
- let remaining_space = available_width;
39233
- for (const col of RowColumnList) {
39234
- if (props.fillColumn === col) {
39235
- continue;
39236
- }
39237
- remaining_space -= max_col_width[col];
39238
- }
39239
- remaining_space -= columnGap * (RowColumnList.length - 1);
39240
- remaining_space -= breathing_room;
39241
- if (props.fillColumn) {
39242
- max_col_width[props.fillColumn] = Math.min(max_col_width[props.fillColumn], remaining_space);
39243
- }
39244
- }
39245
- return /* @__PURE__ */ React34.createElement(Container, null, props.data.map((row, i2) => {
39246
- return /* @__PURE__ */ React34.createElement(Box_default, {
39247
- key: i2,
39248
- flexDirection: "row",
39249
- columnGap,
39250
- width: available_width
39251
- }, RowColumnList.map((column) => {
39252
- const ColumnComponent = props.columns[column];
39253
- return /* @__PURE__ */ React34.createElement(Box_default, {
39254
- key: String(column),
39255
- width: max_col_width[column]
39256
- }, /* @__PURE__ */ React34.createElement(ColumnComponent, {
39257
- row,
39258
- column
39259
- }));
39260
- }));
39261
- }));
39262
- }
39263
- function Container(props) {
39264
- return /* @__PURE__ */ React34.createElement(Box_default, {
39265
- flexDirection: "column"
39266
- }, /* @__PURE__ */ React34.createElement(Box_default, {
39267
- height: 1
39268
- }), props.children, /* @__PURE__ */ React34.createElement(Box_default, {
39269
- height: 1
39270
- }));
39271
- }
39272
-
39273
- // src/core/assertNever.ts
39274
- function assertNever(value) {
39275
- console.error("[assertNever]", { value });
39276
- }
39277
-
39278
- // src/app/StatusTable.tsx
39279
- function StatusTable() {
39280
- const commit_range = Store.useState((state) => state.commit_range);
39281
- invariant(commit_range, "commit_range must exist");
39282
- const row_list = [];
39283
- for (const group of commit_range.group_list) {
39284
- const row = {
39285
- count: "",
39286
- status: "NEW",
39287
- title: "",
39288
- url: ""
39289
- };
39290
- if (group.id === commit_range.UNASSIGNED) {
39291
- row.status = "NEW";
39292
- row.title = "Unassigned";
39293
- row.count = `0/${group.commits.length}`;
39294
- row.url = "";
39295
- } else {
39296
- if (group.dirty) {
39297
- row.status = "OUTDATED";
39298
- } else {
39299
- row.status = "SYNCED";
39300
- }
39301
- if (group.pr) {
39302
- if (group.pr.state === "MERGED") {
39303
- row.status = "MERGED";
39304
- }
39305
- row.title = group.pr.title;
39306
- row.count = `${group.pr.commits.length}/${group.commits.length}`;
39307
- row.url = group.pr.url;
39308
- } else {
39309
- row.title = group.title || group.id;
39310
- row.count = `0/${group.commits.length}`;
39311
- }
39312
- }
39313
- row_list.push(row);
39314
- }
39315
- return /* @__PURE__ */ React35.createElement(Table, {
39316
- data: row_list,
39317
- fillColumn: "title",
39318
- maxWidth: {
39319
- status: (v3) => v3 + 2
39320
- },
39321
- columnGap: 3,
39322
- columns: {
39323
- status: StatusColumn,
39324
- count: CountColumn,
39325
- title: TitleColumn,
39326
- url: UrlColumn
39327
- }
39328
- });
39329
- }
39330
- function StatusColumn(props) {
39331
- const value = props.row[props.column];
39332
- return /* @__PURE__ */ React35.createElement(Text, {
39333
- color: get_status_color(props.row),
39334
- bold: get_status_bold(props.row)
39335
- }, get_status_icon(props.row), " ", value);
39336
- }
39337
- function CountColumn(props) {
39338
- const value = props.row[props.column];
39339
- return /* @__PURE__ */ React35.createElement(Text, {
39340
- dimColor: true
39341
- }, value);
39342
- }
39343
- function TitleColumn(props) {
39344
- const value = props.row[props.column];
39345
- return /* @__PURE__ */ React35.createElement(Text, {
39346
- wrap: "truncate-end"
39347
- }, value);
39348
- }
39349
- function UrlColumn(props) {
39350
- const value = props.row[props.column];
39351
- return /* @__PURE__ */ React35.createElement(Url, {
39352
- dimColor: true
39353
- }, value);
39354
- }
39355
- function get_status_icon(row) {
39356
- switch (row.status) {
39357
- case "NEW":
39358
- return "⭑";
39359
- case "OUTDATED":
39360
- return "!";
39361
- case "MERGED":
39362
- return "↗";
39363
- case "SYNCED":
39364
- return "✔";
39365
- default:
39366
- assertNever(row.status);
39367
- return "?";
39368
- }
39369
- }
39370
- function get_status_color(row) {
39371
- switch (row.status) {
39372
- case "NEW":
39373
- return colors.yellow;
39374
- case "OUTDATED":
39375
- return colors.red;
39376
- case "MERGED":
39377
- return colors.purple;
39378
- case "SYNCED":
39379
- return colors.green;
39380
- default:
39381
- assertNever(row.status);
39382
- return colors.gray;
39383
- }
39384
- }
39385
- function get_status_bold(row) {
39386
- switch (row.status) {
39387
- case "NEW":
39388
- case "OUTDATED":
39389
- return true;
39390
- default:
39391
- return false;
39438
+ }, "Restored ", /* @__PURE__ */ React36.createElement(Brackets, null, branch_name), "."));
39392
39439
  }
39393
39440
  }
39394
39441
 
39395
39442
  // src/app/PostRebaseStatus.tsx
39443
+ var React37 = __toESM(require_react(), 1);
39396
39444
  function PostRebaseStatus() {
39397
- return /* @__PURE__ */ React36.createElement(Await, {
39445
+ return /* @__PURE__ */ React37.createElement(Await, {
39398
39446
  fallback: null,
39399
- function: run6
39447
+ function: run7
39400
39448
  });
39401
39449
  }
39402
- async function run6() {
39450
+ async function run7() {
39403
39451
  const actions = Store.getState().actions;
39404
39452
  actions.reset_pr();
39405
39453
  const commit_range = await range();
39406
39454
  actions.set((state) => {
39407
39455
  state.commit_range = commit_range;
39408
39456
  });
39409
- actions.output(/* @__PURE__ */ React36.createElement(StatusTable, null));
39410
- actions.output(/* @__PURE__ */ React36.createElement(Text, null, "✅ Everything up to date."));
39457
+ actions.output(/* @__PURE__ */ React37.createElement(StatusTable, null));
39458
+ actions.output(/* @__PURE__ */ React37.createElement(Text, null, "✅ Everything up to date."));
39411
39459
  actions.exit(0);
39412
39460
  }
39413
39461
 
39414
39462
  // src/app/PreLocalMergeRebase.tsx
39415
- var React37 = __toESM(require_react(), 1);
39463
+ var React38 = __toESM(require_react(), 1);
39416
39464
  function PreLocalMergeRebase() {
39417
39465
  const actions = Store.useActions();
39418
39466
  const argv = Store.useState((state) => state.argv);
39419
- React37.useEffect(() => {
39467
+ React38.useEffect(() => {
39420
39468
  if (argv.force) {
39421
39469
  Store.setState((state) => {
39422
39470
  state.step = "local-merge-rebase";
39423
39471
  });
39424
39472
  }
39425
39473
  }, [argv]);
39426
- return /* @__PURE__ */ React37.createElement(YesNoPrompt, {
39474
+ return /* @__PURE__ */ React38.createElement(YesNoPrompt, {
39427
39475
  message: "Local branch needs to be rebased, would you like to rebase to update your local branch?",
39428
39476
  onYes: () => {
39429
39477
  actions.set((state) => {
@@ -39435,16 +39483,16 @@ function PreLocalMergeRebase() {
39435
39483
  }
39436
39484
 
39437
39485
  // src/app/PreManualRebase.tsx
39438
- var React38 = __toESM(require_react(), 1);
39486
+ var React39 = __toESM(require_react(), 1);
39439
39487
  import fs13 from "node:fs/promises";
39440
39488
  import path8 from "node:path";
39441
39489
  function PreManualRebase() {
39442
- return /* @__PURE__ */ React38.createElement(Await, {
39490
+ return /* @__PURE__ */ React39.createElement(Await, {
39443
39491
  fallback: null,
39444
- function: run7
39492
+ function: run8
39445
39493
  });
39446
39494
  }
39447
- async function run7() {
39495
+ async function run8() {
39448
39496
  const state = Store.getState();
39449
39497
  const actions = state.actions;
39450
39498
  const repo_root = state.repo_root;
@@ -39460,13 +39508,13 @@ async function run7() {
39460
39508
  const pr_template_fn = PR_TEMPLATE[key];
39461
39509
  if (await safe_exists(pr_template_fn(repo_root))) {
39462
39510
  pr_template_body = await fs13.readFile(pr_template_fn(repo_root), "utf-8");
39463
- actions.output(/* @__PURE__ */ React38.createElement(FormatText, {
39464
- wrapper: /* @__PURE__ */ React38.createElement(Text, {
39511
+ actions.output(/* @__PURE__ */ React39.createElement(FormatText, {
39512
+ wrapper: /* @__PURE__ */ React39.createElement(Text, {
39465
39513
  color: colors.yellow
39466
39514
  }),
39467
39515
  message: "Using PR template {pr_filepath}",
39468
39516
  values: {
39469
- pr_filepath: /* @__PURE__ */ React38.createElement(Brackets, null, pr_template_fn(""))
39517
+ pr_filepath: /* @__PURE__ */ React39.createElement(Brackets, null, pr_template_fn(""))
39470
39518
  }
39471
39519
  }));
39472
39520
  break;
@@ -39480,16 +39528,16 @@ async function run7() {
39480
39528
  state2.pr_template_body = pr_template_body;
39481
39529
  state2.pr_templates = pr_templates;
39482
39530
  if (pr_templates.length > 0) {
39483
- actions.output(/* @__PURE__ */ React38.createElement(FormatText, {
39484
- wrapper: /* @__PURE__ */ React38.createElement(Text, {
39531
+ actions.output(/* @__PURE__ */ React39.createElement(FormatText, {
39532
+ wrapper: /* @__PURE__ */ React39.createElement(Text, {
39485
39533
  color: colors.yellow
39486
39534
  }),
39487
39535
  message: "{count} queryable templates found under {dir}, but not supported.",
39488
39536
  values: {
39489
- count: /* @__PURE__ */ React38.createElement(Text, {
39537
+ count: /* @__PURE__ */ React39.createElement(Text, {
39490
39538
  color: colors.blue
39491
39539
  }, pr_templates.length),
39492
- dir: /* @__PURE__ */ React38.createElement(Brackets, null, PR_TEMPLATE.TemplateDir(""))
39540
+ dir: /* @__PURE__ */ React39.createElement(Brackets, null, PR_TEMPLATE.TemplateDir(""))
39493
39541
  }
39494
39542
  }));
39495
39543
  }
@@ -39505,18 +39553,18 @@ var PR_TEMPLATE = Object.freeze({
39505
39553
  var PR_TEMPLATE_KEY_LIST = Object.keys(PR_TEMPLATE);
39506
39554
 
39507
39555
  // src/app/PreSelectCommitRanges.tsx
39508
- var React39 = __toESM(require_react(), 1);
39556
+ var React40 = __toESM(require_react(), 1);
39509
39557
  function PreSelectCommitRanges() {
39510
39558
  const actions = Store.useActions();
39511
39559
  const argv = Store.useState((state) => state.argv);
39512
- React39.useEffect(() => {
39560
+ React40.useEffect(() => {
39513
39561
  if (argv.force) {
39514
39562
  Store.setState((state) => {
39515
39563
  state.step = "select-commit-ranges";
39516
39564
  });
39517
39565
  }
39518
39566
  }, [argv]);
39519
- return /* @__PURE__ */ React39.createElement(YesNoPrompt, {
39567
+ return /* @__PURE__ */ React40.createElement(YesNoPrompt, {
39520
39568
  message: "Some commits are new or outdated, would you like to select new commit ranges?",
39521
39569
  onYes: () => {
39522
39570
  actions.set((state) => {
@@ -39528,10 +39576,10 @@ function PreSelectCommitRanges() {
39528
39576
  }
39529
39577
 
39530
39578
  // src/app/SelectCommitRanges.tsx
39531
- var React42 = __toESM(require_react(), 1);
39579
+ var React43 = __toESM(require_react(), 1);
39532
39580
 
39533
39581
  // src/app/MultiSelect.tsx
39534
- var React40 = __toESM(require_react(), 1);
39582
+ var React41 = __toESM(require_react(), 1);
39535
39583
 
39536
39584
  // src/core/clamp.ts
39537
39585
  function clamp(value, min, max) {
@@ -39554,7 +39602,7 @@ function wrap_index(value, list) {
39554
39602
 
39555
39603
  // src/app/MultiSelect.tsx
39556
39604
  function MultiSelect(props) {
39557
- const [selected_set, select] = React40.useReducer((state, value) => {
39605
+ const [selected_set, select] = React41.useReducer((state, value) => {
39558
39606
  const next = new Set(state);
39559
39607
  if (next.has(value)) {
39560
39608
  next.delete(value);
@@ -39570,7 +39618,7 @@ function MultiSelect(props) {
39570
39618
  });
39571
39619
  return set2;
39572
39620
  });
39573
- const [index, set_index] = React40.useReducer((_, value) => {
39621
+ const [index, set_index] = React41.useReducer((_, value) => {
39574
39622
  const next_index = clamp(value, 0, props.items.length - 1);
39575
39623
  return next_index;
39576
39624
  }, 0, function find_initial_index() {
@@ -39589,8 +39637,8 @@ function MultiSelect(props) {
39589
39637
  }
39590
39638
  return 0;
39591
39639
  });
39592
- const selectRef = React40.useRef(false);
39593
- React40.useEffect(() => {
39640
+ const selectRef = React41.useRef(false);
39641
+ React41.useEffect(() => {
39594
39642
  if (!selectRef.current) {
39595
39643
  return;
39596
39644
  }
@@ -39600,7 +39648,7 @@ function MultiSelect(props) {
39600
39648
  const state = selected_list.map((index2) => props.items[index2].value);
39601
39649
  props.onSelect({ item, selected, state });
39602
39650
  }, [selected_set]);
39603
- React40.useEffect(() => {
39651
+ React41.useEffect(() => {
39604
39652
  const item = props.items[index].value;
39605
39653
  const selected_list = Array.from(selected_set);
39606
39654
  const selected = selected_set.has(index);
@@ -39642,13 +39690,13 @@ function MultiSelect(props) {
39642
39690
  }
39643
39691
  }
39644
39692
  });
39645
- return /* @__PURE__ */ React40.createElement(Box_default, {
39693
+ return /* @__PURE__ */ React41.createElement(Box_default, {
39646
39694
  flexDirection: "column"
39647
39695
  }, props.items.map((item, i2) => {
39648
39696
  const active = i2 === index;
39649
39697
  const selected = selected_set.has(i2);
39650
39698
  const disabled = item.disabled || false;
39651
- return /* @__PURE__ */ React40.createElement(ItemRow, {
39699
+ return /* @__PURE__ */ React41.createElement(ItemRow, {
39652
39700
  key: i2,
39653
39701
  label: item.label,
39654
39702
  active,
@@ -39676,15 +39724,15 @@ function ItemRow(props) {
39676
39724
  underline = false;
39677
39725
  dimColor = true;
39678
39726
  }
39679
- return /* @__PURE__ */ React40.createElement(Box_default, {
39727
+ return /* @__PURE__ */ React41.createElement(Box_default, {
39680
39728
  flexDirection: "row",
39681
39729
  gap: 1
39682
- }, /* @__PURE__ */ React40.createElement(Radio, {
39730
+ }, /* @__PURE__ */ React41.createElement(Radio, {
39683
39731
  selected: props.selected,
39684
39732
  disabled: props.disabled
39685
- }), /* @__PURE__ */ React40.createElement(Box_default, {
39733
+ }), /* @__PURE__ */ React41.createElement(Box_default, {
39686
39734
  width: props.maxWidth
39687
- }, /* @__PURE__ */ React40.createElement(Text, {
39735
+ }, /* @__PURE__ */ React41.createElement(Text, {
39688
39736
  bold,
39689
39737
  underline,
39690
39738
  color,
@@ -39707,7 +39755,7 @@ function Radio(props) {
39707
39755
  color = colors.gray;
39708
39756
  dimColor = true;
39709
39757
  }
39710
- return /* @__PURE__ */ React40.createElement(Text, {
39758
+ return /* @__PURE__ */ React41.createElement(Text, {
39711
39759
  bold: props.selected,
39712
39760
  color,
39713
39761
  dimColor
@@ -39715,14 +39763,14 @@ function Radio(props) {
39715
39763
  }
39716
39764
 
39717
39765
  // src/app/TextInput.tsx
39718
- var React41 = __toESM(require_react(), 1);
39766
+ var React42 = __toESM(require_react(), 1);
39719
39767
  function TextInput(props) {
39720
- const [value, set_value] = React41.useState(get_value(props));
39721
- React41.useEffect(function sync_value_prop() {
39768
+ const [value, set_value] = React42.useState(get_value(props));
39769
+ React42.useEffect(function sync_value_prop() {
39722
39770
  set_value(get_value(props));
39723
39771
  }, [props.value]);
39724
- const [caret_visible, set_caret_visible] = React41.useState(false);
39725
- React41.useEffect(function blink_caret() {
39772
+ const [caret_visible, set_caret_visible] = React42.useState(false);
39773
+ React42.useEffect(function blink_caret() {
39726
39774
  const interval_ms = 500;
39727
39775
  let timeoutId = setTimeout(tick, interval_ms);
39728
39776
  function tick() {
@@ -39754,12 +39802,12 @@ function TextInput(props) {
39754
39802
  set_value(next_value);
39755
39803
  props.onChange?.(next_value);
39756
39804
  });
39757
- return /* @__PURE__ */ React41.createElement(Box_default, {
39805
+ return /* @__PURE__ */ React42.createElement(Box_default, {
39758
39806
  borderStyle: "single",
39759
39807
  minHeight: 1,
39760
39808
  borderColor: colors.yellow,
39761
39809
  borderDimColor: true
39762
- }, /* @__PURE__ */ React41.createElement(Text, null, value || ""), /* @__PURE__ */ React41.createElement(Text, {
39810
+ }, /* @__PURE__ */ React42.createElement(Text, null, value || ""), /* @__PURE__ */ React42.createElement(Text, {
39763
39811
  color: colors.yellow,
39764
39812
  dimColor: true,
39765
39813
  inverse: caret_visible
@@ -39778,26 +39826,26 @@ function gs_short_id() {
39778
39826
  function SelectCommitRanges() {
39779
39827
  const commit_range = Store.useState((state) => state.commit_range);
39780
39828
  invariant(commit_range, "commit_range must exist");
39781
- return /* @__PURE__ */ React42.createElement(SelectCommitRangesInternal, {
39829
+ return /* @__PURE__ */ React43.createElement(SelectCommitRangesInternal, {
39782
39830
  commit_range
39783
39831
  });
39784
39832
  }
39785
39833
  function SelectCommitRangesInternal(props) {
39786
39834
  const actions = Store.useActions();
39787
39835
  const argv = Store.useState((state) => state.argv);
39788
- const [selected_group_id, set_selected_group_id] = React42.useState(() => {
39836
+ const [selected_group_id, set_selected_group_id] = React43.useState(() => {
39789
39837
  const first_group = props.commit_range.group_list.find((g2) => g2.id !== props.commit_range.UNASSIGNED);
39790
39838
  if (first_group) {
39791
39839
  return first_group.id;
39792
39840
  }
39793
39841
  return props.commit_range.UNASSIGNED;
39794
39842
  });
39795
- const [group_input, set_group_input] = React42.useState(false);
39796
- const [new_group_list, create_group] = React42.useReducer((group_list2, group2) => {
39843
+ const [group_input, set_group_input] = React43.useState(false);
39844
+ const [new_group_list, create_group] = React43.useReducer((group_list2, group2) => {
39797
39845
  const next_group_list = group_list2.concat(group2);
39798
39846
  return next_group_list;
39799
39847
  }, []);
39800
- const [commit_map, update_commit_map] = React42.useReducer((map, args) => {
39848
+ const [commit_map, update_commit_map] = React43.useReducer((map, args) => {
39801
39849
  map.set(args.key, args.value);
39802
39850
  return new Map(map);
39803
39851
  }, new Map, (map) => {
@@ -39905,12 +39953,12 @@ function SelectCommitRangesInternal(props) {
39905
39953
  group_title_width = Math.min(group.title.length, group_title_width);
39906
39954
  let max_item_width = max_group_label_width;
39907
39955
  max_item_width -= left_arrow.length + right_arrow.length;
39908
- const [focused, set_focused] = React42.useState("");
39909
- return /* @__PURE__ */ React42.createElement(Box_default, {
39956
+ const [focused, set_focused] = React43.useState("");
39957
+ return /* @__PURE__ */ React43.createElement(Box_default, {
39910
39958
  flexDirection: "column"
39911
- }, /* @__PURE__ */ React42.createElement(Box_default, {
39959
+ }, /* @__PURE__ */ React43.createElement(Box_default, {
39912
39960
  height: 1
39913
- }), /* @__PURE__ */ React42.createElement(MultiSelect, {
39961
+ }), /* @__PURE__ */ React43.createElement(MultiSelect, {
39914
39962
  items,
39915
39963
  maxWidth: max_item_width,
39916
39964
  disabled: multiselect_disabled,
@@ -39928,108 +39976,108 @@ function SelectCommitRangesInternal(props) {
39928
39976
  }
39929
39977
  update_commit_map({ key, value });
39930
39978
  }
39931
- }), /* @__PURE__ */ React42.createElement(Box_default, {
39979
+ }), /* @__PURE__ */ React43.createElement(Box_default, {
39932
39980
  height: 1
39933
- }), /* @__PURE__ */ React42.createElement(Box_default, {
39981
+ }), /* @__PURE__ */ React43.createElement(Box_default, {
39934
39982
  width: max_group_label_width,
39935
39983
  flexDirection: "row"
39936
- }, /* @__PURE__ */ React42.createElement(Text, null, left_arrow), /* @__PURE__ */ React42.createElement(Text, null, group_position), /* @__PURE__ */ React42.createElement(Box_default, {
39984
+ }, /* @__PURE__ */ React43.createElement(Text, null, left_arrow), /* @__PURE__ */ React43.createElement(Text, null, group_position), /* @__PURE__ */ React43.createElement(Box_default, {
39937
39985
  width: group_title_width,
39938
39986
  justifyContent: "center"
39939
- }, /* @__PURE__ */ React42.createElement(Text, {
39987
+ }, /* @__PURE__ */ React43.createElement(Text, {
39940
39988
  wrap: "truncate-end"
39941
- }, group.title)), /* @__PURE__ */ React42.createElement(Text, null, right_arrow)), /* @__PURE__ */ React42.createElement(Box_default, {
39989
+ }, group.title)), /* @__PURE__ */ React43.createElement(Text, null, right_arrow)), /* @__PURE__ */ React43.createElement(Box_default, {
39942
39990
  height: 1
39943
- }), unassigned_count > 0 ? /* @__PURE__ */ React42.createElement(FormatText, {
39944
- wrapper: /* @__PURE__ */ React42.createElement(Text, {
39991
+ }), unassigned_count > 0 ? /* @__PURE__ */ React43.createElement(FormatText, {
39992
+ wrapper: /* @__PURE__ */ React43.createElement(Text, {
39945
39993
  color: colors.gray
39946
39994
  }),
39947
39995
  message: "{count} unassigned commits, press {c} to {create} a new group",
39948
39996
  values: {
39949
- count: /* @__PURE__ */ React42.createElement(Text, {
39997
+ count: /* @__PURE__ */ React43.createElement(Text, {
39950
39998
  color: colors.yellow,
39951
39999
  bold: true
39952
40000
  }, unassigned_count),
39953
- c: /* @__PURE__ */ React42.createElement(Text, {
40001
+ c: /* @__PURE__ */ React43.createElement(Text, {
39954
40002
  bold: true,
39955
40003
  color: colors.green
39956
40004
  }, "c"),
39957
- create: /* @__PURE__ */ React42.createElement(Text, {
40005
+ create: /* @__PURE__ */ React43.createElement(Text, {
39958
40006
  bold: true,
39959
40007
  color: colors.green
39960
- }, /* @__PURE__ */ React42.createElement(Parens, null, "c"), "reate")
40008
+ }, /* @__PURE__ */ React43.createElement(Parens, null, "c"), "reate")
39961
40009
  }
39962
- }) : /* @__PURE__ */ React42.createElement(React42.Fragment, null, argv.sync ? /* @__PURE__ */ React42.createElement(FormatText, {
39963
- wrapper: /* @__PURE__ */ React42.createElement(Text, null),
40010
+ }) : /* @__PURE__ */ React43.createElement(React43.Fragment, null, argv.sync ? /* @__PURE__ */ React43.createElement(FormatText, {
40011
+ wrapper: /* @__PURE__ */ React43.createElement(Text, null),
39964
40012
  message: "\uD83C\uDF89 Done! Press {s} to {sync} the commits to Github",
39965
40013
  values: {
39966
- s: /* @__PURE__ */ React42.createElement(Text, {
40014
+ s: /* @__PURE__ */ React43.createElement(Text, {
39967
40015
  bold: true,
39968
40016
  color: colors.green
39969
40017
  }, "s"),
39970
- sync: /* @__PURE__ */ React42.createElement(Text, {
40018
+ sync: /* @__PURE__ */ React43.createElement(Text, {
39971
40019
  bold: true,
39972
40020
  color: colors.green
39973
- }, /* @__PURE__ */ React42.createElement(Parens, null, "s"), "ync")
40021
+ }, /* @__PURE__ */ React43.createElement(Parens, null, "s"), "ync")
39974
40022
  }
39975
- }) : /* @__PURE__ */ React42.createElement(FormatText, {
39976
- wrapper: /* @__PURE__ */ React42.createElement(Text, null),
40023
+ }) : /* @__PURE__ */ React43.createElement(FormatText, {
40024
+ wrapper: /* @__PURE__ */ React43.createElement(Text, null),
39977
40025
  message: "\uD83C\uDF89 Done! Press {s} to {save} the commits locally",
39978
40026
  values: {
39979
- s: /* @__PURE__ */ React42.createElement(Text, {
40027
+ s: /* @__PURE__ */ React43.createElement(Text, {
39980
40028
  bold: true,
39981
40029
  color: colors.green
39982
40030
  }, "s"),
39983
- save: /* @__PURE__ */ React42.createElement(Text, {
40031
+ save: /* @__PURE__ */ React43.createElement(Text, {
39984
40032
  bold: true,
39985
40033
  color: colors.green
39986
- }, /* @__PURE__ */ React42.createElement(Parens, null, "s"), "save")
40034
+ }, /* @__PURE__ */ React43.createElement(Parens, null, "s"), "save")
39987
40035
  }
39988
- })), !group_input ? null : /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(Box_default, {
40036
+ })), !group_input ? null : /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(Box_default, {
39989
40037
  height: 1
39990
- }), /* @__PURE__ */ React42.createElement(FormatText, {
39991
- wrapper: /* @__PURE__ */ React42.createElement(Text, {
40038
+ }), /* @__PURE__ */ React43.createElement(FormatText, {
40039
+ wrapper: /* @__PURE__ */ React43.createElement(Text, {
39992
40040
  color: colors.gray
39993
40041
  }),
39994
40042
  message: "Enter a title for the PR {note}",
39995
40043
  values: {
39996
- note: /* @__PURE__ */ React42.createElement(Parens, null, /* @__PURE__ */ React42.createElement(FormatText, {
40044
+ note: /* @__PURE__ */ React43.createElement(Parens, null, /* @__PURE__ */ React43.createElement(FormatText, {
39997
40045
  message: "press {enter} to submit",
39998
40046
  values: {
39999
- enter: /* @__PURE__ */ React42.createElement(Text, {
40047
+ enter: /* @__PURE__ */ React43.createElement(Text, {
40000
40048
  bold: true,
40001
40049
  color: colors.green
40002
40050
  }, SYMBOL.enter)
40003
40051
  }
40004
40052
  }))
40005
40053
  }
40006
- }), /* @__PURE__ */ React42.createElement(TextInput, {
40054
+ }), /* @__PURE__ */ React43.createElement(TextInput, {
40007
40055
  defaultValue: focused,
40008
40056
  onSubmit: submit_group_input
40009
- }), /* @__PURE__ */ React42.createElement(Box_default, {
40057
+ }), /* @__PURE__ */ React43.createElement(Box_default, {
40010
40058
  height: 1
40011
- })), /* @__PURE__ */ React42.createElement(Box_default, null, /* @__PURE__ */ React42.createElement(FormatText, {
40012
- wrapper: /* @__PURE__ */ React42.createElement(Text, {
40059
+ })), /* @__PURE__ */ React43.createElement(Box_default, null, /* @__PURE__ */ React43.createElement(FormatText, {
40060
+ wrapper: /* @__PURE__ */ React43.createElement(Text, {
40013
40061
  color: colors.gray
40014
40062
  }),
40015
40063
  message: "Press {left} and {right} to view PR groups",
40016
40064
  values: {
40017
- left: /* @__PURE__ */ React42.createElement(Text, {
40065
+ left: /* @__PURE__ */ React43.createElement(Text, {
40018
40066
  bold: true,
40019
40067
  color: colors.green
40020
40068
  }, SYMBOL.left),
40021
- right: /* @__PURE__ */ React42.createElement(Text, {
40069
+ right: /* @__PURE__ */ React43.createElement(Text, {
40022
40070
  bold: true,
40023
40071
  color: colors.green
40024
40072
  }, SYMBOL.right)
40025
40073
  }
40026
- })), /* @__PURE__ */ React42.createElement(Box_default, null, /* @__PURE__ */ React42.createElement(FormatText, {
40027
- wrapper: /* @__PURE__ */ React42.createElement(Text, {
40074
+ })), /* @__PURE__ */ React43.createElement(Box_default, null, /* @__PURE__ */ React43.createElement(FormatText, {
40075
+ wrapper: /* @__PURE__ */ React43.createElement(Text, {
40028
40076
  color: colors.gray
40029
40077
  }),
40030
40078
  message: "Press {enter} to toggle commit selection",
40031
40079
  values: {
40032
- enter: /* @__PURE__ */ React42.createElement(Text, {
40080
+ enter: /* @__PURE__ */ React43.createElement(Text, {
40033
40081
  bold: true,
40034
40082
  color: colors.green
40035
40083
  }, SYMBOL.enter)
@@ -40046,14 +40094,14 @@ function SelectCommitRangesInternal(props) {
40046
40094
  }
40047
40095
  function submit_group_input(title) {
40048
40096
  const id = get_group_id();
40049
- actions.output(/* @__PURE__ */ React42.createElement(FormatText, {
40050
- wrapper: /* @__PURE__ */ React42.createElement(Text, {
40097
+ actions.output(/* @__PURE__ */ React43.createElement(FormatText, {
40098
+ wrapper: /* @__PURE__ */ React43.createElement(Text, {
40051
40099
  dimColor: true
40052
40100
  }),
40053
40101
  message: "Created new group {group} {note}",
40054
40102
  values: {
40055
- group: /* @__PURE__ */ React42.createElement(Brackets, null, title),
40056
- note: /* @__PURE__ */ React42.createElement(Parens, null, id)
40103
+ group: /* @__PURE__ */ React43.createElement(Brackets, null, title),
40104
+ note: /* @__PURE__ */ React43.createElement(Parens, null, id)
40057
40105
  }
40058
40106
  }));
40059
40107
  create_group({ id, title });
@@ -40067,57 +40115,6 @@ var SYMBOL = {
40067
40115
  enter: "Enter"
40068
40116
  };
40069
40117
 
40070
- // src/app/Status.tsx
40071
- var React43 = __toESM(require_react(), 1);
40072
- function Status() {
40073
- return /* @__PURE__ */ React43.createElement(Await, {
40074
- fallback: null,
40075
- function: run8
40076
- });
40077
- }
40078
- async function run8() {
40079
- const state = Store.getState();
40080
- const actions = state.actions;
40081
- const argv = state.argv;
40082
- const commit_range = Store.getState().commit_range;
40083
- invariant(commit_range, "commit_range must exist");
40084
- actions.output(/* @__PURE__ */ React43.createElement(StatusTable, null));
40085
- let needs_rebase = false;
40086
- let needs_update = false;
40087
- for (const group of commit_range.group_list) {
40088
- if (group.dirty) {
40089
- needs_update = true;
40090
- }
40091
- if (group.pr?.state === "MERGED") {
40092
- needs_rebase = true;
40093
- }
40094
- }
40095
- if (argv.check) {
40096
- actions.exit(0);
40097
- } else if (needs_rebase) {
40098
- Store.setState((state2) => {
40099
- state2.step = "pre-local-merge-rebase";
40100
- });
40101
- } else if (needs_update) {
40102
- Store.setState((state2) => {
40103
- state2.step = "pre-select-commit-ranges";
40104
- });
40105
- } else if (argv.force) {
40106
- Store.setState((state2) => {
40107
- state2.step = "select-commit-ranges";
40108
- });
40109
- } else {
40110
- actions.output(/* @__PURE__ */ React43.createElement(Text, null, "✅ Everything up to date."));
40111
- actions.output(/* @__PURE__ */ React43.createElement(Text, {
40112
- color: colors.gray
40113
- }, /* @__PURE__ */ React43.createElement(Text, null, "Run with"), /* @__PURE__ */ React43.createElement(Text, {
40114
- bold: true,
40115
- color: colors.yellow
40116
- }, ` --force `), /* @__PURE__ */ React43.createElement(Text, null, "to force update all pull requests.")));
40117
- actions.exit(0);
40118
- }
40119
- }
40120
-
40121
40118
  // src/app/SyncGithub.tsx
40122
40119
  var React44 = __toESM(require_react(), 1);
40123
40120
  var import_last = __toESM(require_last(), 1);
@@ -40301,7 +40298,6 @@ async function run9() {
40301
40298
  if (!argv.verbose) {
40302
40299
  actions.error("Try again with `--verbose` to see more information.");
40303
40300
  }
40304
- handle_exit();
40305
40301
  actions.exit(18);
40306
40302
  }
40307
40303
  function get_push_group_list() {
@@ -40525,11 +40521,8 @@ function RebaseCheck(props) {
40525
40521
  const status = is_rebase ? "prompt" : "done";
40526
40522
  patch({ status });
40527
40523
  } catch (err) {
40528
- actions2.error("Must be run from within a git repository.");
40529
40524
  if (err instanceof Error) {
40530
- if (actions2.isDebug()) {
40531
- actions2.error(err.message);
40532
- }
40525
+ actions2.error(err.message);
40533
40526
  }
40534
40527
  actions2.exit(13);
40535
40528
  }
@@ -40558,9 +40551,7 @@ async function run10() {
40558
40551
  } catch (err) {
40559
40552
  actions.error("Unable to log verbose debug information.");
40560
40553
  if (err instanceof Error) {
40561
- if (actions.isDebug()) {
40562
- actions.error(err.message);
40563
- }
40554
+ actions.error(err.message);
40564
40555
  }
40565
40556
  actions.exit(14);
40566
40557
  }
@@ -45662,7 +45653,7 @@ var yargs_default = Yargs;
45662
45653
 
45663
45654
  // src/command.ts
45664
45655
  async function command2() {
45665
- return yargs_default(hideBin(process.argv)).usage("Usage: git stack [command] [options]").command("$0", "Sync commit ranges to Github", (yargs) => yargs.options(DefaultOptions)).command("fixup [commit]", "Amend staged changes to a specific commit in history", (yargs) => yargs.positional("commit", FixupOptions.commit)).command("log [args...]", "Print an abbreviated log with numbered commits, useful for git stack fixup", (yargs) => yargs.strict(false)).command("rebase", "Update local branch via rebase with latest changes from origin master branch", (yargs) => yargs).option("verbose", GlobalOptions.verbose).wrap(123).strict().version("2.2.7").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
45656
+ return yargs_default(hideBin(process.argv)).scriptName("git stack").usage("Usage: git stack [command] [options]").command("$0", "Sync commit ranges to Github", (yargs) => yargs.options(DefaultOptions)).command("fixup [commit]", "Amend staged changes to a specific commit in history", (yargs) => yargs.positional("commit", FixupOptions.commit)).command("log [args...]", "Print an abbreviated log with numbered commits, useful for git stack fixup", (yargs) => yargs.strict(false)).command("rebase", "Update local branch via rebase with latest changes from origin master branch", (yargs) => yargs).option("verbose", GlobalOptions.verbose).wrap(123).strict().version("2.3.0").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
45666
45657
  }
45667
45658
  var GlobalOptions = {
45668
45659
  verbose: {