git-stack-cli 1.11.6 → 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.
@@ -31917,11 +31917,11 @@ function VerboseDebugInfo(props) {
31917
31917
  async function run$2() {
31918
31918
  const actions = Store.getState().actions;
31919
31919
  try {
31920
- await cli(`git config --list --show-origin`);
31921
31920
  await cli(`echo HOME=$HOME`);
31922
31921
  await cli(`echo USER=$USER`);
31923
31922
  await cli(`echo GIT_AUTHOR_NAME=$GIT_AUTHOR_NAME`);
31924
31923
  await cli(`echo GIT_AUTHOR_EMAIL=$GIT_AUTHOR_EMAIL`);
31924
+ await cli(`git config --list --show-origin`);
31925
31925
  }
31926
31926
  catch (err) {
31927
31927
  actions.error("Unable to log verbose debug information.");
@@ -31976,6 +31976,10 @@ async function run$1() {
31976
31976
  // get the commit SHA of the target commit
31977
31977
  const commit_sha = (await cli(`git rev-parse HEAD~${adjusted_number}`))
31978
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
+ } }));
31979
31983
  await cli(`git commit --fixup ${commit_sha}`);
31980
31984
  // check if stash required
31981
31985
  let save_stash = false;
@@ -31987,21 +31991,26 @@ async function run$1() {
31987
31991
  await cli("git stash -q");
31988
31992
  actions.output(reactExports.createElement(Text, null, "\uD83D\uDCE6 Changes saved to stash"));
31989
31993
  }
31990
- // rebase target needs to account for new commit created above
31991
- const rebase_target = Number(relative_number) + 1;
31992
- await cli(`git rebase -i --autosquash HEAD~${rebase_target}`, {
31993
- env: {
31994
- PATH: process.env.PATH,
31995
- GIT_EDITOR: "true",
31996
- },
31997
- });
31998
- actions.output(reactExports.createElement(FormatText, { wrapper: reactExports.createElement(Text, { color: colors.yellow }), message: "\uD83D\uDEE0\uFE0F fixup {relative_number} {commit_sha}", values: {
31999
- commit_sha: reactExports.createElement(Parens, null, commit_sha),
32000
- relative_number: relative_number,
32001
- } }));
32002
- if (save_stash) {
32003
- await cli("git stash pop -q");
32004
- 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
+ }
32005
32014
  }
32006
32015
  }
32007
32016
 
@@ -37420,7 +37429,7 @@ async function command() {
37420
37429
  .wrap(123)
37421
37430
  // disallow unknown options
37422
37431
  .strict()
37423
- .version("1.11.6" )
37432
+ .version("1.11.7" )
37424
37433
  .showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`")
37425
37434
  .help("help", "Show usage via `git stack help`")
37426
37435
  .argv;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-stack-cli",
3
- "version": "1.11.6",
3
+ "version": "1.11.7",
4
4
  "description": "",
5
5
  "author": "magus",
6
6
  "license": "MIT",
@@ -29,11 +29,11 @@ async function run() {
29
29
  const actions = Store.getState().actions;
30
30
 
31
31
  try {
32
- await cli(`git config --list --show-origin`);
33
32
  await cli(`echo HOME=$HOME`);
34
33
  await cli(`echo USER=$USER`);
35
34
  await cli(`echo GIT_AUTHOR_NAME=$GIT_AUTHOR_NAME`);
36
35
  await cli(`echo GIT_AUTHOR_EMAIL=$GIT_AUTHOR_EMAIL`);
36
+ await cli(`git config --list --show-origin`);
37
37
  } catch (err) {
38
38
  actions.error("Unable to log verbose debug information.");
39
39
 
@@ -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
  }