Skip to content

Commit 5a21f5b

Browse files
jetmxypron
authored andcommitted
doc: Update coding style to recommend b4 for patch submission
Replace references to patman with b4 as the recommended tool for preparing and sending patches. b4 is widely adopted in the Linux kernel community and U-Boot ships with configuration to simplify its use with the project mailing list. The updated guidelines describe how to prepare series with b4, handle cover letters and recipient lists, run style checks, and send patches safely. Instructions also highlight how to collect and apply review tags before resending. This change documents the preferred workflow for contributors and ensures consistency with common practices across related upstream communities. Reviewed-by: Neil Armstrong <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Signed-off-by: Javier Tia <[email protected]>
1 parent eb50148 commit 5a21f5b

1 file changed

Lines changed: 48 additions & 6 deletions

File tree

doc/develop/codingstyle.rst

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,55 @@ The following rules apply:
2323
<https://peps.python.org/pep-0008/>`_. Use `pylint
2424
<https://github.com/pylint-dev/pylint>`_ for checking the code.
2525

26-
* Use patman to send your patches (``tools/patman/patman -H`` for full
27-
instructions). With a few tags in your commits this will check your patches
28-
and take care of emailing them.
26+
* Use the `b4 <https://git.kernel.org/pub/scm/utils/b4/b4.git/>`_ tool to prepare and
27+
send your patches. b4 has become the preferred tool to sending patches for many
28+
Linux kernel contributors, and U-Boot ships with a ready-to-use ``.b4-config`` that
29+
targets ``[email protected]`` and integrates with ``scripts/get_maintainer.pl`` for
30+
recipient discovery.
2931

30-
* If you don't use patman, make sure to run ``scripts/checkpatch.pl``. For
31-
more information, read :doc:`checkpatch`. Note that this should be done
32-
*before* posting on the mailing list!
32+
Start a topical series with ``b4 prep`` and keep the commits organised with
33+
``git rebase -i``. ``b4 prep --edit-cover`` opens an editor for the cover
34+
letter, while ``b4 prep --auto-to-cc`` collects reviewers and maintainers from
35+
both the configuration file and ``scripts/get_maintainer.pl``.
36+
37+
.. code-block:: bash
38+
39+
b4 prep -n mmc-fixes
40+
git rebase -i origin/master
41+
b4 prep --edit-cover
42+
b4 prep --auto-to-cc
43+
44+
Run the style checks before sending. ``b4 prep --check`` wraps the existing
45+
tooling so you see the output from ``scripts/checkpatch.pl`` alongside b4's
46+
own validation. You can always invoke ``scripts/checkpatch.pl`` directly for
47+
additional runs.
48+
49+
.. code-block:: bash
50+
51+
b4 prep --check
52+
53+
When the series is ready, use ``b4 send``. Begin with ``--dry-run`` to review
54+
the generated emails and ``--reflect`` to copy yourself for records before
55+
dispatching to ``[email protected]``.
56+
57+
.. code-block:: bash
58+
59+
b4 send --dry-run
60+
b4 send --reflect
61+
b4 send
62+
63+
After reviews arrive, collect Acked-by/Tested-by tags with ``b4 trailers -u``
64+
and fold them into your commits before resending the updated series.
65+
66+
.. code-block:: bash
67+
68+
b4 trailers -u
69+
git rebase -i origin/master
70+
b4 send
71+
72+
* Run ``scripts/checkpatch.pl`` directly or via ``b4 prep --check`` so that all
73+
issues are resolved *before* posting on the mailing list. For more information,
74+
read :doc:`checkpatch`.
3375

3476
* Source files originating from different projects (for example the MTD
3577
subsystem or the hush shell code from the BusyBox project) may, after

0 commit comments

Comments
 (0)