Skip to main content

Stacky

Stacky is a minimal Git extension providing a stack-like workflow with one PR per stack, rather than one PR per commit. This allows for easier integration with GitHub's current PR workflow.

Since GitHub doesn't natively support stacked PRs, workarounds fall into one of three categories: serial PRs (simple but slow), parallel PRs (fast but complex and requiring permissions), or single PRs with multiple commits (fast but less flexible to review). Stacky implements the latter, with a simple and intuitive interface.

Concept

The main idea is every stack is just a branch FEATURE with linear history rooted at its base branch FEATURE_base

(main)(FEATURE_base) > commit1 > commit2 > ... > commitN (FEATURE)

Successive commits move the stack's top branch, and rebases move the top-to-bottom stack of changes onto a new location.

One PR is created per stack, allowing reviewers to go through changes one commit at a time, while still testing and merging the stack as a single change.

Stacky is small and easy to understand, integrates natively with GitHub, and requires zero repo or org-level admin permissions or changes.

Install

brew install git-absorb  # optional
pip install git_stacky

Usage

Stacky provides four commands to manage stacks:

  • hack FEATURE create a new stack named FEATURE
  • rebase TARGET rebase the current stack onto TARGET
  • stacks list all stacks, optionally as a --graph
  • absorb absorb changes into the current stack

Here's an example workflow:

# Help text
(main)   git stack -h

# 1. New stack (apple, apple_base branches rooted at main)
(main)   git stack hack apple
(apple)  touch apple1 && git add -A && git commit -m 'apple1'
(apple)  touch apple2 && git add -A && git commit -m 'apple2'

# 2. New stack (banana, banana_base branches rooted at main)
(apple)  git stack hack banana
(banana) touch banana1 && git add -A && git commit -m 'banana1'

# 3. Rebase banana onto apple
(banana) git stack rebase apple

# 4. Rebase banana implicitly back onto main
(banana) git stack rebase

# 5. Force-delete banana stack
(banana) git checkout apple
(apple)  git stack stacks -D banana

# History evolution
# 1. (main)(apple_base) > apple1 > apple2 (apple)
# 2. (main)(apple_base)(banana_base) > apple1 > apple2 (apple)
#                                    > banana1 (banana)
# 3. (main)(apple_base) > apple1 > apple2 (apple)(banana_base) > banana1 (banana)
# 4. (main)(apple_base)(banana_base) > apple1 > apple2 (apple)
#                                    > banana1 (banana)
# 5. (main)(apple_base) > apple1 > apple2 (apple)

Release files for git_stacky 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git_stacky 0.10.0
File Size Uploaded
git_stacky-0.10.0.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for git_stacky 0.10.0
File Interpreter ABI Platform
git_stacky-0.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.5 kB

Release files / git_stacky-0.10.0.tar.gz

Download URL git_stacky-0.10.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
de240017aff510ddd1838aa9771745479c1ccb1d2c46f10e60dd6a0ea5cf7bcc
BLAKE2b-256 checksum
How to use checksums
d4a028bef230c2a521a7c6f2d351d0e1271cc4fc8f376903bf4ebb3ea28c8f04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.10 Darwin/24.6.0

Release files / git_stacky-0.10.0-py3-none-any.whl

Download URL git_stacky-0.10.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26627452dc59f93431db881500ca88150fd1d92e7f6f3f6bf7af4c10abfc2802
BLAKE2b-256 checksum
How to use checksums
791beed444af9ffd891a0d200dcffe3b383ca5745bd93b15528c6f2f140d700a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.10 Darwin/24.6.0

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page