git-stack-cli
Advanced tools
@@ -20,5 +20,7 @@ import * as React from "react"; | ||
| const actions = state.actions; | ||
| const argv = state.argv; | ||
| const branch_name = state.branch_name; | ||
| const commit_range = state.commit_range; | ||
| const master_branch = state.master_branch; | ||
| invariant(argv, "argv must exist"); | ||
| invariant(branch_name, "branch_name must exist"); | ||
@@ -55,3 +57,7 @@ invariant(commit_range, "commit_range must exist"); | ||
| } | ||
| await cli(`git cherry-pick ${commit.sha}`); | ||
| const git_cherry_pick_command = [`git cherry-pick ${commit.sha}`]; | ||
| if (argv.verify === false) { | ||
| git_cherry_pick_command.push("--no-verify"); | ||
| } | ||
| await cli(git_cherry_pick_command); | ||
| if (commit.branch_id && !commit_pr) { | ||
@@ -58,0 +64,0 @@ if (actions.isDebug()) { |
@@ -60,3 +60,7 @@ import * as React from "react"; | ||
| for (const commit of group.commits) { | ||
| await cli(`git cherry-pick ${commit.sha}`); | ||
| const git_cherry_pick_command = [`git cherry-pick ${commit.sha}`]; | ||
| if (argv.verify === false) { | ||
| git_cherry_pick_command.push("--no-verify"); | ||
| } | ||
| await cli(git_cherry_pick_command); | ||
| if (commit.branch_id !== group.id) { | ||
@@ -76,3 +80,3 @@ const new_message = await Metadata.write(commit.message, group.id); | ||
| } | ||
| await cli(git_push_command.join(" ")); | ||
| await cli(git_push_command); | ||
| if (group.pr) { | ||
@@ -79,0 +83,0 @@ // ensure base matches pr in github |
+2
-2
@@ -22,3 +22,3 @@ import yargs from "yargs"; | ||
| default: true, | ||
| description: "Disable the pre-push hook, bypassing it completely", | ||
| description: "Skip git hooks such as pre-commit and pre-push", | ||
| }) | ||
@@ -29,3 +29,3 @@ .option("verbose", { | ||
| default: false, | ||
| description: "Enable verbose mode with more detailed output for debugging", | ||
| description: "Print more detailed logs for debugging internals", | ||
| }) | ||
@@ -32,0 +32,0 @@ .option("branch", { |
+8
-1
| import * as child from "node:child_process"; | ||
| import { Store } from "../app/Store.js"; | ||
| export async function cli(command, unsafe_options) { | ||
| export async function cli(unsafe_command, unsafe_options) { | ||
| const state = Store.getState(); | ||
| const options = Object.assign({}, unsafe_options); | ||
| let command; | ||
| if (Array.isArray(unsafe_command)) { | ||
| command = unsafe_command.join(" "); | ||
| } | ||
| else { | ||
| command = unsafe_command; | ||
| } | ||
| return new Promise((resolve, reject) => { | ||
@@ -7,0 +14,0 @@ const childProcess = child.spawn("sh", ["-c", command], options); |
+1
-1
| { | ||
| "name": "git-stack-cli", | ||
| "version": "0.7.4", | ||
| "version": "0.7.5", | ||
| "description": "", | ||
@@ -5,0 +5,0 @@ "author": "magus", |
+16
-5
| # git-stack-cli | ||
| - ✨ **[Stacked diffs](https://graphite.dev/guides/stacked-diffs) for `git`** | ||
| - 🚀 **Simple one-branch workflow** | ||
| - 🎯 **Interactively select commits for each pull request** | ||
| - 📚 **Preserve your detailed commit history** | ||
| - 💬 **Group commits for focused code review** | ||
| - 🌐 **Use the [official GitHub CLI](https://cli.github.com/)** | ||
| - ♻️ **Automatically synchronize each pull request in the stack** | ||
| - 💬 **Group commits for focused code review** | ||
| - 🚫 **Avoid mutiple branch juggling and complex rebasing** | ||
| - 💪 **Work seamlessly with GitHub's interface** | ||
| - 🌐 **Leverage the [official GitHub CLI](https://cli.github.com/)** | ||
| - 🚫 **Avoid juggling mutiple branches and complex rebasing** | ||
| - 📚 **Preserve your detailed commit history** | ||
| ## Demo | ||
@@ -20,7 +22,16 @@ | ||
| npm i -g git-stack-cli | ||
| ``` | ||
| ## Usage | ||
| ```bash | ||
| git stack | ||
| git stack --verbose # print more detailed logs for debugging internals | ||
| git stack --no-verify # skip git hooks such as pre-commit and pre-push | ||
| git-stack --help # print a table of all command-line arguments | ||
| ``` | ||
| ## Why? | ||
@@ -27,0 +38,0 @@ |
220481
0.42%5511
0.31%72
18.03%