We're hiring!
*

Quick hack: git-pw

Ezequiel Garcia avatar

Ezequiel Garcia
April 18, 2019

Share this post:

Reading time:

Some communities, such as the Linux kernel community, base their development process on mailing lists. Patches come and go in the form of good ol' mails. When one wants to test a patch series, one downloads all the patches and applies them using a command such as git-am.

A well-known Linux kernel developer once said: A poor craftsman famously complains about his tools, but a good craftsman knows how to choose excellent tools.

With that in mind, I recently set out to find proper tools to make my workflow less poor…

…and that’s how I found git-pw. I won’t say I quit complaining, but it certainly improved my toolbox.

A new tool in your toolbox

Git-pw is a python-based tool that integrates git and patchwork. It's important to note that git-pw requires patchwork v2.0, as it uses the new REST API and other improvements, such as understanding the difference between patches, series and cover letters,to know exactly what to try and apply.

The usual python incantation can be chanted for installing:

$ pip install --user git-pw

Some configuration is the next step. First, a patchwork API endpoint is needed; and then, a way to authenticate against it. Either a user/password combination or a token will do. For instance, in order to use kernel.org's patchwork:

$ git config pw.server https://patchwork.kernel.org/api/1.1
$ git config pw.token YOUR_USER_TOKEN_HERE

Finding and applying series

Let’s see how it works in practice. As an example, I want to apply Gaël Portay's recently submitted series: "Add support for drm/rockchip to dynamically control the DDR frequency.". The first step is to do searching for this series.

We could use patchwork web UI search engine for it. Given Gaël series has been submitted to linux-rockchip, we'll go to that project and then click on _"Show patches with"_ to access the filter menu. This menu allows to quickly find the series we need, for instance filtering by submitter. This way we would find the series patchwork ID to be 95139.

Another way of searching is via Patchwork's REST API. This is very well documented. And of course, git-pw already supports this!

$ git-pw --project linux-rockchip series list "dynamically"
ID Date Name Version Submitter
95139 a day ago Add support for drm/rockchip to dynamically control the DDR frequency. 3 Gaël PORTAY
93875 3 days ago Add support for drm/rockchip to dynamically control the DDR frequency. 2 Gaël PORTAY
3039 8 months ago Add support for drm/rockchip to dynamically control the DDR frequency. 1 Enric Balletbo i Serra


Which has the added side-effect of giving us some interesting metadata on the series history.

Now, let's use the serie ID to get more info:

$ git-pw series show 95139
Property Value
ID 95139
Date 2019-03-21T23:14:35
Name Add support for drm/rockchip to dynamically control the DDR frequency.
URL https://patchwork.kernel.org/project/linux-rockchip/list/?series=95139
Submitter Gaël PORTAY
Project Rockchip SoC list
Version 3
Received 5 of 5
Complete True
Cover 10864561 [v3,0/5] Add support for drm/rockchip to dynamically control the DDR frequency.
Patches 10864575 [v3,1/5] devfreq: rockchip-dfi: Move GRF definitions to a common place.
  10864579 [v3,2/5] dt-bindings: devfreq: rk3399_dmc: Add rockchip, pmu phandle.
  10864589 [v3,3/5] devfreq: rk3399_dmc: Pass ODT and auto power down parameters to TF-A.
  10864591 [v3,4/5] arm64: dts: rk3399: Add dfi and dmc nodes.
  10864585 [v3,5/5] arm64: dts: rockchip: Enable dmc and dfi nodes on gru.


Applying the entire series, or at least trying to, is now as easy as:

$ git-pw series apply 95139

This command will simply fetch all the patches in the series, and apply them in the right order. Should there be any conflicts, we will have to resort to manual fixing just as one would when using git-am.

And that's all folks! Of course, patchwork and git-pw are open source tools. So don't hesitate to take a look at them, and help the developers by fixing any bugs you see, or contributing and proposing any features you'd like. I, for one, have already started. ;-)

Comments (0)


Add a Comment






Allowed tags: <b><i><br>Add a new comment:


Search the newsroom

Latest Blog Posts

USB 3.0 preliminary support in U-boot for Radxa Rock-5B

31/05/2023

A while back I presented USB 2.0 host support that was added to U-boot for the Radxa Rock-5B RK3588 Rockchip board. This time, USB 3.0 was…

Radxa Rock-5B PCIe and RTL8125B networking in U-boot

18/05/2023

Work continues on the Radxa ROCK5B RK388, as PCIe and RTL8125B networking support in U-boot have now been added. Publishing code as Open…

Introducing Multiview for NVK

03/05/2023

NVK, an open-source Vulkan driver for NVIDIA hardware that is part of Mesa, now supports the Vulkan extension VK_KHR_multiview.

Adding bootloader support for USB 2.0 Host for Radxa ROCK 5B RK3588

27/04/2023

The beauty of Open Source is that we can reuse code written by many other people, keep their authorship, and credit them for their work,…

Meson & VSCode: Develop your project in a modern IDE

18/04/2023

Want to develop your Meson project in a modern IDE? Make sure to install Meson VSCode extension which is now fully functional with the recent…

Carlafox: Towards reliable open-source 3D perception

05/04/2023

Labeling errors are common in present open-source 3D perception datasets, which could have impactful consequences. To tackle this issue,…

Open Since 2005 logo

We use cookies on this website to ensure that you get the best experience. By continuing to use this website you are consenting to the use of these cookies. To find out more please follow this link.

Collabora Ltd © 2005-2023. All rights reserved. Privacy Notice. Sitemap.