git-stack-cli 1.2.2 → 1.2.4

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/README.md CHANGED
@@ -9,6 +9,7 @@
9
9
  - 💪 **Work seamlessly with GitHub's interface**
10
10
  - 🚫 **Avoid juggling mutiple branches and complex rebasing**
11
11
  - 📚 **Preserve your detailed commit history**
12
+ - ⚡ **Faster, in-memory rebase via [`git revise`](https://github.com/mystor/git-revise)**
12
13
 
13
14
  ## Demo
14
15
 
@@ -16,24 +17,36 @@
16
17
 
17
18
  ## Install
18
19
 
19
- ```bash
20
- # node
21
- npm i -g git-stack-cli
20
+ > [!TIP]
21
+ >
22
+ > Install via **[Homebrew](https://brew.sh/)** to ensure the **[official Github CLI](https://cli.github.com/)** and **[git revise](https://github.com/mystor/git-revise)** dependencies are installed automatically
22
23
 
23
- # homebrew
24
+ ```bash
24
25
  brew tap magus/git-stack
25
26
  brew install git-stack
26
27
  ```
27
28
 
29
+ ### `npm`
30
+
31
+ Installing via **[npm](https://www.npmjs.com/)** requires installing the **[official Github CLI](https://cli.github.com/)** and **[git revise](https://github.com/mystor/git-revise)** dependencies separarely
32
+
33
+ ```bash
34
+ brew install gh
35
+ brew install git-revise
36
+
37
+ npm i -g git-stack-cli
38
+ ```
39
+
28
40
  ## Usage
29
41
 
30
42
  ```bash
31
- git stack
43
+ git stack # group and sync commits in branch to Github
32
44
 
45
+ git stack --check # print status only, skipping rebase and sync to Github
33
46
  git stack --verbose # print more detailed logs for debugging internals
34
47
  git stack --no-verify # skip git hooks such as pre-commit and pre-push
35
48
 
36
- git-stack --help # print a table of all command-line arguments
49
+ git stack help # print a table of all CLI arguments
37
50
  ```
38
51
 
39
52
  ## Why?
@@ -58,7 +71,7 @@ Managing even a few stacked diffs requires a relatively strong knowledge of `git
58
71
  - `ghstack` requires rebasing and squashing since each commit creates a pull request, which means you lose commit history
59
72
  - `git stack` allows developing in a single local branch and selecting groups of commits for each pull request
60
73
  - `git stack` adds a clear comment to each pull request in the stack showing the entire stack
61
- - `git stack` does not break if you land pull requests through Github directly, `ghstack` requires landing from the command-line interface
74
+ - `git stack` does not break if you land pull requests through Github directly, `ghstack` requires landing from the CLI interface
62
75
  - `git stack` uses the [official GitHub CLI](https://cli.github.com/) (`gh`) instead of personal access tokens
63
76
 
64
77
  ## Development
@@ -26920,12 +26920,10 @@ function CheckGithubCli(props) {
26920
26920
  actions.output(reactExports.createElement(Text, { color: colors.yellow },
26921
26921
  reactExports.createElement(Command, null, "gh"),
26922
26922
  " must be installed."));
26923
- actions.output(reactExports.createElement(Text, { color: colors.yellow },
26924
- reactExports.createElement(Text, null, "Visit "),
26925
- reactExports.createElement(Url, null, "https://cli.github.com"),
26926
- reactExports.createElement(Text, null, " to install the github cli "),
26927
- reactExports.createElement(Parens, null,
26928
- reactExports.createElement(Command, null, "gh"))));
26923
+ actions.output(reactExports.createElement(FormatText, { wrapper: reactExports.createElement(Text, { color: colors.yellow }), message: "Visit {url} to install the official Github CLI {command}", values: {
26924
+ url: reactExports.createElement(Url, null, "https://cli.github.com"),
26925
+ command: reactExports.createElement(Command, null, "gh"),
26926
+ } }));
26929
26927
  actions.exit(3);
26930
26928
  } }, props.children));
26931
26929
  }
@@ -26950,10 +26948,10 @@ function CheckGithubCliAuth(props) {
26950
26948
  if (actions.isDebug()) {
26951
26949
  actions.error("gh auth status could not find username");
26952
26950
  }
26953
- actions.output(reactExports.createElement(Text, { color: colors.yellow },
26954
- reactExports.createElement(Command, null, "gh"),
26955
- reactExports.createElement(Text, null, " requires login, please run "),
26956
- reactExports.createElement(Command, null, "gh auth login")));
26951
+ actions.output(reactExports.createElement(FormatText, { wrapper: reactExports.createElement(Text, { color: colors.yellow }), message: "{gh} requires login, please run {command}", values: {
26952
+ gh: reactExports.createElement(Command, null, "gh"),
26953
+ command: reactExports.createElement(Command, null, "gh auth login"),
26954
+ } }));
26957
26955
  actions.exit(4);
26958
26956
  } }, props.children));
26959
26957
  }
@@ -26967,20 +26965,20 @@ function CheckGitRevise(props) {
26967
26965
  return (reactExports.createElement(Await, { fallback: reactExports.createElement(Text, { color: colors.yellow },
26968
26966
  reactExports.createElement(Text, null,
26969
26967
  "Checking ",
26970
- reactExports.createElement(Command, null, "git-revise"),
26968
+ reactExports.createElement(Command, null, "git revise"),
26971
26969
  " install...")), function: async () => {
26972
26970
  if (is_command_available("git-revise")) {
26973
26971
  return;
26974
26972
  }
26975
26973
  actions.output(reactExports.createElement(Text, { color: colors.yellow },
26976
- reactExports.createElement(Command, null, "git-revise"),
26974
+ reactExports.createElement(Command, null, "git revise"),
26977
26975
  " must be installed."));
26978
- actions.output(reactExports.createElement(Text, { color: colors.yellow },
26979
- reactExports.createElement(Text, null, "Visit "),
26980
- reactExports.createElement(Url, null, "https://github.com/mystor/git-revise#install"),
26981
- reactExports.createElement(Text, null, " to install the git revise cli "),
26982
- reactExports.createElement(Parens, null,
26983
- reactExports.createElement(Command, null, "git-revise"))));
26976
+ actions.output(reactExports.createElement(FormatText, { wrapper: reactExports.createElement(Text, { color: colors.yellow }), message: "Visit {url} to install the {git_revise} CLI for faster, in-memory rebasing {command}", values: {
26977
+ url: reactExports.createElement(Url, null, "https://github.com/mystor/git-revise#install"),
26978
+ git_revise: reactExports.createElement(Command, null, "git revise"),
26979
+ command: (reactExports.createElement(Parens, null,
26980
+ reactExports.createElement(Command, null, "git revise"))),
26981
+ } }));
26984
26982
  actions.exit(10);
26985
26983
  } }, props.children));
26986
26984
  }
@@ -34295,7 +34293,11 @@ async function command() {
34295
34293
  type: "string",
34296
34294
  choices: [Rebase["git-revise"], Rebase["cherry-pick"]],
34297
34295
  default: Rebase["git-revise"],
34298
- description: `Rebase implementation, "${Rebase["git-revise"]}" by default to perform in-memory rebase. "${Rebase["cherry-pick"]}" can be used to use disk and incrementally rebase each commit`,
34296
+ description: [
34297
+ "Strategy used for syncing branches",
34298
+ `${Rebase["git-revise"]}: perform faster in-memory rebase`,
34299
+ `${Rebase["cherry-pick"]}: use disk and incrementally rebase each commit`,
34300
+ ].join(" | "),
34299
34301
  })
34300
34302
  .option("verbose", {
34301
34303
  type: "boolean",
@@ -34312,7 +34314,7 @@ async function command() {
34312
34314
  .option("branch", {
34313
34315
  type: "string",
34314
34316
  alias: ["b"],
34315
- description: `Set the master branch name, defaults to "master" (or "main" if "master" is not found)`,
34317
+ description: 'Set the master branch name, defaults to "master" (or "main" if "master" is not found)',
34316
34318
  })
34317
34319
  .option("write-state-json", {
34318
34320
  hidden: true,
@@ -34326,13 +34328,13 @@ async function command() {
34326
34328
  default: false,
34327
34329
  description: "Mock local store metadata for testing",
34328
34330
  })
34329
- // do not wrap to 80 columns (yargs default)
34330
- // 140 seems to look decent so lets do that instead
34331
+ // yargs default wraps to 80 columns
34331
34332
  // passing null will wrap to terminal width
34332
- .wrap(140)
34333
+ // value below if what seems to look decent
34334
+ .wrap(123)
34333
34335
  // disallow unknown options
34334
34336
  .strict()
34335
- .version("1.2.2" )
34337
+ .version("1.2.4" )
34336
34338
  .showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`")
34337
34339
  .help("help", "Show usage via `git stack help`").argv);
34338
34340
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-stack-cli",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "",
5
5
  "author": "magus",
6
6
  "license": "MIT",
@@ -4,6 +4,7 @@ import * as Ink from "ink-cjs";
4
4
 
5
5
  import { Await } from "~/app/Await";
6
6
  import { Command } from "~/app/Command";
7
+ import { FormatText } from "~/app/FormatText";
7
8
  import { Parens } from "~/app/Parens";
8
9
  import { Store } from "~/app/Store";
9
10
  import { Url } from "~/app/Url";
@@ -89,15 +90,15 @@ function CheckGithubCli(props: Props) {
89
90
  );
90
91
 
91
92
  actions.output(
92
- <Ink.Text color={colors.yellow}>
93
- <Ink.Text>{"Visit "}</Ink.Text>
94
- <Url>https://cli.github.com</Url>
95
- <Ink.Text>{" to install the github cli "}</Ink.Text>
96
-
97
- <Parens>
98
- <Command>gh</Command>
99
- </Parens>
100
- </Ink.Text>
93
+ <FormatText
94
+ wrapper={<Ink.Text color={colors.yellow} />}
95
+ message="Visit {url} to install the official Github CLI {command}"
96
+ values={{
97
+ url: <Url>https://cli.github.com</Url>,
98
+
99
+ command: <Command>gh</Command>,
100
+ }}
101
+ />
101
102
  );
102
103
 
103
104
  actions.exit(3);
@@ -141,11 +142,15 @@ function CheckGithubCliAuth(props: Props) {
141
142
  }
142
143
 
143
144
  actions.output(
144
- <Ink.Text color={colors.yellow}>
145
- <Command>gh</Command>
146
- <Ink.Text>{" requires login, please run "}</Ink.Text>
147
- <Command>gh auth login</Command>
148
- </Ink.Text>
145
+ <FormatText
146
+ wrapper={<Ink.Text color={colors.yellow} />}
147
+ message="{gh} requires login, please run {command}"
148
+ values={{
149
+ gh: <Command>gh</Command>,
150
+
151
+ command: <Command>gh auth login</Command>,
152
+ }}
153
+ />
149
154
  );
150
155
 
151
156
  actions.exit(4);
@@ -170,7 +175,7 @@ function CheckGitRevise(props: Props) {
170
175
  fallback={
171
176
  <Ink.Text color={colors.yellow}>
172
177
  <Ink.Text>
173
- Checking <Command>git-revise</Command> install...
178
+ Checking <Command>git revise</Command> install...
174
179
  </Ink.Text>
175
180
  </Ink.Text>
176
181
  }
@@ -181,20 +186,26 @@ function CheckGitRevise(props: Props) {
181
186
 
182
187
  actions.output(
183
188
  <Ink.Text color={colors.yellow}>
184
- <Command>git-revise</Command> must be installed.
189
+ <Command>git revise</Command> must be installed.
185
190
  </Ink.Text>
186
191
  );
187
192
 
188
193
  actions.output(
189
- <Ink.Text color={colors.yellow}>
190
- <Ink.Text>{"Visit "}</Ink.Text>
191
- <Url>https://github.com/mystor/git-revise#install</Url>
192
- <Ink.Text>{" to install the git revise cli "}</Ink.Text>
193
-
194
- <Parens>
195
- <Command>git-revise</Command>
196
- </Parens>
197
- </Ink.Text>
194
+ <FormatText
195
+ wrapper={<Ink.Text color={colors.yellow} />}
196
+ message="Visit {url} to install the {git_revise} CLI for faster, in-memory rebasing {command}"
197
+ values={{
198
+ url: <Url>https://github.com/mystor/git-revise#install</Url>,
199
+
200
+ git_revise: <Command>git revise</Command>,
201
+
202
+ command: (
203
+ <Parens>
204
+ <Command>git revise</Command>
205
+ </Parens>
206
+ ),
207
+ }}
208
+ />
198
209
  );
199
210
 
200
211
  actions.exit(10);
package/src/command.ts CHANGED
@@ -35,7 +35,11 @@ export async function command() {
35
35
  type: "string",
36
36
  choices: [Rebase["git-revise"], Rebase["cherry-pick"]],
37
37
  default: Rebase["git-revise"],
38
- description: `Rebase implementation, "${Rebase["git-revise"]}" by default to perform in-memory rebase. "${Rebase["cherry-pick"]}" can be used to use disk and incrementally rebase each commit`,
38
+ description: [
39
+ "Strategy used for syncing branches",
40
+ `${Rebase["git-revise"]}: perform faster in-memory rebase`,
41
+ `${Rebase["cherry-pick"]}: use disk and incrementally rebase each commit`,
42
+ ].join(" | "),
39
43
  })
40
44
 
41
45
  .option("verbose", {
@@ -55,7 +59,8 @@ export async function command() {
55
59
  .option("branch", {
56
60
  type: "string",
57
61
  alias: ["b"],
58
- description: `Set the master branch name, defaults to "master" (or "main" if "master" is not found)`,
62
+ description:
63
+ 'Set the master branch name, defaults to "master" (or "main" if "master" is not found)',
59
64
  })
60
65
 
61
66
  .option("write-state-json", {
@@ -72,10 +77,10 @@ export async function command() {
72
77
  description: "Mock local store metadata for testing",
73
78
  })
74
79
 
75
- // do not wrap to 80 columns (yargs default)
76
- // 140 seems to look decent so lets do that instead
80
+ // yargs default wraps to 80 columns
77
81
  // passing null will wrap to terminal width
78
- .wrap(140)
82
+ // value below if what seems to look decent
83
+ .wrap(123)
79
84
 
80
85
  // disallow unknown options
81
86
  .strict()