Skip to main content

This is a helper utility to work with patches made available via a public-inbox archive like lore.kernel.org. It is written to make it easier to participate in a patch-based workflows, like those used in the Linux kernel development.

The name “b4” was chosen for ease of typing and because B-4 was the precursor to Lore and Data in the Star Trek universe.

See https://b4.docs.kernel.org/ for online documentation.

Installing

To install the latest released version with pip:

python3 -m pip install b4

Or to install the latest master (warning, maybe broken!):

python3 -m pip install git+https://git.kernel.org/pub/scm/utils/b4/b4.git@master

Shell completion

b4 makes use of the python-shtab module to provide static shell completion files. Currently python-shtab supports bash, zsh and tcsh, where others may be added in the future.

To install b4 with pip and shell completion use:

python3 -m pip install b4[completion]

Shell completion is provided by the command b4 --print-completion {bash,zsh,tcsh}. To enable shell completion run:

eval $(b4 --print-completion bash)

To make it permanent on new shells, add that command to your $HOME/.bashrc or $HOME/.zshrc.

Upgrading

If you previously installed from pypi:

python3 -m pip install --upgrade b4

Or to get the latest stuff from git:

python3 -m pip install --upgrade git+https://git.kernel.org/pub/scm/utils/b4/b4.git@master

Running from the checkout dir

If you want to run from the checkout dir without installing the python package, you can use the included b4.sh wrapper. You can set it as an alias in your .bash_profile:

alias b4="$HOME/path/to/b4/b4.sh"

Setting up a symlink should also be possible. Remember to run the following commands after the initial clone:

git submodule update --init
python3 -m pip install -r requirements.txt

Support

For support or with any other questions, please email tools@kernel.org, or browse the list archive at https://lore.kernel.org/tools.

Please send patches to tools@kernel.org.

Submissions must be made under the terms of the Linux Foundation certificate of contribution and should include a Signed-off-by: line. Please read the DCO file for full legal definition of what that implies.

Release files for b4 0.16.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 b4 0.16.0
File Size Uploaded
b4-0.16.0.tar.gz 403.4 kB Details

Built distribution (wheel)

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

Total release size: 823.6 kB

Release files / b4-0.16.0.tar.gz

Download URL b4-0.16.0.tar.gz
Size 403.4 kB
Tags Source
SHA-256 checksum
How to use checksums
071823a1e904508a6fd9aaf8cc2f9a92697e1dfa270000b4d1130015b56f4137
BLAKE2b-256 checksum
How to use checksums
3b8970da0dcb6a75833a388aeb15aef12d859950793f8ce68faff757df97d1e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / b4-0.16.0-py3-none-any.whl

Download URL b4-0.16.0-py3-none-any.whl
Size 420.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b6072d5b311a19b61eff6540c0d6a91cb13c197e5a987b528e81efa9aeaf1608
BLAKE2b-256 checksum
How to use checksums
23ff86a9d1c24aefcc0fb9cde57e49afcb68f93be8b4427fdb1f1a24f8dd4524
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.16.0 This release

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.2

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.4

2 release files

0.12.3

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.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