git-stack-cli 1.1.0 → 1.2.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.
@@ -26960,8 +26960,8 @@ function CheckGithubCliAuth(props) {
26960
26960
  function CheckGitRevise(props) {
26961
26961
  const actions = Store.useActions();
26962
26962
  const argv = Store.useState((state) => state.argv);
26963
- // skip git revise check when `--git-revise` flag is not present
26964
- if (!argv?.["git-revise"]) {
26963
+ // skip git revise check when `rebase` is not git-revise
26964
+ if (argv?.["rebase"] !== "git-revise") {
26965
26965
  return props.children;
26966
26966
  }
26967
26967
  return (reactExports.createElement(Await, { fallback: reactExports.createElement(Text, { color: colors.yellow },
@@ -27872,7 +27872,7 @@ async function run$2(props) {
27872
27872
  // must perform rebase from repo root for applying git patch
27873
27873
  process.chdir(repo_root);
27874
27874
  await cli(`pwd`);
27875
- if (argv["git-revise"]) {
27875
+ if (argv["rebase"] === "git-revise") {
27876
27876
  await rebase_git_revise();
27877
27877
  }
27878
27878
  else {
@@ -34291,10 +34291,11 @@ async function command() {
34291
34291
  default: true,
34292
34292
  description: "Skip git hooks such as pre-commit and pre-push",
34293
34293
  })
34294
- .option("git-revise", {
34295
- type: "boolean",
34296
- default: false,
34297
- description: `Use git-revise to perform in-memory rebase, (macOS + Linux only)`,
34294
+ .option("rebase", {
34295
+ type: "string",
34296
+ choices: [Rebase["git-revise"], Rebase["cherry-pick"]],
34297
+ 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`,
34298
34299
  })
34299
34300
  .option("verbose", {
34300
34301
  type: "boolean",
@@ -34326,14 +34327,19 @@ async function command() {
34326
34327
  description: "Mock local store metadata for testing",
34327
34328
  })
34328
34329
  // do not wrap to 80 columns (yargs default)
34329
- // .wrap(yargs().terminalWidth()) will fill terminal (maximuize)
34330
- .wrap(null)
34330
+ // 140 seems to look decent so lets do that instead
34331
+ // passing null will wrap to terminal width
34332
+ .wrap(140)
34331
34333
  // disallow unknown options
34332
34334
  .strict()
34333
- .version("1.1.0" )
34335
+ .version("1.2.0" )
34334
34336
  .showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`")
34335
34337
  .help("help", "Show usage via `git stack help`").argv);
34336
34338
  }
34339
+ const Rebase = Object.freeze({
34340
+ "git-revise": "git-revise",
34341
+ "cherry-pick": "cherry-pick",
34342
+ });
34337
34343
 
34338
34344
  command()
34339
34345
  .then((argv) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-stack-cli",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "",
5
5
  "author": "magus",
6
6
  "license": "MIT",
@@ -160,8 +160,8 @@ function CheckGitRevise(props: Props) {
160
160
  const actions = Store.useActions();
161
161
  const argv = Store.useState((state) => state.argv);
162
162
 
163
- // skip git revise check when `--git-revise` flag is not present
164
- if (!argv?.["git-revise"]) {
163
+ // skip git revise check when `rebase` is not git-revise
164
+ if (argv?.["rebase"] !== "git-revise") {
165
165
  return props.children;
166
166
  }
167
167
 
@@ -89,7 +89,7 @@ async function run(props: Props) {
89
89
  process.chdir(repo_root);
90
90
  await cli(`pwd`);
91
91
 
92
- if (argv["git-revise"]) {
92
+ if (argv["rebase"] === "git-revise") {
93
93
  await rebase_git_revise();
94
94
  } else {
95
95
  await rebase_cherry_pick();
package/src/command.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import yargs from "yargs";
2
2
  import { hideBin } from "yargs/helpers";
3
3
 
4
- export type Argv = Awaited<ReturnType<typeof command>>;
4
+ export type Argv = Awaited<ReturnType<typeof command>> & {
5
+ ["rebase"]: keyof typeof Rebase;
6
+ };
5
7
 
6
8
  export async function command() {
7
9
  // https://yargs.js.org/docs/#api-reference-optionkey-opt
@@ -29,10 +31,11 @@ export async function command() {
29
31
  description: "Skip git hooks such as pre-commit and pre-push",
30
32
  })
31
33
 
32
- .option("git-revise", {
33
- type: "boolean",
34
- default: false,
35
- description: `Use git-revise to perform in-memory rebase, (macOS + Linux only)`,
34
+ .option("rebase", {
35
+ type: "string",
36
+ choices: [Rebase["git-revise"], Rebase["cherry-pick"]],
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`,
36
39
  })
37
40
 
38
41
  .option("verbose", {
@@ -70,8 +73,10 @@ export async function command() {
70
73
  })
71
74
 
72
75
  // do not wrap to 80 columns (yargs default)
73
- // .wrap(yargs().terminalWidth()) will fill terminal (maximuize)
74
- .wrap(null)
76
+ // 140 seems to look decent so lets do that instead
77
+ // passing null will wrap to terminal width
78
+ .wrap(140)
79
+
75
80
  // disallow unknown options
76
81
  .strict()
77
82
  .version(process.env.CLI_VERSION || "unknown")
@@ -82,3 +87,8 @@ export async function command() {
82
87
  .help("help", "Show usage via `git stack help`").argv
83
88
  );
84
89
  }
90
+
91
+ const Rebase = Object.freeze({
92
+ "git-revise": "git-revise",
93
+ "cherry-pick": "cherry-pick",
94
+ });