git-stack-cli 2.1.5 → 2.2.1
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/js/index.js +10 -8
- package/package.json +1 -1
- package/src/app/DetectInitialPR.tsx +1 -1
- package/src/app/GatherMetadata.tsx +8 -4
- package/src/app/Store.tsx +1 -1
- package/src/command.ts +1 -1
- package/src/commands/Rebase.tsx +3 -2
package/dist/js/index.js
CHANGED
|
@@ -37042,7 +37042,7 @@ var BaseStore = createStore()(immer2((set2, get) => ({
|
|
|
37042
37042
|
username: null,
|
|
37043
37043
|
repo_path: null,
|
|
37044
37044
|
repo_root: null,
|
|
37045
|
-
master_branch: "master",
|
|
37045
|
+
master_branch: "origin/master",
|
|
37046
37046
|
head: null,
|
|
37047
37047
|
branch_name: null,
|
|
37048
37048
|
commit_range: null,
|
|
@@ -38689,7 +38689,7 @@ async function run() {
|
|
|
38689
38689
|
}));
|
|
38690
38690
|
master_branch = argv.branch;
|
|
38691
38691
|
} else {
|
|
38692
|
-
const detect_master = await cli(`git branch --list "${BRANCH.master}" --color=never`);
|
|
38692
|
+
const detect_master = await cli(`git branch --list --remote "${BRANCH.master}" --color=never`);
|
|
38693
38693
|
if (detect_master.stdout !== "") {
|
|
38694
38694
|
master_branch = BRANCH.master;
|
|
38695
38695
|
} else {
|
|
@@ -38703,13 +38703,14 @@ async function run() {
|
|
|
38703
38703
|
master_branch = BRANCH.main;
|
|
38704
38704
|
}
|
|
38705
38705
|
}
|
|
38706
|
+
actions.debug(`master_branch = ${master_branch}`);
|
|
38706
38707
|
const branch_name = (await cli("git rev-parse --abbrev-ref HEAD")).stdout;
|
|
38707
38708
|
if (branch_name === "HEAD") {
|
|
38708
38709
|
actions.error("Must run within a branch.");
|
|
38709
38710
|
actions.exit(0);
|
|
38710
38711
|
return;
|
|
38711
38712
|
}
|
|
38712
|
-
if (branch_name === master_branch) {
|
|
38713
|
+
if (`origin/${branch_name}` === master_branch) {
|
|
38713
38714
|
actions.error("Must run within a branch.");
|
|
38714
38715
|
actions.exit(0);
|
|
38715
38716
|
return;
|
|
@@ -38748,8 +38749,8 @@ var RE5 = {
|
|
|
38748
38749
|
repo_path: /(?<repo_path>[^:^/]+\/[^/]+)\.git/
|
|
38749
38750
|
};
|
|
38750
38751
|
var BRANCH = {
|
|
38751
|
-
master: "master",
|
|
38752
|
-
main: "main"
|
|
38752
|
+
master: "origin/master",
|
|
38753
|
+
main: "origin/main"
|
|
38753
38754
|
};
|
|
38754
38755
|
|
|
38755
38756
|
// src/app/GithubApiError.tsx
|
|
@@ -38955,7 +38956,8 @@ Rebase.run = async function run4() {
|
|
|
38955
38956
|
try {
|
|
38956
38957
|
process.chdir(repo_root);
|
|
38957
38958
|
await cli(`pwd`);
|
|
38958
|
-
|
|
38959
|
+
const master_branch_name = master_branch.replace(/^origin\//, "");
|
|
38960
|
+
await cli(`git fetch --no-tags -v origin ${master_branch_name}`);
|
|
38959
38961
|
const master_sha = (await cli(`git rev-parse ${master_branch}`)).stdout;
|
|
38960
38962
|
const rebase_merge_base = master_sha;
|
|
38961
38963
|
await cli(`git checkout -b ${temp_branch_name} ${rebase_merge_base}`);
|
|
@@ -45640,7 +45642,7 @@ var yargs_default = Yargs;
|
|
|
45640
45642
|
|
|
45641
45643
|
// src/command.ts
|
|
45642
45644
|
async function command2() {
|
|
45643
|
-
return yargs_default(hideBin(process.argv)).usage("Usage: git stack [command] [options]").command("$0", "Sync commit ranges to Github", (yargs) => yargs.options(DefaultOptions)).command("fixup [commit]", "Amend staged changes to a specific commit in history", (yargs) => yargs.positional("commit", FixupOptions.commit)).command("log [args...]", "Print an abbreviated log with numbered commits, useful for git stack fixup", (yargs) => yargs.strict(false)).command("rebase", "Update local branch via rebase with latest changes from origin master branch", (yargs) => yargs).option("verbose", GlobalOptions.verbose).wrap(123).strict().version("2.1
|
|
45645
|
+
return yargs_default(hideBin(process.argv)).usage("Usage: git stack [command] [options]").command("$0", "Sync commit ranges to Github", (yargs) => yargs.options(DefaultOptions)).command("fixup [commit]", "Amend staged changes to a specific commit in history", (yargs) => yargs.positional("commit", FixupOptions.commit)).command("log [args...]", "Print an abbreviated log with numbered commits, useful for git stack fixup", (yargs) => yargs.strict(false)).command("rebase", "Update local branch via rebase with latest changes from origin master branch", (yargs) => yargs).option("verbose", GlobalOptions.verbose).wrap(123).strict().version("2.2.1").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
|
|
45644
45646
|
}
|
|
45645
45647
|
var GlobalOptions = {
|
|
45646
45648
|
verbose: {
|
|
@@ -45683,7 +45685,7 @@ var DefaultOptions = {
|
|
|
45683
45685
|
branch: {
|
|
45684
45686
|
type: "string",
|
|
45685
45687
|
alias: ["b"],
|
|
45686
|
-
description: 'Set the master branch name, defaults to "master" (or "main" if "master" is not found)'
|
|
45688
|
+
description: 'Set the master branch name, defaults to "origin/master" (or "origin/main" if "origin/master" is not found)'
|
|
45687
45689
|
},
|
|
45688
45690
|
draft: {
|
|
45689
45691
|
type: "boolean",
|
package/package.json
CHANGED
|
@@ -160,7 +160,7 @@ export function DetectInitialPR(props: Props) {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
// get latest merge_base relative to
|
|
163
|
+
// get latest merge_base relative to origin/master
|
|
164
164
|
const rebase_group_index = 0;
|
|
165
165
|
|
|
166
166
|
const rebase_merge_base = (await cli(`git merge-base HEAD ${master_branch}`)).stdout;
|
|
@@ -44,7 +44,9 @@ async function run() {
|
|
|
44
44
|
|
|
45
45
|
master_branch = argv.branch;
|
|
46
46
|
} else {
|
|
47
|
-
const detect_master = await cli(
|
|
47
|
+
const detect_master = await cli(
|
|
48
|
+
`git branch --list --remote "${BRANCH.master}" --color=never`,
|
|
49
|
+
);
|
|
48
50
|
|
|
49
51
|
if (detect_master.stdout !== "") {
|
|
50
52
|
master_branch = BRANCH.master;
|
|
@@ -63,6 +65,8 @@ async function run() {
|
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
|
|
68
|
+
actions.debug(`master_branch = ${master_branch}`);
|
|
69
|
+
|
|
66
70
|
const branch_name = (await cli("git rev-parse --abbrev-ref HEAD")).stdout;
|
|
67
71
|
|
|
68
72
|
// handle detahed head state
|
|
@@ -73,7 +77,7 @@ async function run() {
|
|
|
73
77
|
}
|
|
74
78
|
|
|
75
79
|
// handle when there are no detected changes
|
|
76
|
-
if (branch_name === master_branch) {
|
|
80
|
+
if (`origin/${branch_name}` === master_branch) {
|
|
77
81
|
actions.error("Must run within a branch.");
|
|
78
82
|
actions.exit(0);
|
|
79
83
|
return;
|
|
@@ -124,6 +128,6 @@ const RE = {
|
|
|
124
128
|
};
|
|
125
129
|
|
|
126
130
|
const BRANCH = {
|
|
127
|
-
master: "master",
|
|
128
|
-
main: "main",
|
|
131
|
+
master: "origin/master",
|
|
132
|
+
main: "origin/main",
|
|
129
133
|
};
|
package/src/app/Store.tsx
CHANGED
package/src/command.ts
CHANGED
|
@@ -92,7 +92,7 @@ const DefaultOptions = {
|
|
|
92
92
|
type: "string",
|
|
93
93
|
alias: ["b"],
|
|
94
94
|
description:
|
|
95
|
-
'Set the master branch name, defaults to "master" (or "main" if "master" is not found)',
|
|
95
|
+
'Set the master branch name, defaults to "origin/master" (or "origin/main" if "origin/master" is not found)',
|
|
96
96
|
},
|
|
97
97
|
|
|
98
98
|
"draft": {
|
package/src/commands/Rebase.tsx
CHANGED
|
@@ -53,8 +53,9 @@ Rebase.run = async function run() {
|
|
|
53
53
|
process.chdir(repo_root);
|
|
54
54
|
await cli(`pwd`);
|
|
55
55
|
|
|
56
|
-
//
|
|
57
|
-
|
|
56
|
+
// fetch origin master branch for latest sha
|
|
57
|
+
const master_branch_name = master_branch.replace(/^origin\//, "");
|
|
58
|
+
await cli(`git fetch --no-tags -v origin ${master_branch_name}`);
|
|
58
59
|
|
|
59
60
|
const master_sha = (await cli(`git rev-parse ${master_branch}`)).stdout;
|
|
60
61
|
const rebase_merge_base = master_sha;
|