sm absorb
Auto-route uncommitted hunks into the right ancestor commits via git-absorb, then restack descendants.
Synopsis
sm absorb [--base <branch>]Flags
| Flag | Description |
|---|---|
--base <branch> | Use this branch as the absorb base. Default: the lowest tracked ancestor. |
Prerequisites
git-absorb must be on PATH. Install it via your package manager — brew install git-absorb, cargo install git-absorb, etc. If it's missing, sm absorb prints a friendly install hint and exits.
Examples
You've made small fixes to several places in the stack and they belong in earlier commits. Stage nothing, then:
sm absorbgit-absorb matches each hunk to the right historical commit (the one that introduced the surrounding code) and creates fixup! commits, then runs git rebase --autosquash to fold them in. sm then restacks descendants.
Pick a specific base:
sm absorb --base feat/api-modelsWhat it does
- Calls
git absorb --base <branch>on the working tree's uncommitted changes. - Restacks every descendant of the affected branch so they pick up the new commits.
- On conflict during the descendant rebase, pauses with a
PausedError.
When this beats manual fixups
Without sm absorb, the equivalent is the three-step template below — one git commit --fixup per hunk, an interactive autosquash rebase, and a stac-man restack:
git commit --fixup=<sha-of-target-commit> # repeat per hunk
git rebase -i --autosquash <base-branch>
sm restacksm absorb does all three steps with one command.
See also
- Recipes → Absorb fixups.
sm modify— when changes belong on the current tip, not in an ancestor.
