git-stack-cli 1.11.0 → 1.11.2
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 +44 -45
- package/package.json +1 -1
- package/src/app/DetectInitialPR.tsx +4 -0
- package/src/app/ManualRebase.tsx +0 -21
- package/src/core/GitReviseTodo.ts +6 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -30056,6 +30056,45 @@ GitReviseTodo.todo = function todo(args) {
|
|
|
30056
30056
|
GitReviseTodo.execute = async function grt_execute(args) {
|
|
30057
30057
|
// generate temporary directory and drop sequence editor script
|
|
30058
30058
|
const tmp_git_sequence_editor_path = path.join(os.tmpdir(), "git-sequence-editor.sh");
|
|
30059
|
+
// replaced at build time with literal contents of `scripts/git-sequence-editor.sh`
|
|
30060
|
+
const GIT_SEQUENCE_EDITOR_SCRIPT = `#!/bin/sh
|
|
30061
|
+
|
|
30062
|
+
# Example
|
|
30063
|
+
#
|
|
30064
|
+
# GIT_REVISE_TODO="abc" GIT_EDITOR="$(pwd)/scripts/git-sequence-editor.sh" git revise --edit -i head~4
|
|
30065
|
+
#
|
|
30066
|
+
# Note
|
|
30067
|
+
# ----------------
|
|
30068
|
+
# Use \`GIT_EDITOR\` above instead of \`GIT_SEQUENCE_EDITOR\` because \`git revise\` does not use
|
|
30069
|
+
# \`GIT_SEQUENCE_EDITOR\` when passing the \`--edit\` flag, but does work without the \`--edit\` flag
|
|
30070
|
+
#
|
|
30071
|
+
#
|
|
30072
|
+
|
|
30073
|
+
# debug print env variables
|
|
30074
|
+
echo "GIT_REVISE_TODO=$GIT_REVISE_TODO"
|
|
30075
|
+
echo "CLI=$0 $*"
|
|
30076
|
+
echo "PWD=$(pwd)"
|
|
30077
|
+
|
|
30078
|
+
# ensure \`GIT_REVISE_TODO\` is not empty
|
|
30079
|
+
if [ -z "$GIT_REVISE_TODO" ]; then
|
|
30080
|
+
echo "🚨 GIT_REVISE_TODO environment variable is empty" >&2
|
|
30081
|
+
exit 1
|
|
30082
|
+
fi
|
|
30083
|
+
|
|
30084
|
+
# first argument into git sequence editor is git-revise-todo file
|
|
30085
|
+
git_revise_todo_path="$1"
|
|
30086
|
+
|
|
30087
|
+
# debug print git-revise-todo file passed into command
|
|
30088
|
+
echo "$git_revise_todo_path"
|
|
30089
|
+
echo "----- START -----"
|
|
30090
|
+
cat "$git_revise_todo_path"
|
|
30091
|
+
echo "------ END ------"
|
|
30092
|
+
|
|
30093
|
+
# write content of \`GIT_REVISE_TODO\` env variable to \`git_revise_todo_path\`
|
|
30094
|
+
echo "$GIT_REVISE_TODO" > "$git_revise_todo_path"
|
|
30095
|
+
`;
|
|
30096
|
+
// write script to temporary path
|
|
30097
|
+
fs.writeFileSync(tmp_git_sequence_editor_path, GIT_SEQUENCE_EDITOR_SCRIPT);
|
|
30059
30098
|
// ensure script is executable
|
|
30060
30099
|
fs.chmodSync(tmp_git_sequence_editor_path, "755");
|
|
30061
30100
|
const git_revise_todo = GitReviseTodo(args);
|
|
@@ -30147,6 +30186,10 @@ function DetectInitialPR(props) {
|
|
|
30147
30186
|
for (const group of commit_range.group_list) {
|
|
30148
30187
|
group.id = branch_name;
|
|
30149
30188
|
group.title = state.pr?.title || "-";
|
|
30189
|
+
for (const commit of commit_range.commit_list) {
|
|
30190
|
+
commit.branch_id = group.id;
|
|
30191
|
+
commit.title = group.title;
|
|
30192
|
+
}
|
|
30150
30193
|
}
|
|
30151
30194
|
// get latest merge_base relative to local master
|
|
30152
30195
|
const rebase_group_index = 0;
|
|
@@ -30774,50 +30817,6 @@ async function run$5() {
|
|
|
30774
30817
|
async function rebase_git_revise() {
|
|
30775
30818
|
actions.debug(`rebase_git_revise`);
|
|
30776
30819
|
actions.output(reactExports.createElement(Text, { color: colors.yellow, wrap: "truncate-end" }, "Rebasing\u2026"));
|
|
30777
|
-
// generate temporary directory and drop sequence editor script
|
|
30778
|
-
const tmp_git_sequence_editor_path = path.join(os.tmpdir(), "git-sequence-editor.sh");
|
|
30779
|
-
actions.debug(`tmp_git_sequence_editor_path=${tmp_git_sequence_editor_path}`);
|
|
30780
|
-
// replaced at build time with literal contents of `scripts/git-sequence-editor.sh`
|
|
30781
|
-
const GIT_SEQUENCE_EDITOR_SCRIPT = `#!/bin/sh
|
|
30782
|
-
|
|
30783
|
-
# Example
|
|
30784
|
-
#
|
|
30785
|
-
# GIT_REVISE_TODO="abc" GIT_EDITOR="$(pwd)/scripts/git-sequence-editor.sh" git revise --edit -i head~4
|
|
30786
|
-
#
|
|
30787
|
-
# Note
|
|
30788
|
-
# ----------------
|
|
30789
|
-
# Use \`GIT_EDITOR\` above instead of \`GIT_SEQUENCE_EDITOR\` because \`git revise\` does not use
|
|
30790
|
-
# \`GIT_SEQUENCE_EDITOR\` when passing the \`--edit\` flag, but does work without the \`--edit\` flag
|
|
30791
|
-
#
|
|
30792
|
-
#
|
|
30793
|
-
|
|
30794
|
-
# debug print env variables
|
|
30795
|
-
echo "GIT_REVISE_TODO=$GIT_REVISE_TODO"
|
|
30796
|
-
echo "CLI=$0 $*"
|
|
30797
|
-
echo "PWD=$(pwd)"
|
|
30798
|
-
|
|
30799
|
-
# ensure \`GIT_REVISE_TODO\` is not empty
|
|
30800
|
-
if [ -z "$GIT_REVISE_TODO" ]; then
|
|
30801
|
-
echo "🚨 GIT_REVISE_TODO environment variable is empty" >&2
|
|
30802
|
-
exit 1
|
|
30803
|
-
fi
|
|
30804
|
-
|
|
30805
|
-
# first argument into git sequence editor is git-revise-todo file
|
|
30806
|
-
git_revise_todo_path="$1"
|
|
30807
|
-
|
|
30808
|
-
# debug print git-revise-todo file passed into command
|
|
30809
|
-
echo "$git_revise_todo_path"
|
|
30810
|
-
echo "----- START -----"
|
|
30811
|
-
cat "$git_revise_todo_path"
|
|
30812
|
-
echo "------ END ------"
|
|
30813
|
-
|
|
30814
|
-
# write content of \`GIT_REVISE_TODO\` env variable to \`git_revise_todo_path\`
|
|
30815
|
-
echo "$GIT_REVISE_TODO" > "$git_revise_todo_path"
|
|
30816
|
-
`;
|
|
30817
|
-
// write script to temporary path
|
|
30818
|
-
fs.writeFileSync(tmp_git_sequence_editor_path, GIT_SEQUENCE_EDITOR_SCRIPT);
|
|
30819
|
-
// ensure script is executable
|
|
30820
|
-
fs.chmodSync(tmp_git_sequence_editor_path, "755");
|
|
30821
30820
|
// create temporary branch
|
|
30822
30821
|
await cli(`git checkout -b ${temp_branch_name}`);
|
|
30823
30822
|
await GitReviseTodo.execute({
|
|
@@ -37381,7 +37380,7 @@ async function command() {
|
|
|
37381
37380
|
.wrap(123)
|
|
37382
37381
|
// disallow unknown options
|
|
37383
37382
|
.strict()
|
|
37384
|
-
.version("1.11.
|
|
37383
|
+
.version("1.11.2" )
|
|
37385
37384
|
.showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`")
|
|
37386
37385
|
.help("help", "Show usage via `git stack help`")
|
|
37387
37386
|
.argv;
|
package/package.json
CHANGED
|
@@ -157,6 +157,10 @@ export function DetectInitialPR(props: Props) {
|
|
|
157
157
|
for (const group of commit_range.group_list) {
|
|
158
158
|
group.id = branch_name;
|
|
159
159
|
group.title = state.pr?.title || "-";
|
|
160
|
+
for (const commit of commit_range.commit_list) {
|
|
161
|
+
commit.branch_id = group.id;
|
|
162
|
+
commit.title = group.title;
|
|
163
|
+
}
|
|
160
164
|
}
|
|
161
165
|
|
|
162
166
|
// get latest merge_base relative to local master
|
package/src/app/ManualRebase.tsx
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
3
|
import fs from "node:fs";
|
|
4
|
-
import os from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
6
4
|
|
|
7
5
|
import * as Ink from "ink-cjs";
|
|
8
6
|
import cloneDeep from "lodash/cloneDeep";
|
|
@@ -145,25 +143,6 @@ async function run() {
|
|
|
145
143
|
</Ink.Text>
|
|
146
144
|
);
|
|
147
145
|
|
|
148
|
-
// generate temporary directory and drop sequence editor script
|
|
149
|
-
const tmp_git_sequence_editor_path = path.join(
|
|
150
|
-
os.tmpdir(),
|
|
151
|
-
"git-sequence-editor.sh"
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
actions.debug(
|
|
155
|
-
`tmp_git_sequence_editor_path=${tmp_git_sequence_editor_path}`
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
// replaced at build time with literal contents of `scripts/git-sequence-editor.sh`
|
|
159
|
-
const GIT_SEQUENCE_EDITOR_SCRIPT = `process.env.GIT_SEQUENCE_EDITOR_SCRIPT`;
|
|
160
|
-
|
|
161
|
-
// write script to temporary path
|
|
162
|
-
fs.writeFileSync(tmp_git_sequence_editor_path, GIT_SEQUENCE_EDITOR_SCRIPT);
|
|
163
|
-
|
|
164
|
-
// ensure script is executable
|
|
165
|
-
fs.chmodSync(tmp_git_sequence_editor_path, "755");
|
|
166
|
-
|
|
167
146
|
// create temporary branch
|
|
168
147
|
await cli(`git checkout -b ${temp_branch_name}`);
|
|
169
148
|
|
|
@@ -116,6 +116,12 @@ GitReviseTodo.execute = async function grt_execute(args: ExecuteArgs) {
|
|
|
116
116
|
"git-sequence-editor.sh"
|
|
117
117
|
);
|
|
118
118
|
|
|
119
|
+
// replaced at build time with literal contents of `scripts/git-sequence-editor.sh`
|
|
120
|
+
const GIT_SEQUENCE_EDITOR_SCRIPT = `process.env.GIT_SEQUENCE_EDITOR_SCRIPT`;
|
|
121
|
+
|
|
122
|
+
// write script to temporary path
|
|
123
|
+
fs.writeFileSync(tmp_git_sequence_editor_path, GIT_SEQUENCE_EDITOR_SCRIPT);
|
|
124
|
+
|
|
119
125
|
// ensure script is executable
|
|
120
126
|
fs.chmodSync(tmp_git_sequence_editor_path, "755");
|
|
121
127
|
|