🚀 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

- ✨ **[Stacked diffs](https://graphite.dev/guides/stacked-diffs) for `git`** - 🚀 **Simple one-branch workflow** - 🎯 **Interactively select commits for each pull request** - 💬 **Group commits for focused code review** - 🌐 **Use the [official GitHub CLI

Source
npmnpm
Version
0.8.6
Version published
Weekly downloads
203
136.05%
Maintainers
1
Weekly downloads
 
Created
Source

git-stack-cli

  • Stacked diffs for git
  • 🚀 Simple one-branch workflow
  • 🎯 Interactively select commits for each pull request
  • 💬 Group commits for focused code review
  • 🌐 Use the official GitHub CLI
  • ♻️ Automatically synchronize each pull request in the stack
  • 💪 Work seamlessly with GitHub's interface
  • 🚫 Avoid juggling mutiple branches and complex rebasing
  • 📚 Preserve your detailed commit history

Demo

Install

npm i -g git-stack-cli

Usage

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?

The goal of git stack is to combine the simplicity of developing in a single branch in order to preserve your commit history while also grouping commits into pull requests for code review.

Often pushing all your commits to a single pull request is the simplest and fastest approach to development. This comes at a price, your teammates have to review larger, less related pieces of code and you will lose some of your atomic commit history if you "Squash and merge".

When you decide to break changes up into multiple diffs that depend on one another this process is commonly referred to as stacked diffs (pull requests that depend on other pull requests). This appraoch is popular at many major comparnies such as Twitter, Facebook, etc. Managing stacked diffs manually involves managing multiple local branches, jumping between them, rebasing, etc. This process gets even more complicated when you start getting feedback in code review and have to update individual branches. Managing even a few stacked diffs requires a relatively strong knowledge of git, even with tricks like --update-refs.

How is this different than x

ghstack

  • git stack automatically synchronizes each pull request in your stack, as needed
  • git stack does not create local branches (instead it annotates commits locally with metadata to denote groups of commits, e.g. git-stack-id: E63ytp5dj)
  • ghstack requires rebasing and squashing since each commit creates a pull request, which means you lose commit history
  • git stack allows developing in a single local branch and selecting groups of commits for each pull request
  • git stack adds a clear comment to each pull request in the stack showing the entire stack
  • git stack does not break if you land pull requests through Github directly, ghstack requires landing from the command-line interface
  • git stack uses the official GitHub CLI (gh) instead of personal access tokens

Development

npm run dev
npm link

git stack --verbose

FAQs

Package last updated on 07 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts