🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

git-stack-cli

Package Overview
Dependencies
Maintainers
1
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-stack-cli - npm Package Compare versions

Comparing version
0.7.0
to
0.7.1
+41
-8
dist/app/ManualRebase.js

@@ -53,5 +53,7 @@ import * as React from "react";

await cli(`git checkout -b ${temp_branch_name} ${rebase_merge_base}`);
const pr_url_list = commit_range.group_list.map(get_group_url);
for (let i = rebase_group_index; i < commit_range.group_list.length; i++) {
const group = commit_range.group_list[i];
invariant(group.base, "group.base must exist");
const selected_url = get_group_url(group);
// cherry-pick and amend commits one by one

@@ -82,4 +84,4 @@ for (const commit of group.commits) {

body: group.pr.body,
commit_range,
selected_group_id: group.id,
pr_url_list,
selected_url,
}),

@@ -94,12 +96,18 @@ });

// create pr in github
await github.pr_create({
const pr_url = await github.pr_create({
branch: group.id,
base: group.base,
title: group.title,
body: StackSummaryTable.write({
body: "",
commit_range,
selected_group_id: group.id,
}),
body: "",
});
if (!pr_url) {
throw new Error("unable to create pr");
}
// update pr_url_list with created pr_url
for (let i = 0; i < pr_url_list.length; i++) {
const url = pr_url_list[i];
if (url === selected_url) {
pr_url_list[i] = pr_url;
}
}
// move back to temp branch

@@ -110,2 +118,26 @@ await cli(`git checkout ${temp_branch_name}`);

}
// finally, ensure all prs have the updated stack table from updated pr_url_list
for (let i = 0; i < commit_range.group_list.length; i++) {
const group = commit_range.group_list[i];
// use the updated pr_url_list to get the actual selected_url
const selected_url = pr_url_list[i];
invariant(group.base, "group.base must exist");
const body = group.pr?.body || "";
const update_body = StackSummaryTable.write({
body,
pr_url_list,
selected_url,
});
if (update_body === body) {
actions.debug(`Skipping body update for ${selected_url}`);
}
else {
actions.debug(`Update body for ${selected_url}`);
await github.pr_edit({
branch: group.id,
base: group.base,
body: update_body,
});
}
}
// after all commits have been cherry-picked and amended

@@ -159,1 +191,2 @@ // move the branch pointer to the newly created temporary branch

}
const get_group_url = (group) => group.pr?.url || group.id;

@@ -89,3 +89,5 @@ import * as React from "react";

handle_error(cli_result.output);
return null;
}
return cli_result.stdout;
}

@@ -92,0 +94,0 @@ export async function pr_edit(args) {

+11
-9
export function write(args) {
const group_list = args.commit_range?.group_list;
if (!Array.isArray(group_list) || group_list.length === 0) {
return "";
}
const stack_list = [];
for (const group of group_list) {
if (group.pr?.url) {
const selected = args.selected_group_id === group.id;
for (const pr_url of args.pr_url_list) {
if (pr_url) {
const selected = args.selected_url === pr_url;
const icon = selected ? "👉" : "⏳";
stack_list.push(`- ${icon} ${group.pr.url}`);
stack_list.push(`- ${icon} ${pr_url}`);
}
}
const stack_table = TEMPLATE.stack_table(["", ...stack_list, "", ""].join("\n"));
let stack_table;
if (stack_list.length > 1) {
stack_table = TEMPLATE.stack_table(["", ...stack_list, "", ""].join("\n"));
}
else {
stack_table = "";
}
let result = args.body;

@@ -16,0 +18,0 @@ if (RE.stack_table.test(result)) {

{
"name": "git-stack-cli",
"version": "0.7.0",
"version": "0.7.1",
"description": "",

@@ -5,0 +5,0 @@ "author": "magus",