b4-shazam

Fetch a patch series and apply it to the current branch

TLDR

Fetch and apply a series to the current branch
$ b4 shazam [message-id]
Apply from an archive URL
$ b4 shazam [https://lore.kernel.org/.../message-id]
Merge the series instead of applying it linearly
$ b4 shazam -M [message-id]
Create a FETCH_HEAD so you can merge or cherry-pick manually
$ b4 shazam -H [message-id]
Apply review trailers from the cover-letter replies
$ b4 shazam -t [message-id]

SYNOPSIS

b4 shazam [options] msgid

DESCRIPTION

b4 shazam does everything b4 am does (retrieve the thread, pick the latest revision, gather review trailers) and then applies the resulting series directly to the current git branch with git am. It is the one-step path from a message-id to applied commits in your working tree.With -M the series is brought in as a merge, and with -H b4 prepares a FETCH_HEAD so you can decide how to integrate it yourself. The name is a nod to retrieving and "playing" a patch series in a single command.

PARAMETERS

-H, --make-fetch-head

Apply the series to a throwaway ref and point FETCH_HEAD at it, so you can merge or cherry-pick manually.
-M, --merge
Integrate the series as a merge commit instead of a linear git am.
-v VER, --use-version VER
Apply a specific revision of the series.
-t, --apply-cover-trailers
Apply trailers found on the cover letter to every patch.
-l, --add-link
Add a Link trailer with the archive URL of each message.
-s, --add-my-sob
Add your own Signed-off-by trailer to each patch.
-P RANGE, --cherry-pick RANGE
Apply only a subset of patches from the series.
-m MBOX, --use-local-mbox MBOX
Read the thread from a local mbox file instead of fetching it.

INSTALL

sudo dnf install b4
sudo pacman -S b4
sudo apk add b4
sudo zypper install b4
brew install b4
nix profile install nixpkgs#b4

CAVEATS

The series is applied to whatever branch is currently checked out, so make sure you are on the intended base commit before running it. b4 tries to find the right base, but a mismatched tree can still cause git am conflicts.

SEE ALSO

b4(1), b4-am(1), git-am(1)

RESOURCES

Documentation