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

Automatic regression handling and reporting for the Linux Kernel

14/03/2024

In continuation with our series about Kernel Integration we'll go into more detail about how regression detection, processing, and tracking…

Almost a fully open-source boot chain for Rockchip's RK3588!

21/02/2024

Now included in our Debian images & available via our GitLab, you can build a complete, working BL31 (Boot Loader stage 3.1), and replace…

What's the latest with WirePlumber?

19/02/2024

Back in 2022, after a series of issues were found in its design, I made the call to rework some of WirePlumber's fundamentals in order to…

DRM-CI: A GitLab-CI pipeline for Linux kernel testing

08/02/2024

Continuing our Kernel Integration series, we're excited to introduce DRM-CI, a groundbreaking solution that enables developers to test their…

Persian Rug, Part 4 - The limitations of proxies

23/01/2024

This is the fourth and final part in a series on persian-rug, a Rust crate for interconnected objects. We've touched on the two big limitations:…

How to share code between Vulkan and Gallium

16/01/2024

One of the key high-level challenges of building Mesa drivers these days is figuring out how to best share code between a Vulkan driver…

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-2024. All rights reserved. Privacy Notice. Sitemap.