git-stack-cli 1.2.5 → 1.2.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/README.md CHANGED
@@ -80,9 +80,11 @@ Managing even a few stacked diffs requires a relatively strong knowledge of `git
80
80
  git submodule update --init --recursive
81
81
  npm i
82
82
  npm run dev
83
+ npm unlink git-stack-cli
83
84
  npm link
84
85
 
85
86
  # navigate to project to test within
87
+ npm unlink git-stack-cli
86
88
  npm link git-stack-cli
87
89
 
88
90
  git stack --verbose
@@ -98,7 +100,7 @@ npm run build:standalone
98
100
 
99
101
  > [!IMPORTANT]
100
102
  >
101
- > **You must update the `version` in `package.json` and commit all changes first!**
103
+ > **You must update the `version` in `package.json` before running `npm run release`**
102
104
 
103
105
  ```bash
104
106
  npm run release
@@ -26205,7 +26205,6 @@ const BaseStore = createStore()(immer((set, get) => ({
26205
26205
  repo_root: null,
26206
26206
  master_branch: "master",
26207
26207
  head: null,
26208
- merge_base: null,
26209
26208
  branch_name: null,
26210
26209
  commit_range: null,
26211
26210
  commit_map: null,
@@ -27048,7 +27047,6 @@ async function gather_metadata$1() {
27048
27047
  state.repo_root = repo_root;
27049
27048
  state.master_branch = master_branch;
27050
27049
  state.head = head;
27051
- state.merge_base = merge_base;
27052
27050
  state.branch_name = branch_name;
27053
27051
  });
27054
27052
  }
@@ -27551,9 +27549,11 @@ async function run$3() {
27551
27549
  process.once("SIGINT", handle_exit);
27552
27550
  const temp_branch_name = `${branch_name}_${short_id()}`;
27553
27551
  try {
27552
+ actions.debug(`commit_range=${JSON.stringify(commit_range, null, 2)}`);
27554
27553
  // must perform rebase from repo root for applying git patch
27555
27554
  process.chdir(repo_root);
27556
27555
  await cli(`pwd`);
27556
+ // update local master to match remote
27557
27557
  await cli(`git fetch --no-tags -v origin ${master_branch}:${master_branch}`);
27558
27558
  const master_sha = (await cli(`git rev-parse ${master_branch}`)).stdout;
27559
27559
  const rebase_merge_base = master_sha;
@@ -27832,13 +27832,12 @@ async function run$2(props) {
27832
27832
  const actions = state.actions;
27833
27833
  const argv = state.argv;
27834
27834
  const branch_name = state.branch_name;
27835
- const merge_base = state.merge_base;
27836
27835
  const commit_map = state.commit_map;
27836
+ const master_branch = state.master_branch;
27837
27837
  const cwd = state.cwd;
27838
27838
  const repo_root = state.repo_root;
27839
27839
  invariant(argv, "argv must exist");
27840
27840
  invariant(branch_name, "branch_name must exist");
27841
- invariant(merge_base, "merge_base must exist");
27842
27841
  invariant(commit_map, "commit_map must exist");
27843
27842
  invariant(cwd, "cwd must exist");
27844
27843
  invariant(repo_root, "repo_root must exist");
@@ -27848,6 +27847,8 @@ async function run$2(props) {
27848
27847
  const commit_range = await range(commit_map);
27849
27848
  // reverse commit list so that we can cherry-pick in order
27850
27849
  commit_range.group_list.reverse();
27850
+ // get latest merge_base relative to local master
27851
+ const merge_base = (await cli(`git merge-base HEAD ${master_branch}`)).stdout;
27851
27852
  let rebase_merge_base = merge_base;
27852
27853
  let rebase_group_index = 0;
27853
27854
  for (let i = 0; i < commit_range.group_list.length; i++) {
@@ -27863,8 +27864,8 @@ async function run$2(props) {
27863
27864
  }
27864
27865
  break;
27865
27866
  }
27866
- actions.debug(`rebase_merge_base=${rebase_merge_base}`);
27867
- actions.debug(`rebase_group_index=${rebase_group_index}`);
27867
+ actions.debug(`rebase_merge_base = ${rebase_merge_base}`);
27868
+ actions.debug(`rebase_group_index = ${rebase_group_index}`);
27868
27869
  actions.debug(`commit_range=${JSON.stringify(commit_range, null, 2)}`);
27869
27870
  try {
27870
27871
  // must perform rebase from repo root for applying git patch
@@ -34334,7 +34335,7 @@ async function command() {
34334
34335
  .wrap(123)
34335
34336
  // disallow unknown options
34336
34337
  .strict()
34337
- .version("1.2.5" )
34338
+ .version("1.2.6" )
34338
34339
  .showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`")
34339
34340
  .help("help", "Show usage via `git stack help`").argv);
34340
34341
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-stack-cli",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "",
5
5
  "author": "magus",
6
6
  "license": "MIT",
@@ -117,7 +117,6 @@ async function gather_metadata() {
117
117
  state.repo_root = repo_root;
118
118
  state.master_branch = master_branch;
119
119
  state.head = head;
120
- state.merge_base = merge_base;
121
120
  state.branch_name = branch_name;
122
121
  });
123
122
  } catch (err) {
@@ -47,16 +47,18 @@ async function run() {
47
47
  const temp_branch_name = `${branch_name}_${short_id()}`;
48
48
 
49
49
  try {
50
+ actions.debug(`commit_range=${JSON.stringify(commit_range, null, 2)}`);
51
+
50
52
  // must perform rebase from repo root for applying git patch
51
53
  process.chdir(repo_root);
52
54
  await cli(`pwd`);
53
55
 
56
+ // update local master to match remote
54
57
  await cli(
55
58
  `git fetch --no-tags -v origin ${master_branch}:${master_branch}`
56
59
  );
57
60
 
58
61
  const master_sha = (await cli(`git rev-parse ${master_branch}`)).stdout;
59
-
60
62
  const rebase_merge_base = master_sha;
61
63
 
62
64
  // create temporary branch based on merge base
@@ -38,14 +38,13 @@ async function run(props: Props) {
38
38
  const actions = state.actions;
39
39
  const argv = state.argv;
40
40
  const branch_name = state.branch_name;
41
- const merge_base = state.merge_base;
42
41
  const commit_map = state.commit_map;
42
+ const master_branch = state.master_branch;
43
43
  const cwd = state.cwd;
44
44
  const repo_root = state.repo_root;
45
45
 
46
46
  invariant(argv, "argv must exist");
47
47
  invariant(branch_name, "branch_name must exist");
48
- invariant(merge_base, "merge_base must exist");
49
48
  invariant(commit_map, "commit_map must exist");
50
49
  invariant(cwd, "cwd must exist");
51
50
  invariant(repo_root, "repo_root must exist");
@@ -60,6 +59,9 @@ async function run(props: Props) {
60
59
  // reverse commit list so that we can cherry-pick in order
61
60
  commit_range.group_list.reverse();
62
61
 
62
+ // get latest merge_base relative to local master
63
+ const merge_base = (await cli(`git merge-base HEAD ${master_branch}`)).stdout;
64
+
63
65
  let rebase_merge_base = merge_base;
64
66
  let rebase_group_index = 0;
65
67
 
@@ -80,8 +82,8 @@ async function run(props: Props) {
80
82
  break;
81
83
  }
82
84
 
83
- actions.debug(`rebase_merge_base=${rebase_merge_base}`);
84
- actions.debug(`rebase_group_index=${rebase_group_index}`);
85
+ actions.debug(`rebase_merge_base = ${rebase_merge_base}`);
86
+ actions.debug(`rebase_group_index = ${rebase_group_index}`);
85
87
  actions.debug(`commit_range=${JSON.stringify(commit_range, null, 2)}`);
86
88
 
87
89
  try {
package/src/app/Store.tsx CHANGED
@@ -34,7 +34,6 @@ export type State = {
34
34
  repo_root: null | string;
35
35
  master_branch: string;
36
36
  head: null | string;
37
- merge_base: null | string;
38
37
  branch_name: null | string;
39
38
  commit_range: null | CommitMetadata.CommitRange;
40
39
  commit_map: null | CommitMap;
@@ -95,7 +94,6 @@ const BaseStore = createStore<State>()(
95
94
  repo_root: null,
96
95
  master_branch: "master",
97
96
  head: null,
98
- merge_base: null,
99
97
  branch_name: null,
100
98
  commit_range: null,
101
99
  commit_map: null,