AI and developer tools
GitUtils: stacked branches and PR tooling
Ruby tooling I've used daily since 2021 for stacked branches, rebasing lots of branches at once, and opening and managing pull requests.
- 5 yearsin daily use, since 2021
- 110+commits
The problem
I like small pull requests that build on each other. Plain git makes that painful: every change to the bottom of the stack means rebasing everything above it, and opening a pull request for each piece by hand gets old fast.
What I built
- Rake tasks for stacked branches, where each commit becomes its own branch and pull request, linked in order
- Bulk operations like rebasing all my branches onto the latest main branch at once and cleaning up after merges
- Shortcuts for opening, submitting and assigning pull requests from the terminal
How a stack gets published
- Source branchone commit per change
- Each commitpushed to its own stack branch
- One PR eachbased on the one below
- Linkedas a GitHub stack
fn stacking_diff(source_branch):
base = main_branch()
for commit in commits(base..source_branch):
token = commit.label() # stable per change, survives rebases
push(commit.sha, "stacks/austin/" + token, force = true)
pr = find_or_open_pr(head = "stacks/austin/" + token, base = base)
base = "stacks/austin/" + token # the next PR builds on this one
link_stack(prs)
Why it matters
It’s the tool I reach for most. Small changes are easier to review, and this makes them cheap to keep up to date.