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

What if C++ had decades to learn?

21/05/2025

In this second article of a three-part series, I look at how Matt Godbolt uses modern C++ features to try to protect against misusing an…

Unleashing gst-python-ml: Python-powered ML analytics for GStreamer pipelines

12/05/2025

Powerful video analytics pipelines are easy to make when you're well-equipped. Combining GStreamer and Machine Learning frameworks are the…

Matt Godbolt sold me on Rust (by showing me C++)

06/05/2025

Gustavo Noronha helps break down C++ and shows how that knowledge can open up new possibilities with Rust.

Customizing WirePlumber's configuration for embedded systems

29/04/2025

Configuring WirePlumber on embedded Linux systems can be somewhat confusing. We take a moment to demystify this process for a particular…

Evolving hardware, evolving demo: Collabora's Embedded World Board Farm

24/04/2025

Collabora's Board Farm demo, showcasing our recent hardware enablement and continuous integration efforts, has undergone serious development…

Implementing Bluetooth on embedded Linux: Open source BlueZ vs proprietary stacks

27/02/2025

If you are considering deploying BlueZ on your embedded Linux device, the benefits in terms of flexibility, community support, and long-term…

Open Since 2005 logo

Our website only uses a strictly necessary session cookie provided by our CMS system. To find out more please follow this link.

Collabora Limited © 2005-2025. All rights reserved. Privacy Notice. Sitemap.

OSZAR »