git-stack-cli 2.5.3 → 2.6.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.
- package/dist/js/index.js +201 -106
- package/package.json +2 -2
- package/src/app/ManualRebase.tsx +5 -0
- package/src/app/MultiSelect.tsx +7 -4
- package/src/app/SelectCommitRanges.tsx +232 -117
- package/src/app/SyncGithub.tsx +9 -4
- package/src/app/TextInput.tsx +8 -1
- package/src/core/CommitMetadata.ts +6 -5
- package/src/core/GitReviseTodo.test.ts +195 -0
- package/src/core/GitReviseTodo.ts +20 -17
package/dist/js/index.js
CHANGED
|
@@ -37445,7 +37445,7 @@ function AutoUpdate(props) {
|
|
|
37445
37445
|
let status2 = "done";
|
|
37446
37446
|
let latest_version = null;
|
|
37447
37447
|
let is_brew_bun_standalone = false;
|
|
37448
|
-
const local_version = "2.
|
|
37448
|
+
const local_version = "2.6.0";
|
|
37449
37449
|
const is_output = props_ref.current.verbose || props_ref.current.force;
|
|
37450
37450
|
async function auto_update() {
|
|
37451
37451
|
if (!local_version) {
|
|
@@ -38409,15 +38409,19 @@ function GitReviseTodo(args) {
|
|
|
38409
38409
|
GitReviseTodo.todo = function todo(args) {
|
|
38410
38410
|
const entry_list = [];
|
|
38411
38411
|
for (const commit2 of args.commit_list) {
|
|
38412
|
-
const id = commit2.branch_id;
|
|
38413
|
-
const title = commit2.title;
|
|
38414
|
-
invariant(id, "commit.branch_id must exist");
|
|
38415
|
-
invariant(title, "commit.title must exist");
|
|
38416
|
-
const metadata = { id, title };
|
|
38417
|
-
const unsafe_message_with_id = write(commit2.full_message, metadata);
|
|
38418
|
-
let message_with_id = unsafe_message_with_id;
|
|
38419
38412
|
const sha = commit2.sha.slice(0, 12);
|
|
38420
|
-
const entry_lines = [`++ pick ${sha}
|
|
38413
|
+
const entry_lines = [`++ pick ${sha}`];
|
|
38414
|
+
const id = commit2.branch_id;
|
|
38415
|
+
if (id == null || id === UNASSIGNED) {
|
|
38416
|
+
entry_lines.push(commit2.full_message);
|
|
38417
|
+
} else {
|
|
38418
|
+
const title = commit2.title;
|
|
38419
|
+
invariant(title, "commit.title must exist");
|
|
38420
|
+
const metadata = { id, title };
|
|
38421
|
+
const unsafe_message_with_id = write(commit2.full_message, metadata);
|
|
38422
|
+
const message_with_id = unsafe_message_with_id;
|
|
38423
|
+
entry_lines.push(message_with_id);
|
|
38424
|
+
}
|
|
38421
38425
|
const entry = entry_lines.join(`
|
|
38422
38426
|
`);
|
|
38423
38427
|
entry_list.push(entry);
|
|
@@ -39667,17 +39671,18 @@ function MultiSelect(props) {
|
|
|
39667
39671
|
let last_enabled;
|
|
39668
39672
|
for (let i2 = props.items.length - 1;i2 >= 0; i2--) {
|
|
39669
39673
|
const item = props.items[i2];
|
|
39670
|
-
if (
|
|
39671
|
-
|
|
39674
|
+
if (item.disabled) {
|
|
39675
|
+
continue;
|
|
39672
39676
|
}
|
|
39673
|
-
|
|
39677
|
+
last_enabled = i2;
|
|
39678
|
+
if (!item.selected) {
|
|
39674
39679
|
return i2;
|
|
39675
39680
|
}
|
|
39676
39681
|
}
|
|
39677
39682
|
if (is_finite_value(last_enabled)) {
|
|
39678
39683
|
return last_enabled;
|
|
39679
39684
|
}
|
|
39680
|
-
return 0;
|
|
39685
|
+
return props.startIndex || 0;
|
|
39681
39686
|
});
|
|
39682
39687
|
const selectRef = React41.useRef(false);
|
|
39683
39688
|
React41.useEffect(() => {
|
|
@@ -39825,7 +39830,13 @@ function TextInput(props) {
|
|
|
39825
39830
|
}, []);
|
|
39826
39831
|
use_input_default((input, key) => {
|
|
39827
39832
|
let next_value = value;
|
|
39828
|
-
if (key.
|
|
39833
|
+
if (key.escape) {
|
|
39834
|
+
if (value === "") {
|
|
39835
|
+
props.onCancel?.();
|
|
39836
|
+
} else {
|
|
39837
|
+
next_value = "";
|
|
39838
|
+
}
|
|
39839
|
+
} else if (key.backspace || key.delete) {
|
|
39829
39840
|
next_value = value.slice(0, -1);
|
|
39830
39841
|
} else if (key.return) {
|
|
39831
39842
|
props.onSubmit?.(next_value);
|
|
@@ -39898,9 +39909,12 @@ function SelectCommitRangesInternal(props) {
|
|
|
39898
39909
|
});
|
|
39899
39910
|
const group_list = [];
|
|
39900
39911
|
let unassigned_count = 0;
|
|
39912
|
+
let assigned_count = 0;
|
|
39901
39913
|
for (const [, group_id] of commit_map.entries()) {
|
|
39902
39914
|
if (group_id === null) {
|
|
39903
39915
|
unassigned_count++;
|
|
39916
|
+
} else {
|
|
39917
|
+
assigned_count++;
|
|
39904
39918
|
}
|
|
39905
39919
|
}
|
|
39906
39920
|
const total_group_count = new_group_list.length + props.commit_range.group_list.length;
|
|
@@ -39928,29 +39942,37 @@ function SelectCommitRangesInternal(props) {
|
|
|
39928
39942
|
if (current_index === -1) {
|
|
39929
39943
|
current_index = 0;
|
|
39930
39944
|
}
|
|
39945
|
+
const has_unassigned_commits = unassigned_count > 0;
|
|
39946
|
+
const has_assigned_commits = assigned_count > 0;
|
|
39947
|
+
const sync_status = detect_sync_status();
|
|
39931
39948
|
use_input_default((input, key) => {
|
|
39932
|
-
const
|
|
39933
|
-
|
|
39934
|
-
|
|
39949
|
+
const input_lower = input.toLowerCase();
|
|
39950
|
+
if (input_lower === SYMBOL.s) {
|
|
39951
|
+
if (group_input) {
|
|
39952
|
+
return;
|
|
39953
|
+
}
|
|
39954
|
+
if (sync_status === "disabled") {
|
|
39955
|
+
return;
|
|
39956
|
+
}
|
|
39935
39957
|
actions.set((state) => {
|
|
39936
|
-
|
|
39937
|
-
for (
|
|
39938
|
-
if (id) {
|
|
39939
|
-
|
|
39940
|
-
|
|
39941
|
-
|
|
39942
|
-
|
|
39958
|
+
const state_commit_map = {};
|
|
39959
|
+
for (let [sha, id] of commit_map.entries()) {
|
|
39960
|
+
if (!id) {
|
|
39961
|
+
id = props.commit_range.UNASSIGNED;
|
|
39962
|
+
const title = "allow_unassigned";
|
|
39963
|
+
state_commit_map[sha] = { id, title };
|
|
39964
|
+
continue;
|
|
39943
39965
|
}
|
|
39966
|
+
const group2 = group_list.find((g2) => g2.id === id);
|
|
39967
|
+
invariant(group2, "group must exist");
|
|
39968
|
+
state_commit_map[sha] = group2;
|
|
39944
39969
|
}
|
|
39945
|
-
|
|
39946
|
-
|
|
39947
|
-
state.step = "pre-manual-rebase";
|
|
39948
|
-
break;
|
|
39949
|
-
}
|
|
39970
|
+
state.commit_map = state_commit_map;
|
|
39971
|
+
state.step = "pre-manual-rebase";
|
|
39950
39972
|
});
|
|
39951
39973
|
return;
|
|
39952
39974
|
}
|
|
39953
|
-
if (
|
|
39975
|
+
if (has_unassigned_commits && input_lower === SYMBOL.c) {
|
|
39954
39976
|
set_group_input(true);
|
|
39955
39977
|
return;
|
|
39956
39978
|
}
|
|
@@ -39968,12 +39990,17 @@ function SelectCommitRangesInternal(props) {
|
|
|
39968
39990
|
const group = group_list[current_index];
|
|
39969
39991
|
const multiselect_disabled = group_input;
|
|
39970
39992
|
const multiselect_disableSelect = group.id === props.commit_range.UNASSIGNED;
|
|
39993
|
+
const max_width = 80;
|
|
39994
|
+
const [focused, set_focused] = React43.useState("");
|
|
39995
|
+
const has_groups = group.id !== props.commit_range.UNASSIGNED;
|
|
39971
39996
|
const items = props.commit_range.commit_list.map((commit2) => {
|
|
39972
39997
|
const commit_metadata_id = commit_map.get(commit2.sha);
|
|
39973
39998
|
const selected = commit_metadata_id !== null;
|
|
39974
39999
|
let disabled;
|
|
39975
40000
|
if (group_input) {
|
|
39976
40001
|
disabled = true;
|
|
40002
|
+
} else if (!has_groups) {
|
|
40003
|
+
disabled = true;
|
|
39977
40004
|
} else {
|
|
39978
40005
|
disabled = Boolean(selected && commit_metadata_id !== group.id);
|
|
39979
40006
|
}
|
|
@@ -39985,24 +40012,84 @@ function SelectCommitRangesInternal(props) {
|
|
|
39985
40012
|
};
|
|
39986
40013
|
});
|
|
39987
40014
|
items.reverse();
|
|
39988
|
-
const left_arrow = `${SYMBOL.left} `;
|
|
39989
|
-
const right_arrow = ` ${SYMBOL.right}`;
|
|
39990
|
-
const group_position = `(${current_index + 1}/${group_list.length}) `;
|
|
39991
|
-
const max_group_label_width = 80;
|
|
39992
|
-
let group_title_width = max_group_label_width;
|
|
39993
|
-
group_title_width -= group_position.length;
|
|
39994
|
-
group_title_width -= left_arrow.length + right_arrow.length;
|
|
39995
|
-
group_title_width = Math.min(group.title.length, group_title_width);
|
|
39996
|
-
let max_item_width = max_group_label_width;
|
|
39997
|
-
max_item_width -= left_arrow.length + right_arrow.length;
|
|
39998
|
-
const [focused, set_focused] = React43.useState("");
|
|
39999
40015
|
return /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40000
40016
|
flexDirection: "column"
|
|
40001
40017
|
}, /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40002
40018
|
height: 1
|
|
40019
|
+
}), has_groups || group_input ? null : /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40020
|
+
flexDirection: "column"
|
|
40021
|
+
}, /* @__PURE__ */ React43.createElement(Text, {
|
|
40022
|
+
bold: true,
|
|
40023
|
+
color: colors.blue
|
|
40024
|
+
}, "\uD83D\uDC4B Welcome to ", /* @__PURE__ */ React43.createElement(Command, null, "git stack"), "!"), /* @__PURE__ */ React43.createElement(Text, {
|
|
40025
|
+
color: colors.blue
|
|
40026
|
+
}, /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40027
|
+
message: "Press {c} to {create} a new PR group",
|
|
40028
|
+
values: {
|
|
40029
|
+
c: /* @__PURE__ */ React43.createElement(Text, {
|
|
40030
|
+
bold: true,
|
|
40031
|
+
color: colors.green
|
|
40032
|
+
}, "c"),
|
|
40033
|
+
create: /* @__PURE__ */ React43.createElement(Text, {
|
|
40034
|
+
bold: true,
|
|
40035
|
+
color: colors.green
|
|
40036
|
+
}, /* @__PURE__ */ React43.createElement(Parens, null, "c"), "reate")
|
|
40037
|
+
}
|
|
40038
|
+
}))), !has_groups || group_input ? null : /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40039
|
+
width: max_width,
|
|
40040
|
+
flexDirection: "row"
|
|
40041
|
+
}, /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40042
|
+
flexDirection: "row"
|
|
40043
|
+
}, /* @__PURE__ */ React43.createElement(Text, {
|
|
40044
|
+
bold: true,
|
|
40045
|
+
color: colors.green
|
|
40046
|
+
}, SYMBOL.left), /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40047
|
+
width: 1
|
|
40048
|
+
}), /* @__PURE__ */ React43.createElement(Text, {
|
|
40049
|
+
color: colors.gray
|
|
40050
|
+
}, "Pull request"), /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40051
|
+
width: 1
|
|
40052
|
+
}), /* @__PURE__ */ React43.createElement(Text, {
|
|
40053
|
+
color: colors.gray
|
|
40054
|
+
}, `(${current_index + 1}/${group_list.length})`), /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40055
|
+
width: 1
|
|
40056
|
+
}), /* @__PURE__ */ React43.createElement(Text, {
|
|
40057
|
+
bold: true,
|
|
40058
|
+
color: colors.green
|
|
40059
|
+
}, SYMBOL.right))), /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40060
|
+
width: max_width
|
|
40061
|
+
}, /* @__PURE__ */ React43.createElement(Text, {
|
|
40062
|
+
wrap: "truncate-end",
|
|
40063
|
+
bold: true,
|
|
40064
|
+
color: colors.green
|
|
40065
|
+
}, group.title))), !group_input ? null : /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40066
|
+
height: 1
|
|
40067
|
+
}), /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40068
|
+
wrapper: /* @__PURE__ */ React43.createElement(Text, {
|
|
40069
|
+
color: colors.gray
|
|
40070
|
+
}),
|
|
40071
|
+
message: "Enter a title for the PR {note}",
|
|
40072
|
+
values: {
|
|
40073
|
+
note: /* @__PURE__ */ React43.createElement(Parens, null, /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40074
|
+
message: "press {enter} to submit",
|
|
40075
|
+
values: {
|
|
40076
|
+
enter: /* @__PURE__ */ React43.createElement(Text, {
|
|
40077
|
+
bold: true,
|
|
40078
|
+
color: colors.green
|
|
40079
|
+
}, SYMBOL.enter)
|
|
40080
|
+
}
|
|
40081
|
+
}))
|
|
40082
|
+
}
|
|
40083
|
+
}), /* @__PURE__ */ React43.createElement(TextInput, {
|
|
40084
|
+
defaultValue: focused,
|
|
40085
|
+
onSubmit: submit_group_input,
|
|
40086
|
+
onCancel: () => set_group_input(false)
|
|
40087
|
+
})), /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40088
|
+
height: 1
|
|
40003
40089
|
}), /* @__PURE__ */ React43.createElement(MultiSelect, {
|
|
40090
|
+
startIndex: items.length - 1,
|
|
40004
40091
|
items,
|
|
40005
|
-
maxWidth:
|
|
40092
|
+
maxWidth: max_width,
|
|
40006
40093
|
disabled: multiselect_disabled,
|
|
40007
40094
|
disableSelect: multiselect_disableSelect,
|
|
40008
40095
|
onFocus: (args) => {
|
|
@@ -40020,26 +40107,23 @@ function SelectCommitRangesInternal(props) {
|
|
|
40020
40107
|
}
|
|
40021
40108
|
}), /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40022
40109
|
height: 1
|
|
40023
|
-
}), /* @__PURE__ */ React43.createElement(
|
|
40024
|
-
width: max_group_label_width,
|
|
40025
|
-
flexDirection: "row"
|
|
40026
|
-
}, /* @__PURE__ */ React43.createElement(Text, null, left_arrow), /* @__PURE__ */ React43.createElement(Text, null, group_position), /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40027
|
-
width: group_title_width,
|
|
40028
|
-
justifyContent: "center"
|
|
40029
|
-
}, /* @__PURE__ */ React43.createElement(Text, {
|
|
40030
|
-
wrap: "truncate-end"
|
|
40031
|
-
}, group.title)), /* @__PURE__ */ React43.createElement(Text, null, right_arrow)), /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40032
|
-
height: 1
|
|
40033
|
-
}), unassigned_count > 0 ? /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40110
|
+
}), has_unassigned_commits ? /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40034
40111
|
wrapper: /* @__PURE__ */ React43.createElement(Text, {
|
|
40035
40112
|
color: colors.gray
|
|
40036
40113
|
}),
|
|
40037
|
-
message: "{count} unassigned commits
|
|
40114
|
+
message: "{count} unassigned commits",
|
|
40038
40115
|
values: {
|
|
40039
40116
|
count: /* @__PURE__ */ React43.createElement(Text, {
|
|
40040
40117
|
color: colors.yellow,
|
|
40041
40118
|
bold: true
|
|
40042
|
-
}, unassigned_count)
|
|
40119
|
+
}, unassigned_count)
|
|
40120
|
+
}
|
|
40121
|
+
}), group_input ? null : /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40122
|
+
wrapper: /* @__PURE__ */ React43.createElement(Text, {
|
|
40123
|
+
color: colors.gray
|
|
40124
|
+
}),
|
|
40125
|
+
message: "Press {c} to {create} a new PR group",
|
|
40126
|
+
values: {
|
|
40043
40127
|
c: /* @__PURE__ */ React43.createElement(Text, {
|
|
40044
40128
|
bold: true,
|
|
40045
40129
|
color: colors.green
|
|
@@ -40049,55 +40133,26 @@ function SelectCommitRangesInternal(props) {
|
|
|
40049
40133
|
color: colors.green
|
|
40050
40134
|
}, /* @__PURE__ */ React43.createElement(Parens, null, "c"), "reate")
|
|
40051
40135
|
}
|
|
40052
|
-
})
|
|
40053
|
-
wrapper: /* @__PURE__ */ React43.createElement(Text, null),
|
|
40054
|
-
message: "\uD83C\uDF89 Done! Press {s} to {sync} the commits to Github",
|
|
40055
|
-
values: {
|
|
40056
|
-
s: /* @__PURE__ */ React43.createElement(Text, {
|
|
40057
|
-
bold: true,
|
|
40058
|
-
color: colors.green
|
|
40059
|
-
}, "s"),
|
|
40060
|
-
sync: /* @__PURE__ */ React43.createElement(Text, {
|
|
40061
|
-
bold: true,
|
|
40062
|
-
color: colors.green
|
|
40063
|
-
}, /* @__PURE__ */ React43.createElement(Parens, null, "s"), "ync")
|
|
40064
|
-
}
|
|
40065
|
-
}) : /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40066
|
-
wrapper: /* @__PURE__ */ React43.createElement(Text, null),
|
|
40067
|
-
message: "\uD83C\uDF89 Done! Press {s} to {save} the commits locally",
|
|
40068
|
-
values: {
|
|
40069
|
-
s: /* @__PURE__ */ React43.createElement(Text, {
|
|
40070
|
-
bold: true,
|
|
40071
|
-
color: colors.green
|
|
40072
|
-
}, "s"),
|
|
40073
|
-
save: /* @__PURE__ */ React43.createElement(Text, {
|
|
40074
|
-
bold: true,
|
|
40075
|
-
color: colors.green
|
|
40076
|
-
}, /* @__PURE__ */ React43.createElement(Parens, null, "s"), "save")
|
|
40077
|
-
}
|
|
40078
|
-
})), !group_input ? null : /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(Box_default, {
|
|
40079
|
-
height: 1
|
|
40080
|
-
}), /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40136
|
+
}), sync_status !== "allow_unassigned" ? null : /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40081
40137
|
wrapper: /* @__PURE__ */ React43.createElement(Text, {
|
|
40082
40138
|
color: colors.gray
|
|
40083
40139
|
}),
|
|
40084
|
-
message: "
|
|
40140
|
+
message: "Press {s} to {sync} the {count} assigned commits to Github",
|
|
40085
40141
|
values: {
|
|
40086
|
-
|
|
40087
|
-
|
|
40088
|
-
|
|
40089
|
-
|
|
40090
|
-
|
|
40091
|
-
color: colors.green
|
|
40092
|
-
}, SYMBOL.enter)
|
|
40093
|
-
}
|
|
40094
|
-
}))
|
|
40142
|
+
...S_TO_SYNC_VALUES,
|
|
40143
|
+
count: /* @__PURE__ */ React43.createElement(Text, {
|
|
40144
|
+
color: colors.yellow,
|
|
40145
|
+
bold: true
|
|
40146
|
+
}, assigned_count)
|
|
40095
40147
|
}
|
|
40096
|
-
}), /* @__PURE__ */ React43.createElement(
|
|
40097
|
-
|
|
40098
|
-
|
|
40099
|
-
|
|
40100
|
-
|
|
40148
|
+
})) : /* @__PURE__ */ React43.createElement(React43.Fragment, null, argv.sync ? /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40149
|
+
wrapper: /* @__PURE__ */ React43.createElement(Text, null),
|
|
40150
|
+
message: "\uD83C\uDF89 Done! Press {s} to {sync} the commits to Github",
|
|
40151
|
+
values: S_TO_SYNC_VALUES
|
|
40152
|
+
}) : /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40153
|
+
wrapper: /* @__PURE__ */ React43.createElement(Text, null),
|
|
40154
|
+
message: "\uD83C\uDF89 Done! Press {s} to {save} the commits locally",
|
|
40155
|
+
values: S_TO_SYNC_VALUES
|
|
40101
40156
|
})), /* @__PURE__ */ React43.createElement(Box_default, null, /* @__PURE__ */ React43.createElement(FormatText, {
|
|
40102
40157
|
wrapper: /* @__PURE__ */ React43.createElement(Text, {
|
|
40103
40158
|
color: colors.gray
|
|
@@ -40140,7 +40195,7 @@ function SelectCommitRangesInternal(props) {
|
|
|
40140
40195
|
wrapper: /* @__PURE__ */ React43.createElement(Text, {
|
|
40141
40196
|
dimColor: true
|
|
40142
40197
|
}),
|
|
40143
|
-
message: "Created new group {group} {note}",
|
|
40198
|
+
message: "Created new PR group {group} {note}",
|
|
40144
40199
|
values: {
|
|
40145
40200
|
group: /* @__PURE__ */ React43.createElement(Brackets, null, title),
|
|
40146
40201
|
note: /* @__PURE__ */ React43.createElement(Parens, null, id)
|
|
@@ -40150,11 +40205,49 @@ function SelectCommitRangesInternal(props) {
|
|
|
40150
40205
|
set_selected_group_id(id);
|
|
40151
40206
|
set_group_input(false);
|
|
40152
40207
|
}
|
|
40208
|
+
function detect_sync_status() {
|
|
40209
|
+
if (!has_unassigned_commits) {
|
|
40210
|
+
return "allow";
|
|
40211
|
+
}
|
|
40212
|
+
if (!has_assigned_commits) {
|
|
40213
|
+
return "disabled";
|
|
40214
|
+
}
|
|
40215
|
+
let allow_unassigned_sync = null;
|
|
40216
|
+
for (let i2 = 0;i2 < props.commit_range.commit_list.length; i2++) {
|
|
40217
|
+
const commit2 = props.commit_range.commit_list[i2];
|
|
40218
|
+
const group_id = commit_map.get(commit2.sha);
|
|
40219
|
+
if (allow_unassigned_sync === null) {
|
|
40220
|
+
if (group_id === null) {
|
|
40221
|
+
allow_unassigned_sync = true;
|
|
40222
|
+
}
|
|
40223
|
+
} else {
|
|
40224
|
+
if (group_id) {
|
|
40225
|
+
allow_unassigned_sync = false;
|
|
40226
|
+
}
|
|
40227
|
+
}
|
|
40228
|
+
}
|
|
40229
|
+
if (allow_unassigned_sync) {
|
|
40230
|
+
return "allow_unassigned";
|
|
40231
|
+
}
|
|
40232
|
+
return "disabled";
|
|
40233
|
+
}
|
|
40153
40234
|
}
|
|
40154
40235
|
var SYMBOL = {
|
|
40155
40236
|
left: "←",
|
|
40156
40237
|
right: "→",
|
|
40157
|
-
enter: "Enter"
|
|
40238
|
+
enter: "Enter",
|
|
40239
|
+
c: "c",
|
|
40240
|
+
s: "s"
|
|
40241
|
+
};
|
|
40242
|
+
var S_TO_SYNC_VALUES = {
|
|
40243
|
+
s: /* @__PURE__ */ React43.createElement(Text, {
|
|
40244
|
+
bold: true,
|
|
40245
|
+
color: colors.green
|
|
40246
|
+
}, "s"),
|
|
40247
|
+
sync: /* @__PURE__ */ React43.createElement(Text, {
|
|
40248
|
+
bold: true,
|
|
40249
|
+
color: colors.green
|
|
40250
|
+
}, /* @__PURE__ */ React43.createElement(Parens, null, "s"), "ync")
|
|
40158
40251
|
};
|
|
40159
40252
|
|
|
40160
40253
|
// src/app/SyncGithub.tsx
|
|
@@ -40307,15 +40400,15 @@ async function run9() {
|
|
|
40307
40400
|
git_push_command.push(target);
|
|
40308
40401
|
}
|
|
40309
40402
|
await cli(git_push_command);
|
|
40310
|
-
const pr_url_list =
|
|
40403
|
+
const pr_url_list = push_group_list.map(get_group_url);
|
|
40311
40404
|
const after_push_tasks = [];
|
|
40312
40405
|
for (const group of push_group_list) {
|
|
40313
40406
|
after_push_tasks.push(after_push({ group, pr_url_list }));
|
|
40314
40407
|
}
|
|
40315
40408
|
await Promise.all(after_push_tasks);
|
|
40316
40409
|
const update_pr_body_tasks = [];
|
|
40317
|
-
for (let i2 = 0;i2 <
|
|
40318
|
-
const group =
|
|
40410
|
+
for (let i2 = 0;i2 < push_group_list.length; i2++) {
|
|
40411
|
+
const group = push_group_list[i2];
|
|
40319
40412
|
const selected_url = pr_url_list[i2];
|
|
40320
40413
|
const task = update_pr_body({ group, selected_url, pr_url_list });
|
|
40321
40414
|
update_pr_body_tasks.push(task);
|
|
@@ -40343,7 +40436,9 @@ async function run9() {
|
|
|
40343
40436
|
break;
|
|
40344
40437
|
}
|
|
40345
40438
|
const group = commit_range.group_list[index];
|
|
40346
|
-
|
|
40439
|
+
if (group.id !== commit_range.UNASSIGNED) {
|
|
40440
|
+
push_group_list2.unshift(group);
|
|
40441
|
+
}
|
|
40347
40442
|
}
|
|
40348
40443
|
return push_group_list2;
|
|
40349
40444
|
}
|
|
@@ -45675,7 +45770,7 @@ var yargs_default = Yargs;
|
|
|
45675
45770
|
|
|
45676
45771
|
// src/command.ts
|
|
45677
45772
|
async function command2() {
|
|
45678
|
-
return yargs_default(hideBin(process.argv)).scriptName("git stack").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).command(["update", "upgrade"], "Check and install the latest version of git stack", (yargs) => yargs).option("verbose", GlobalOptions.verbose).wrap(123).strict().version("2.
|
|
45773
|
+
return yargs_default(hideBin(process.argv)).scriptName("git stack").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).command(["update", "upgrade"], "Check and install the latest version of git stack", (yargs) => yargs).option("verbose", GlobalOptions.verbose).wrap(123).strict().version("2.6.0").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
|
|
45679
45774
|
}
|
|
45680
45775
|
var GlobalOptions = {
|
|
45681
45776
|
verbose: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-stack-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "magus",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"test": "bun test",
|
|
37
37
|
"test:watch": "pnpm run test --watch",
|
|
38
38
|
"test:types": "tsc",
|
|
39
|
-
"test:all": "pnpm run prettier:check && pnpm run lint:check && pnpm run test:types",
|
|
39
|
+
"test:all": "pnpm run prettier:check && pnpm run lint:check && pnpm run test:types && pnpm run test",
|
|
40
40
|
"prepublishOnly": "bun run scripts/npm-prepublishOnly.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
package/src/app/ManualRebase.tsx
CHANGED
|
@@ -59,6 +59,11 @@ async function run() {
|
|
|
59
59
|
commit.title = group_from_map.title;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
// // capture commit_range for GitReviseTodo test
|
|
63
|
+
// // doc-link capture-git-revise-todo
|
|
64
|
+
// console.debug(JSON.stringify(commit_range, null, 2));
|
|
65
|
+
// throw new Error("STOP");
|
|
66
|
+
|
|
62
67
|
await GitReviseTodo.execute({
|
|
63
68
|
rebase_group_index: 0,
|
|
64
69
|
rebase_merge_base: merge_base,
|
package/src/app/MultiSelect.tsx
CHANGED
|
@@ -14,6 +14,7 @@ type Props<T> = {
|
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
disableSelect?: boolean;
|
|
16
16
|
maxWidth?: number;
|
|
17
|
+
startIndex?: number;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
type Item<T> = {
|
|
@@ -67,11 +68,13 @@ export function MultiSelect<T>(props: Props<T>) {
|
|
|
67
68
|
for (let i = props.items.length - 1; i >= 0; i--) {
|
|
68
69
|
const item = props.items[i];
|
|
69
70
|
|
|
70
|
-
if (
|
|
71
|
-
|
|
71
|
+
if (item.disabled) {
|
|
72
|
+
continue;
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
last_enabled = i;
|
|
76
|
+
|
|
77
|
+
if (!item.selected) {
|
|
75
78
|
return i;
|
|
76
79
|
}
|
|
77
80
|
}
|
|
@@ -80,7 +83,7 @@ export function MultiSelect<T>(props: Props<T>) {
|
|
|
80
83
|
return last_enabled;
|
|
81
84
|
}
|
|
82
85
|
|
|
83
|
-
return 0;
|
|
86
|
+
return props.startIndex || 0;
|
|
84
87
|
},
|
|
85
88
|
);
|
|
86
89
|
|