We're hiring!
*

Quick hack: git-pw

Ezequiel Garcia avatar

Ezequiel Garcia
April 18, 2019

Share this post:

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:


Latest Blog Posts

Permissively-licensed MTP device implementation

16/05/2019

Introducing cmtp-responder - a permissively licensed Media Transfer Protocol (MTP) responder implementation which allows embedded devices…

An eBPF overview, part 5: Tracing user processes

14/05/2019

Up until now, talking in-depth about userspace tracing was deliberately avoided because it merits special treatment, hence this part devoted…

CEF on Wayland upstreamed

08/05/2019

After a successful team effort, the patch enabling the Chromium Embedded Framework (CEF) Ozone builds to run with different platform backends,…

An eBPF overview, part 4: Working with embedded systems

06/05/2019

Now that we've studied the mainstream way of developing and using eBPF programs on top of the low-level VM mechanisms, we'll look at projects…

Running Android and Wayland on embedded devices

02/05/2019

A previous post introduced the SPURV Android compatibility layer for Wayland based Linux environment. In this post, we're going to dig into…

An eBPF overview, part 3: Walking up the software stack

26/04/2019

In part 1 and 2 of this series, we took a condensed in-depth look at the eBPF VM. In part 3, we define the high-level components of an eBPF…

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-2019. All rights reserved. Website sitemap.