[PATCH v2 00/30] patman: Collect review tags and comments from Patchwork

Simon Glass sjg at chromium.org
Mon Oct 26 02:04:12 CET 2020


Patman is a useful tool for creating, checking sending out patches. It
automates the creation of patches, simplifies checking them and handles
cover letters and change logs.

However once patches are sent and reviewers add Reviewed-by tags, etc.,
these must be manually added into the commits using git before the next
version of the series is sent. Also, the only way to look at patches is
in the web interface.

It would be nice if patman could talk to Patchwork and collect the review
tags itself. Even better if it could show the review comments in a
command-line view patch-by-patch to speed up addressing comments.

This series adds these features to patman, talking directly to the
Patchwork REST API. While pwclient seems like it could handle some of
this, or at least provide a library to patman, the documentation[1]
doesn't really explain what the commands do and it doesn't seem to work
with the current Patchwork (e.g. pwclient git-am requires a patch number
but Patchwork seems to use an ID now).

With these changes it is possible to type 'patman status' and see a list
of new review tags. It is also possible to create a new branch with those
tags and list out the review comments as small snippets on the command
line.

I have been using these features for a little while and they seem useful,
so herewith a series.

Some of the patches here clean up style problems in patman and other minor
problems. See the last four patches for the main changes.

You can find it at u-boot-dm/patman-working[2]

[1] https://patchwork.readthedocs.io/projects/pwclient/en/latest/usage/
[2] https://gitlab.denx.de/u-boot/custodians/u-boot-dm/-/tree/patman-working

Changes in v2:
- Adjust the algorithm to handle patch/commit mismatch
- Correct Python style problems
- Use REST API instead of web pages
- Many changes to the whole series, including new patches
- Use of REST API instead of the web site

Simon Glass (30):
  patman: Correct operation of -n
  azure/gitLab/travis: Add pygit2 as a dependency for tests
  patman: Update how tests are run
  patman: Fix whitespace errors in func_test
  patman: Use capture_sys_output() consistently
  patman: Fix remaining pylint3 warnings in func_test
  patman: Allow linking a series with patchwork
  patman: Fix indenting in patchstream
  patman: Fix constant style in patchstream
  patman: Rename functions in patchstream
  patman: Rename variables in patchstream
  patman: Drop unused args in patchstream
  patman: Fix up argument/return docs in patchstream
  patman: Move warning collection to a function
  patman: Attach warnings to individual patches
  patman: Convert 'Series-xxx' tag errors into warnings
  patman: Drop unused signoff member
  patman: Add a test for PatchStream tags
  patman: Add some tests for warnings
  patman: Convert testBasic() to use an interator
  patman: Require tags to be before sign-off
  patman: Fix spelling of plural for warning
  patman: Don't ignore lines starting with hash
  patman: Allow showing a Commit as a string
  patman: Improve handling of files
  patman: Detect missing upstream in CountCommitsToBranch
  patman: Support checking for review tags in patchwork
  patman: Support updating a branch with review tags
  patman: Support parsing of review snippets
  patman: Support listing comments from patchwork

 .azure-pipelines.yml                          |   2 +-
 .gitlab-ci.yml                                |   2 +-
 .travis.yml                                   |   1 +
 tools/buildman/control.py                     |   6 +-
 tools/patman/README                           | 111 +-
 tools/patman/checkpatch.py                    |  18 +-
 tools/patman/commit.py                        |   5 +
 tools/patman/control.py                       |  71 +-
 tools/patman/func_test.py                     | 980 ++++++++++++++++--
 tools/patman/gitutil.py                       |  10 +-
 tools/patman/main.py                          |  42 +-
 tools/patman/patchstream.py                   | 454 +++++---
 tools/patman/series.py                        |   8 +-
 tools/patman/status.py                        | 480 +++++++++
 tools/patman/terminal.py                      |  21 +-
 .../0001-pci-Correct-cast-for-sandbox.patch   |   2 +-
 ...-for-sandbox-in-fdtdec_setup_mem_siz.patch |   2 +-
 tools/patman/test/test01.txt                  |   4 +-
 tools/patman/test_checkpatch.py               |   6 +-
 19 files changed, 1952 insertions(+), 273 deletions(-)
 create mode 100644 tools/patman/status.py

-- 
2.29.0.rc2.309.g374f81d7ae-goog



More information about the U-Boot mailing list