Configuration options

B4 doesn’t have a separate configuration file but uses git-config to retrieve a set of b4-specific settings. This means that you can have three levels of b4 configuration:

  • system-wide, in /etc/gitconfig

  • per-user, in $HOME/.gitconfig

  • per-repo, in somerepo/.git/config

Since the purpose of b4 is to work with git repositories, this allows the usual fall-through configuration, with local settings specified in .git/config overriding the global defaults.

You can also use the command-line switch -c/--config to override specific options, for example:

b4 --config b4.midmask=

Per-project defaults

A project may ship their own b4 configuration file with some defaults, located at the top-level of the git tree. If you’re not sure where a configuration option is coming from, see if there is a .b4-config file in the repository you’re currently using.

Configuration options

All settings are under the b4 section. For example, to set the b4.midmask option, add the following section to the relevant git config file:

  midmask =

Core options

These options control many of the core features of b4.


Specifies the server from where to retrieve the messages specified by their message-id.



B4 uses this setting to construct the URL in the Link: trailers. If you want a shorter option, you can also use, which is an alias for



B4 uses this setting to query and retrieve threads matching specific search terms. For example, it can retrieve trailer updates using the series change-id identifier.


b4.linktrailermask (v0.13+)

Overrides the format of the Link: trailer, in case you want to call it something other than “Link.” For example, some projects use “Message-Id” trailers instead:

linktrailermask = Message-Id: <%s>

The %s is the placeholder for the message-id.

Default: Link:


Sometimes messages with the same message-id can have different contents, because some servers modify message bodies to inject list subscription information. B4 attempts to de-duplicate the results using the List-Id header. You may use this parameter to specify the order of preference, using comma-separated strings with shell-style wildcard globbing.

Default: *, *,*,*

The “mbox” file format is actually several incompatible standards, such as “mboxo” vs. “mboxrd.” Setting this option can avoid potential problems by saving retrieved threads as Maildirs.

Default: no


This lets you control the order of trailers that get added to your own custody section of the commit message. By default, b4 applies these trailers in the order received. However, if you want to list trailers in a specific order, you can try something like:

trailer-order = link*,fixes*,acked*,reviewed*,tested*,*

The “chain of custody” is an important concept in patch-based code review process. Each “Signed-off-by” trailer indicates where the custody section of previous reviewer ends and the new one starts. Your own custody section is always between the previous-to-last “Signed-off-by” trailer, if any, and the bottom of the trailer section. For example:

Fixes: abcde (Commit info)
Suggested-by: Alex Reporter <>
Signed-off-by: Betty Developer <>
Acked-by: Chandra Acker <>
Reviewed-by: Debby Reviewer <>
Signed-off-by: Ezri Submaintainer <>
Tested-by: Finn Tester <>
Signed-off-by: Your Name <>

Your custody section is beneath “Ezri Submaintainer,” so the only trailers considered for reordering are “Link” and “Tested-by.” Your own Signed-off-by trailer is always at the bottom of your own custody section.

Default: *


A comma-separated list of addresses that b4 should always ignore when applying follow-up trailers. This is useful when dealing with reports generated by some automated bots. For example:

trailers-ignore-from =,

Default: None


B4 caches retrieved threads for 10 minutes. This option allows tweaking the time that the cache remains valid. Many commands also allow a --no-cache flag to force b4 to perform remote lookups.

Default: 10

am and shazam settings

These settings control b4 am and b4 shazam behavior.


Additional flags to pass to git am when applying patches.

Default: None


Additional flags to pass to git merge when performing a merge with b4 shazam -M

Default: --signoff


Path to a template to use when creating a merge commit. See shazam-merge-template.example for an example.

Default: None (v0.14+)

The command to use when running with --check. If b4 finds scripts/ at the top of your git tree, it uses the command shown below by default.

Default: ./scripts/ -q --terse --no-summary --mailback

Attestation settings


B4 supports domain-level and end-to-end attestation of patches using the patatt library. There are four different operation modes:

  • off: don’t bother checking attestation at all

  • softfail: print green marks when attestation is passing and red marks when it’s failing

  • hardfail: exit with an error when any attestation checks fail

Default: softfail


Controls whether to perform DKIM attestation checks.

Default: yes

b4.attestation-dns-resolvers (v0.14+)

You can specify your own DNS servers if you are on a company network and your OS-provided resolvers aren’t able to perform domain key lookups. For example, to use Google DNS servers:

attestation-dns-resolvers =,

Default: None


Ignore attestation signatures that are more than this many days old. This helps avoid a class of attacks when someone re-sends old patches that contain known security bugs.

Default: 30


Sets GNUPGHOME before running PGP attestation checks that rely on GnuPG.

Default: None


Full path to a different binary to use for gpg. B4 also checks the gpg.program setting, and uses that value, if found.

Default: None


See patatt for details on how to configure keyrings. For example, you can clone the pgp keys repository and use it for attestation:

git clone

Then set the following in your ~/.gitconfig:

  keyringsrc = ~/path/to/pgpkeys/.keyring

Default: None

ty settings

b4.thanks-pr-template, b4.thanks-am-template

Full paths to the templates to use when generating thank-you messages for contributors. See example templates provided with the project.

Default: None


Used when creating summaries for b4 ty, and can be a value like:

thanks-commit-url-mask =

If not set, b4 falls back to using commit hashes.


See this page for more info on convenient short URLs:

Default: None

b4.thanks-from-name (v0.13+)

The name to use in the From: header when sending thank-you notes. By default, b4 uses For example:

thanks-from-name = Project Foo Thanks Bot

Default: None

b4.thanks-from-email (v0.13+)

The email to use in the From: header when sending thank-you notes. By default, b4 uses For example:

thanks-from-email =

Default: None


Name of the tree to use in the thank-you templates.

Default: None

A list of addresses to always exclude from the message recipients. Expects a comma-separated list with shell-style globbing. E.g.:

email-exclude = *, *

Default: None


The sendemail identity to use when sending mail directly with b4. This setting applies to b4 send and b4 ty. See man git-send-email for info about sendemail identities.

Default: None

b4.ty-send-email (v0.11+)

When set, tells b4 ty to send email directly instead of writing out .thanks files.

Default: no

Patchwork integration settings

If your project uses a patchwork server, setting these allows you to integrate your b4 workflow with patchwork.

The URL of your patchwork server. Note, that this should point at the top-level of your patchwork installation and not at the project patch listing. For example:

pw-url =

Default: None

The API key from your user profile to use when authenticating with the patchwork server.

Default: None

The name of the patchwork project, exactly as seen in the URL sub-path. For example:

pw-project = linux-usb

Default: None

Enabling this option makes b4 am or b4 shazam automatically set the review status of the retrieved patches. For example:

pw-review-state = under-review

Default: None

Enabling this option makes b4 ty set the status of any applied patches to the specified state. For example:

pw-accept-state = accepted

Default: None

Enabling this option makes b4 ty -d set the status of any matching patches to the specified state. For example:

pw-discard-state = rejected

Default: None

Contributor-oriented settings


The web submission endpoint to use. See Authenticating with the web submission endpoint.

Default: None


A comma-separated list of addresses to always add to the “To:” header. See Prepare the list of recipients.

Default: None


A comma-separated list of addresses to always add to the “Cc:” header. See Prepare the list of recipients.

Default: None


Instructs b4 not to sign patches with patatt before sending them. Note, that using the web submission endpoint requires using signed patches.

Default: no


The command to use for obtaining the list of “To:” recipients. Has no effect if the specified script isn’t present in the repository.

Default: scripts/ --nogit --nogit-fallback --nogit-chief-penguins --norolestats --nol


The command to use for obtaining the list of Cc: recipients. Has no effect if the specified script isn’t present in the repository.

Default:: scripts/ --nogit --nogit-fallback --nogit-chief-penguins --norolestats --nom

b4.send-same-thread (v0.13+)

When sending a new version of a series, send it in the same thread as the previous version. B4 sends the first message of the new series as a reply to the previous version’s cover letter.

Default: no


Alternative cover letter storage strategy to use, in case you don’t want to use the default commit strategy. See Cover letter strategies.

Default: commit


Path to the template to use for the cover letter. The template supports the following tokens:

  • ${cover}: the content of the cover letter itself

  • ${shortlog}: the git shortlog output for the series

  • ${diffstat}: the git diff --stat output for the series

  • ${range_diff}: the git range-diff output against the previous revision of the series

  • ${base_commit}: the base commit of the series

  • ${change_id}: the change-id of the series

  • ${signature}: your signature, either from ~/.signature if found, or from your Git config

Default: None

b4.prep-perpatch-check-cmd (v0.14+)

The command to use when running --check. If b4 finds scripts/ at the top of your git tree, it uses the command shown below by default.

Default: ./scripts/ -q --terse --no-summary --mailback --showfile`

b4.prep-pre-flight-checks (v0.14+)

You can use this to turn off some or all pre-flight checks that b4 runs prior to sending out patches. To cancel all checks:

prep-pre-flight-checks = disable-all

To turn off specific checks, list each one of them, separated by comma:

prep-pre-flight-checks = disable-needs-auto-to-cc, needs-checking

To document

Deliberately undocumented because the feature is incomplete and poorly tested.