git-stack-cli 1.11.4 → 1.11.6
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/cjs/index.cjs +53 -25
- package/package.json +1 -1
- package/src/app/App.tsx +10 -7
- package/src/app/ManualRebase.tsx +8 -7
- package/src/app/VerboseDebugInfo.tsx +48 -0
- package/src/core/GitReviseTodo.ts +3 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -30109,6 +30109,9 @@ echo "$GIT_REVISE_TODO" > "$git_revise_todo_path"
|
|
|
30109
30109
|
`git`,
|
|
30110
30110
|
`revise --edit -i ${args.rebase_merge_base}`,
|
|
30111
30111
|
];
|
|
30112
|
+
// ignore here is important to prevent scrollback clear
|
|
30113
|
+
// change to pipe to see output temporarily
|
|
30114
|
+
// https://github.com/magus/git-stack-cli/commit/f9f10e3ac3cd9a35ee75d3e0851a48391967a23f
|
|
30112
30115
|
await cli(command, { stdio: ["ignore", "ignore", "ignore"] });
|
|
30113
30116
|
};
|
|
30114
30117
|
|
|
@@ -30266,9 +30269,9 @@ function DirtyCheck(props) {
|
|
|
30266
30269
|
|
|
30267
30270
|
function GatherMetadata(props) {
|
|
30268
30271
|
const fallback = (reactExports.createElement(Text, { color: colors.yellow }, "Gathering local git information\u2026"));
|
|
30269
|
-
return (reactExports.createElement(Await, { fallback: fallback, function: run$
|
|
30272
|
+
return (reactExports.createElement(Await, { fallback: fallback, function: run$9 }, props.children));
|
|
30270
30273
|
}
|
|
30271
|
-
async function run$
|
|
30274
|
+
async function run$9() {
|
|
30272
30275
|
const actions = Store.getState().actions;
|
|
30273
30276
|
const argv = Store.getState().argv;
|
|
30274
30277
|
try {
|
|
@@ -30362,9 +30365,9 @@ function format_time(date) {
|
|
|
30362
30365
|
}
|
|
30363
30366
|
|
|
30364
30367
|
function GithubApiError() {
|
|
30365
|
-
return reactExports.createElement(Await, { fallback: null, function: run$
|
|
30368
|
+
return reactExports.createElement(Await, { fallback: null, function: run$8 });
|
|
30366
30369
|
}
|
|
30367
|
-
async function run$
|
|
30370
|
+
async function run$8() {
|
|
30368
30371
|
const actions = Store.getState().actions;
|
|
30369
30372
|
const res = await cli(`gh api https://api.github.com/rate_limit`);
|
|
30370
30373
|
const res_json = JSON.parse(res.stdout);
|
|
@@ -30406,7 +30409,7 @@ function LocalCommitStatus(props) {
|
|
|
30406
30409
|
if (argv["mock-metadata"]) {
|
|
30407
30410
|
return (reactExports.createElement(Await, { fallback: fallback, function: mock_metadata }, props.children));
|
|
30408
30411
|
}
|
|
30409
|
-
return (reactExports.createElement(Await, { fallback: fallback, function: run$
|
|
30412
|
+
return (reactExports.createElement(Await, { fallback: fallback, function: run$7 }, props.children));
|
|
30410
30413
|
}
|
|
30411
30414
|
async function mock_metadata() {
|
|
30412
30415
|
const module = await Promise.resolve().then(function () { return metadata; });
|
|
@@ -30416,7 +30419,7 @@ async function mock_metadata() {
|
|
|
30416
30419
|
state.step = "status";
|
|
30417
30420
|
});
|
|
30418
30421
|
}
|
|
30419
|
-
async function run$
|
|
30422
|
+
async function run$7() {
|
|
30420
30423
|
const actions = Store.getState().actions;
|
|
30421
30424
|
try {
|
|
30422
30425
|
const commit_range = await range();
|
|
@@ -30731,20 +30734,18 @@ const RE = {
|
|
|
30731
30734
|
};
|
|
30732
30735
|
|
|
30733
30736
|
function ManualRebase() {
|
|
30734
|
-
return (reactExports.createElement(Await, { fallback: reactExports.createElement(Text, { color: colors.yellow }, "Rebasing commits\u2026"), function: run$
|
|
30737
|
+
return (reactExports.createElement(Await, { fallback: reactExports.createElement(Text, { color: colors.yellow }, "Rebasing commits\u2026"), function: run$6 }));
|
|
30735
30738
|
}
|
|
30736
|
-
async function run$
|
|
30739
|
+
async function run$6() {
|
|
30737
30740
|
const state = Store.getState();
|
|
30738
30741
|
const actions = state.actions;
|
|
30739
30742
|
const argv = state.argv;
|
|
30740
30743
|
const branch_name = state.branch_name;
|
|
30741
|
-
const original_commit_range = cloneDeep$1(state.commit_range);
|
|
30742
30744
|
const commit_map = state.commit_map;
|
|
30743
30745
|
const master_branch = state.master_branch;
|
|
30744
30746
|
const cwd = state.cwd;
|
|
30745
30747
|
const repo_root = state.repo_root;
|
|
30746
30748
|
invariant(branch_name, "branch_name must exist");
|
|
30747
|
-
invariant(original_commit_range, "original_commit_range must exist");
|
|
30748
30749
|
invariant(commit_map, "commit_map must exist");
|
|
30749
30750
|
invariant(repo_root, "repo_root must exist");
|
|
30750
30751
|
// always listen for SIGINT event and restore git state
|
|
@@ -30752,8 +30753,10 @@ async function run$5() {
|
|
|
30752
30753
|
// get latest merge_base relative to local master
|
|
30753
30754
|
const merge_base = (await cli(`git merge-base HEAD ${master_branch}`)).stdout;
|
|
30754
30755
|
// immediately paint all commit to preserve selected commit ranges
|
|
30755
|
-
|
|
30756
|
-
|
|
30756
|
+
let commit_range = await range(commit_map);
|
|
30757
|
+
// reverse group list to ensure we create git revise in correct order
|
|
30758
|
+
commit_range.group_list.reverse();
|
|
30759
|
+
for (const commit of commit_range.commit_list) {
|
|
30757
30760
|
const group_from_map = commit_map[commit.sha];
|
|
30758
30761
|
commit.branch_id = group_from_map.id;
|
|
30759
30762
|
commit.title = group_from_map.title;
|
|
@@ -30761,14 +30764,14 @@ async function run$5() {
|
|
|
30761
30764
|
await GitReviseTodo.execute({
|
|
30762
30765
|
rebase_group_index: 0,
|
|
30763
30766
|
rebase_merge_base: merge_base,
|
|
30764
|
-
commit_range
|
|
30767
|
+
commit_range,
|
|
30765
30768
|
});
|
|
30766
30769
|
let DEFAULT_PR_BODY = "";
|
|
30767
30770
|
if (state.pr_template_body) {
|
|
30768
30771
|
DEFAULT_PR_BODY = state.pr_template_body;
|
|
30769
30772
|
}
|
|
30770
30773
|
const temp_branch_name = `${branch_name}_${short_id()}`;
|
|
30771
|
-
|
|
30774
|
+
commit_range = await range(commit_map);
|
|
30772
30775
|
// reverse commit list so that we can cherry-pick in order
|
|
30773
30776
|
commit_range.group_list.reverse();
|
|
30774
30777
|
let rebase_merge_base = merge_base;
|
|
@@ -31219,9 +31222,9 @@ function get_status_bold(row) {
|
|
|
31219
31222
|
}
|
|
31220
31223
|
|
|
31221
31224
|
function PostRebaseStatus() {
|
|
31222
|
-
return reactExports.createElement(Await, { fallback: null, function: run$
|
|
31225
|
+
return reactExports.createElement(Await, { fallback: null, function: run$5 });
|
|
31223
31226
|
}
|
|
31224
|
-
async function run$
|
|
31227
|
+
async function run$5() {
|
|
31225
31228
|
const actions = Store.getState().actions;
|
|
31226
31229
|
// reset github pr cache before refreshing via commit range below
|
|
31227
31230
|
actions.reset_pr();
|
|
@@ -31251,9 +31254,9 @@ function PreLocalMergeRebase() {
|
|
|
31251
31254
|
}
|
|
31252
31255
|
|
|
31253
31256
|
function PreManualRebase() {
|
|
31254
|
-
return reactExports.createElement(Await, { fallback: null, function: run$
|
|
31257
|
+
return reactExports.createElement(Await, { fallback: null, function: run$4 });
|
|
31255
31258
|
}
|
|
31256
|
-
async function run$
|
|
31259
|
+
async function run$4() {
|
|
31257
31260
|
const state = Store.getState();
|
|
31258
31261
|
const actions = state.actions;
|
|
31259
31262
|
const repo_root = state.repo_root;
|
|
@@ -31762,9 +31765,9 @@ const SYMBOL = {
|
|
|
31762
31765
|
};
|
|
31763
31766
|
|
|
31764
31767
|
function Status() {
|
|
31765
|
-
return reactExports.createElement(Await, { fallback: null, function: run$
|
|
31768
|
+
return reactExports.createElement(Await, { fallback: null, function: run$3 });
|
|
31766
31769
|
}
|
|
31767
|
-
async function run$
|
|
31770
|
+
async function run$3() {
|
|
31768
31771
|
const state = Store.getState();
|
|
31769
31772
|
const actions = state.actions;
|
|
31770
31773
|
const argv = state.argv;
|
|
@@ -31907,6 +31910,30 @@ function RebaseCheck(props) {
|
|
|
31907
31910
|
}
|
|
31908
31911
|
}
|
|
31909
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(`git config --list --show-origin`);
|
|
31921
|
+
await cli(`echo HOME=$HOME`);
|
|
31922
|
+
await cli(`echo USER=$USER`);
|
|
31923
|
+
await cli(`echo GIT_AUTHOR_NAME=$GIT_AUTHOR_NAME`);
|
|
31924
|
+
await cli(`echo GIT_AUTHOR_EMAIL=$GIT_AUTHOR_EMAIL`);
|
|
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
|
+
|
|
31910
31937
|
function Fixup() {
|
|
31911
31938
|
return reactExports.createElement(Await, { fallback: null, function: run$1 });
|
|
31912
31939
|
}
|
|
@@ -32047,10 +32074,11 @@ function App() {
|
|
|
32047
32074
|
actions.exit(0);
|
|
32048
32075
|
}
|
|
32049
32076
|
} },
|
|
32050
|
-
reactExports.createElement(
|
|
32051
|
-
reactExports.createElement(
|
|
32052
|
-
reactExports.createElement(
|
|
32053
|
-
reactExports.createElement(
|
|
32077
|
+
reactExports.createElement(VerboseDebugInfo, null,
|
|
32078
|
+
reactExports.createElement(DependencyCheck, null,
|
|
32079
|
+
reactExports.createElement(RebaseCheck, null,
|
|
32080
|
+
reactExports.createElement(CherryPickCheck, null,
|
|
32081
|
+
reactExports.createElement(MaybeMain, null))))))));
|
|
32054
32082
|
}
|
|
32055
32083
|
function MaybeMain() {
|
|
32056
32084
|
const argv = Store.useState((state) => state.argv);
|
|
@@ -37392,7 +37420,7 @@ async function command() {
|
|
|
37392
37420
|
.wrap(123)
|
|
37393
37421
|
// disallow unknown options
|
|
37394
37422
|
.strict()
|
|
37395
|
-
.version("1.11.
|
|
37423
|
+
.version("1.11.6" )
|
|
37396
37424
|
.showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`")
|
|
37397
37425
|
.help("help", "Show usage via `git stack help`")
|
|
37398
37426
|
.argv;
|
package/package.json
CHANGED
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
|
-
<
|
|
58
|
-
<
|
|
59
|
-
<
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
);
|
package/src/app/ManualRebase.tsx
CHANGED
|
@@ -3,7 +3,6 @@ import * as React from "react";
|
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
|
|
5
5
|
import * as Ink from "ink-cjs";
|
|
6
|
-
import cloneDeep from "lodash/cloneDeep";
|
|
7
6
|
|
|
8
7
|
import { Await } from "~/app/Await";
|
|
9
8
|
import { Brackets } from "~/app/Brackets";
|
|
@@ -33,14 +32,12 @@ async function run() {
|
|
|
33
32
|
const actions = state.actions;
|
|
34
33
|
const argv = state.argv;
|
|
35
34
|
const branch_name = state.branch_name;
|
|
36
|
-
const original_commit_range = cloneDeep(state.commit_range);
|
|
37
35
|
const commit_map = state.commit_map;
|
|
38
36
|
const master_branch = state.master_branch;
|
|
39
37
|
const cwd = state.cwd;
|
|
40
38
|
const repo_root = state.repo_root;
|
|
41
39
|
|
|
42
40
|
invariant(branch_name, "branch_name must exist");
|
|
43
|
-
invariant(original_commit_range, "original_commit_range must exist");
|
|
44
41
|
invariant(commit_map, "commit_map must exist");
|
|
45
42
|
invariant(repo_root, "repo_root must exist");
|
|
46
43
|
|
|
@@ -51,8 +48,12 @@ async function run() {
|
|
|
51
48
|
const merge_base = (await cli(`git merge-base HEAD ${master_branch}`)).stdout;
|
|
52
49
|
|
|
53
50
|
// immediately paint all commit to preserve selected commit ranges
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
let commit_range = await CommitMetadata.range(commit_map);
|
|
52
|
+
|
|
53
|
+
// reverse group list to ensure we create git revise in correct order
|
|
54
|
+
commit_range.group_list.reverse();
|
|
55
|
+
|
|
56
|
+
for (const commit of commit_range.commit_list) {
|
|
56
57
|
const group_from_map = commit_map[commit.sha];
|
|
57
58
|
commit.branch_id = group_from_map.id;
|
|
58
59
|
commit.title = group_from_map.title;
|
|
@@ -61,7 +62,7 @@ async function run() {
|
|
|
61
62
|
await GitReviseTodo.execute({
|
|
62
63
|
rebase_group_index: 0,
|
|
63
64
|
rebase_merge_base: merge_base,
|
|
64
|
-
commit_range
|
|
65
|
+
commit_range,
|
|
65
66
|
});
|
|
66
67
|
|
|
67
68
|
let DEFAULT_PR_BODY = "";
|
|
@@ -71,7 +72,7 @@ async function run() {
|
|
|
71
72
|
|
|
72
73
|
const temp_branch_name = `${branch_name}_${short_id()}`;
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
commit_range = await CommitMetadata.range(commit_map);
|
|
75
76
|
|
|
76
77
|
// reverse commit list so that we can cherry-pick in order
|
|
77
78
|
commit_range.group_list.reverse();
|
|
@@ -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(`git config --list --show-origin`);
|
|
33
|
+
await cli(`echo HOME=$HOME`);
|
|
34
|
+
await cli(`echo USER=$USER`);
|
|
35
|
+
await cli(`echo GIT_AUTHOR_NAME=$GIT_AUTHOR_NAME`);
|
|
36
|
+
await cli(`echo GIT_AUTHOR_EMAIL=$GIT_AUTHOR_EMAIL`);
|
|
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
|
+
}
|
|
@@ -136,6 +136,9 @@ GitReviseTodo.execute = async function grt_execute(args: ExecuteArgs) {
|
|
|
136
136
|
`revise --edit -i ${args.rebase_merge_base}`,
|
|
137
137
|
];
|
|
138
138
|
|
|
139
|
+
// ignore here is important to prevent scrollback clear
|
|
140
|
+
// change to pipe to see output temporarily
|
|
141
|
+
// https://github.com/magus/git-stack-cli/commit/f9f10e3ac3cd9a35ee75d3e0851a48391967a23f
|
|
139
142
|
await cli(command, { stdio: ["ignore", "ignore", "ignore"] });
|
|
140
143
|
};
|
|
141
144
|
|