git-stack-cli 1.11.5 → 1.11.7

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.
@@ -30269,9 +30269,9 @@ function DirtyCheck(props) {
30269
30269
 
30270
30270
  function GatherMetadata(props) {
30271
30271
  const fallback = (reactExports.createElement(Text, { color: colors.yellow }, "Gathering local git information\u2026"));
30272
- return (reactExports.createElement(Await, { fallback: fallback, function: run$8 }, props.children));
30272
+ return (reactExports.createElement(Await, { fallback: fallback, function: run$9 }, props.children));
30273
30273
  }
30274
- async function run$8() {
30274
+ async function run$9() {
30275
30275
  const actions = Store.getState().actions;
30276
30276
  const argv = Store.getState().argv;
30277
30277
  try {
@@ -30365,9 +30365,9 @@ function format_time(date) {
30365
30365
  }
30366
30366
 
30367
30367
  function GithubApiError() {
30368
- return reactExports.createElement(Await, { fallback: null, function: run$7 });
30368
+ return reactExports.createElement(Await, { fallback: null, function: run$8 });
30369
30369
  }
30370
- async function run$7() {
30370
+ async function run$8() {
30371
30371
  const actions = Store.getState().actions;
30372
30372
  const res = await cli(`gh api https://api.github.com/rate_limit`);
30373
30373
  const res_json = JSON.parse(res.stdout);
@@ -30409,7 +30409,7 @@ function LocalCommitStatus(props) {
30409
30409
  if (argv["mock-metadata"]) {
30410
30410
  return (reactExports.createElement(Await, { fallback: fallback, function: mock_metadata }, props.children));
30411
30411
  }
30412
- return (reactExports.createElement(Await, { fallback: fallback, function: run$6 }, props.children));
30412
+ return (reactExports.createElement(Await, { fallback: fallback, function: run$7 }, props.children));
30413
30413
  }
30414
30414
  async function mock_metadata() {
30415
30415
  const module = await Promise.resolve().then(function () { return metadata; });
@@ -30419,7 +30419,7 @@ async function mock_metadata() {
30419
30419
  state.step = "status";
30420
30420
  });
30421
30421
  }
30422
- async function run$6() {
30422
+ async function run$7() {
30423
30423
  const actions = Store.getState().actions;
30424
30424
  try {
30425
30425
  const commit_range = await range();
@@ -30734,9 +30734,9 @@ const RE = {
30734
30734
  };
30735
30735
 
30736
30736
  function ManualRebase() {
30737
- return (reactExports.createElement(Await, { fallback: reactExports.createElement(Text, { color: colors.yellow }, "Rebasing commits\u2026"), function: run$5 }));
30737
+ return (reactExports.createElement(Await, { fallback: reactExports.createElement(Text, { color: colors.yellow }, "Rebasing commits\u2026"), function: run$6 }));
30738
30738
  }
30739
- async function run$5() {
30739
+ async function run$6() {
30740
30740
  const state = Store.getState();
30741
30741
  const actions = state.actions;
30742
30742
  const argv = state.argv;
@@ -31222,9 +31222,9 @@ function get_status_bold(row) {
31222
31222
  }
31223
31223
 
31224
31224
  function PostRebaseStatus() {
31225
- return reactExports.createElement(Await, { fallback: null, function: run$4 });
31225
+ return reactExports.createElement(Await, { fallback: null, function: run$5 });
31226
31226
  }
31227
- async function run$4() {
31227
+ async function run$5() {
31228
31228
  const actions = Store.getState().actions;
31229
31229
  // reset github pr cache before refreshing via commit range below
31230
31230
  actions.reset_pr();
@@ -31254,9 +31254,9 @@ function PreLocalMergeRebase() {
31254
31254
  }
31255
31255
 
31256
31256
  function PreManualRebase() {
31257
- return reactExports.createElement(Await, { fallback: null, function: run$3 });
31257
+ return reactExports.createElement(Await, { fallback: null, function: run$4 });
31258
31258
  }
31259
- async function run$3() {
31259
+ async function run$4() {
31260
31260
  const state = Store.getState();
31261
31261
  const actions = state.actions;
31262
31262
  const repo_root = state.repo_root;
@@ -31765,9 +31765,9 @@ const SYMBOL = {
31765
31765
  };
31766
31766
 
31767
31767
  function Status() {
31768
- return reactExports.createElement(Await, { fallback: null, function: run$2 });
31768
+ return reactExports.createElement(Await, { fallback: null, function: run$3 });
31769
31769
  }
31770
- async function run$2() {
31770
+ async function run$3() {
31771
31771
  const state = Store.getState();
31772
31772
  const actions = state.actions;
31773
31773
  const argv = state.argv;
@@ -31910,6 +31910,30 @@ function RebaseCheck(props) {
31910
31910
  }
31911
31911
  }
31912
31912
 
31913
+ function VerboseDebugInfo(props) {
31914
+ const fallback = (reactExports.createElement(Text, { color: colors.yellow }, "Logging verbose debug information\u2026"));
31915
+ return (reactExports.createElement(Await, { fallback: fallback, function: run$2 }, props.children));
31916
+ }
31917
+ async function run$2() {
31918
+ const actions = Store.getState().actions;
31919
+ try {
31920
+ await cli(`echo HOME=$HOME`);
31921
+ await cli(`echo USER=$USER`);
31922
+ await cli(`echo GIT_AUTHOR_NAME=$GIT_AUTHOR_NAME`);
31923
+ await cli(`echo GIT_AUTHOR_EMAIL=$GIT_AUTHOR_EMAIL`);
31924
+ await cli(`git config --list --show-origin`);
31925
+ }
31926
+ catch (err) {
31927
+ actions.error("Unable to log verbose debug information.");
31928
+ if (err instanceof Error) {
31929
+ if (actions.isDebug()) {
31930
+ actions.error(err.message);
31931
+ }
31932
+ }
31933
+ actions.exit(14);
31934
+ }
31935
+ }
31936
+
31913
31937
  function Fixup() {
31914
31938
  return reactExports.createElement(Await, { fallback: null, function: run$1 });
31915
31939
  }
@@ -31952,6 +31976,10 @@ async function run$1() {
31952
31976
  // get the commit SHA of the target commit
31953
31977
  const commit_sha = (await cli(`git rev-parse HEAD~${adjusted_number}`))
31954
31978
  .stdout;
31979
+ actions.output(reactExports.createElement(FormatText, { wrapper: reactExports.createElement(Text, { color: colors.yellow }), message: "\uD83D\uDEE0\uFE0F fixup {relative_number} {commit_sha}", values: {
31980
+ commit_sha: reactExports.createElement(Parens, null, commit_sha),
31981
+ relative_number: relative_number,
31982
+ } }));
31955
31983
  await cli(`git commit --fixup ${commit_sha}`);
31956
31984
  // check if stash required
31957
31985
  let save_stash = false;
@@ -31963,21 +31991,26 @@ async function run$1() {
31963
31991
  await cli("git stash -q");
31964
31992
  actions.output(reactExports.createElement(Text, null, "\uD83D\uDCE6 Changes saved to stash"));
31965
31993
  }
31966
- // rebase target needs to account for new commit created above
31967
- const rebase_target = Number(relative_number) + 1;
31968
- await cli(`git rebase -i --autosquash HEAD~${rebase_target}`, {
31969
- env: {
31970
- PATH: process.env.PATH,
31971
- GIT_EDITOR: "true",
31972
- },
31973
- });
31974
- actions.output(reactExports.createElement(FormatText, { wrapper: reactExports.createElement(Text, { color: colors.yellow }), message: "\uD83D\uDEE0\uFE0F fixup {relative_number} {commit_sha}", values: {
31975
- commit_sha: reactExports.createElement(Parens, null, commit_sha),
31976
- relative_number: relative_number,
31977
- } }));
31978
- if (save_stash) {
31979
- await cli("git stash pop -q");
31980
- actions.output(reactExports.createElement(Text, { color: colors.green }, "\u2705 Changes restored from stash"));
31994
+ try {
31995
+ // rebase target needs to account for new commit created above
31996
+ const rebase_target = Number(relative_number) + 1;
31997
+ await cli(`git rebase -i --autosquash HEAD~${rebase_target}`, {
31998
+ env: {
31999
+ ...process.env,
32000
+ GIT_EDITOR: "true",
32001
+ },
32002
+ });
32003
+ }
32004
+ catch (error) {
32005
+ actions.error("🚨 Fixup failed");
32006
+ await cli("git rebase --abort");
32007
+ await cli("git reset --soft HEAD~1");
32008
+ }
32009
+ finally {
32010
+ if (save_stash) {
32011
+ await cli("git stash pop -q");
32012
+ actions.output(reactExports.createElement(Text, { color: colors.green }, "\u2705 Changes restored from stash"));
32013
+ }
31981
32014
  }
31982
32015
  }
31983
32016
 
@@ -32050,10 +32083,11 @@ function App() {
32050
32083
  actions.exit(0);
32051
32084
  }
32052
32085
  } },
32053
- reactExports.createElement(DependencyCheck, null,
32054
- reactExports.createElement(RebaseCheck, null,
32055
- reactExports.createElement(CherryPickCheck, null,
32056
- reactExports.createElement(MaybeMain, null)))))));
32086
+ reactExports.createElement(VerboseDebugInfo, null,
32087
+ reactExports.createElement(DependencyCheck, null,
32088
+ reactExports.createElement(RebaseCheck, null,
32089
+ reactExports.createElement(CherryPickCheck, null,
32090
+ reactExports.createElement(MaybeMain, null))))))));
32057
32091
  }
32058
32092
  function MaybeMain() {
32059
32093
  const argv = Store.useState((state) => state.argv);
@@ -37395,7 +37429,7 @@ async function command() {
37395
37429
  .wrap(123)
37396
37430
  // disallow unknown options
37397
37431
  .strict()
37398
- .version("1.11.5" )
37432
+ .version("1.11.7" )
37399
37433
  .showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`")
37400
37434
  .help("help", "Show usage via `git stack help`")
37401
37435
  .argv;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-stack-cli",
3
- "version": "1.11.5",
3
+ "version": "1.11.7",
4
4
  "description": "",
5
5
  "author": "magus",
6
6
  "license": "MIT",
package/src/app/App.tsx CHANGED
@@ -14,6 +14,7 @@ import { Output } from "~/app/Output";
14
14
  import { Providers } from "~/app/Providers";
15
15
  import { RebaseCheck } from "~/app/RebaseCheck";
16
16
  import { Store } from "~/app/Store";
17
+ import { VerboseDebugInfo } from "~/app/VerboseDebugInfo";
17
18
  import { Fixup } from "~/commands/Fixup";
18
19
  import { Log } from "~/commands/Log";
19
20
  import { Rebase } from "~/commands/Rebase";
@@ -54,13 +55,15 @@ export function App() {
54
55
  }
55
56
  }}
56
57
  >
57
- <DependencyCheck>
58
- <RebaseCheck>
59
- <CherryPickCheck>
60
- <MaybeMain />
61
- </CherryPickCheck>
62
- </RebaseCheck>
63
- </DependencyCheck>
58
+ <VerboseDebugInfo>
59
+ <DependencyCheck>
60
+ <RebaseCheck>
61
+ <CherryPickCheck>
62
+ <MaybeMain />
63
+ </CherryPickCheck>
64
+ </RebaseCheck>
65
+ </DependencyCheck>
66
+ </VerboseDebugInfo>
64
67
  </AutoUpdate>
65
68
  </Providers>
66
69
  );
@@ -0,0 +1,48 @@
1
+ import * as React from "react";
2
+
3
+ import * as Ink from "ink-cjs";
4
+
5
+ import { Await } from "~/app/Await";
6
+ import { Store } from "~/app/Store";
7
+ import { cli } from "~/core/cli";
8
+ import { colors } from "~/core/colors";
9
+
10
+ type Props = {
11
+ children: React.ReactNode;
12
+ };
13
+
14
+ export function VerboseDebugInfo(props: Props) {
15
+ const fallback = (
16
+ <Ink.Text color={colors.yellow}>
17
+ Logging verbose debug information…
18
+ </Ink.Text>
19
+ );
20
+
21
+ return (
22
+ <Await fallback={fallback} function={run}>
23
+ {props.children}
24
+ </Await>
25
+ );
26
+ }
27
+
28
+ async function run() {
29
+ const actions = Store.getState().actions;
30
+
31
+ try {
32
+ await cli(`echo HOME=$HOME`);
33
+ await cli(`echo USER=$USER`);
34
+ await cli(`echo GIT_AUTHOR_NAME=$GIT_AUTHOR_NAME`);
35
+ await cli(`echo GIT_AUTHOR_EMAIL=$GIT_AUTHOR_EMAIL`);
36
+ await cli(`git config --list --show-origin`);
37
+ } catch (err) {
38
+ actions.error("Unable to log verbose debug information.");
39
+
40
+ if (err instanceof Error) {
41
+ if (actions.isDebug()) {
42
+ actions.error(err.message);
43
+ }
44
+ }
45
+
46
+ actions.exit(14);
47
+ }
48
+ }
@@ -74,6 +74,17 @@ async function run() {
74
74
  const commit_sha = (await cli(`git rev-parse HEAD~${adjusted_number}`))
75
75
  .stdout;
76
76
 
77
+ actions.output(
78
+ <FormatText
79
+ wrapper={<Ink.Text color={colors.yellow} />}
80
+ message="🛠️ fixup {relative_number} {commit_sha}"
81
+ values={{
82
+ commit_sha: <Parens>{commit_sha}</Parens>,
83
+ relative_number: relative_number,
84
+ }}
85
+ />
86
+ );
87
+
77
88
  await cli(`git commit --fixup ${commit_sha}`);
78
89
 
79
90
  // check if stash required
@@ -91,31 +102,27 @@ async function run() {
91
102
  actions.output(<Ink.Text>📦 Changes saved to stash</Ink.Text>);
92
103
  }
93
104
 
94
- // rebase target needs to account for new commit created above
95
- const rebase_target = Number(relative_number) + 1;
96
- await cli(`git rebase -i --autosquash HEAD~${rebase_target}`, {
97
- env: {
98
- PATH: process.env.PATH,
99
- GIT_EDITOR: "true",
100
- },
101
- });
102
-
103
- actions.output(
104
- <FormatText
105
- wrapper={<Ink.Text color={colors.yellow} />}
106
- message="🛠️ fixup {relative_number} {commit_sha}"
107
- values={{
108
- commit_sha: <Parens>{commit_sha}</Parens>,
109
- relative_number: relative_number,
110
- }}
111
- />
112
- );
113
-
114
- if (save_stash) {
115
- await cli("git stash pop -q");
116
-
117
- actions.output(
118
- <Ink.Text color={colors.green}>✅ Changes restored from stash</Ink.Text>
119
- );
105
+ try {
106
+ // rebase target needs to account for new commit created above
107
+ const rebase_target = Number(relative_number) + 1;
108
+
109
+ await cli(`git rebase -i --autosquash HEAD~${rebase_target}`, {
110
+ env: {
111
+ ...process.env,
112
+ GIT_EDITOR: "true",
113
+ },
114
+ });
115
+ } catch (error) {
116
+ actions.error("🚨 Fixup failed");
117
+ await cli("git rebase --abort");
118
+ await cli("git reset --soft HEAD~1");
119
+ } finally {
120
+ if (save_stash) {
121
+ await cli("git stash pop -q");
122
+
123
+ actions.output(
124
+ <Ink.Text color={colors.green}>✅ Changes restored from stash</Ink.Text>
125
+ );
126
+ }
120
127
  }
121
128
  }