Git Disjoint
git-disjoint automates an optimal git workflow for PR authors and reviewers by grouping commits by issue onto unique branches, referencing issues in branch names, and creating PRs.
This encourages the submission of small, independent PRs, minimizing cognitive load on reviewers and keeping cycle time low.
How does it work?
git-disjoint uses commit messages to determine which issue a commit relates to. Following formalized conventions for commit messages, git-disjoint automatically creates a PR for each issue and associates the PR to an existing issue in your work tracker.
When the PR merges, the existing issue closes and your git history updates to reflect the upstream changes.
Supported Integrations
git-disjoint may add value to your workflow if you
- use a work tracker (currently supports Jira and GitHub Issues)
- use GitHub and Pull Requests
Requirements
You must have the hub command installed and configured.
Install
From GitHub releases
You can install git-disjoint with cargo binstall.
Otherwise, download a release compatible with your OS and architecture from the
Releases page, extract the binary, and put it somewhere in your $PATH.
Using Nix
Use the Nix flake:
nix shell github:EricCrosson/git-disjoint
From source
If cargo is installed on your system, run:
cargo +nightly install git-disjoint
Make commits
-
In each commit message, include a reference to the relevant ticket.
For example, use the Jira automation format:
Ticket: COOL-123or
Closes Ticket: COOL-123Or use the GitHub format:
Closes #123
Open PRs
When you're ready to:
- turn the set of commits addressing each ticket into its own feature branch,
- push that branch, and
- create a draft PR,
run git disjoint.
Ignore commits
To ignore commits associated with an issue, use the --choose flag. This will
open a menu where you can select the issues to create PRs for.