Skip to content

Add add-maintainer.py script

Guru Das Srinagesh linux-arm-kernel linux-arm-msm linux-devicetree linux-pm lkml tools workflows 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest1 patch 24 repliesIn review
  2. v21 patch 20 repliesSuperseded
  3. v11 patch 2 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1scripts: Add add-maintainer.pyMAINTAINERS scripts/add-maintainer.py+169 -024 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/1] Add add-maintainer.py script

When pushing patches to upstream, the get_maintainer.pl script is used to determine whom to send the patches to. Instead of having to manually process the output of the script, add a wrapper script to do that for you.

The add-maintainer.py script adds maintainers (and mailing lists) to a patch, editing it in-place. It also optionally undoes this operation if so desired.

Please try out this script with --verbosity debug for verifying that it's doing "the right thing". I've tested this with a patch series from various subsystems to ensure variety of maintainers and lists output and found it to be behaving as expected. For an example output of this script, please see [1].

Thanks to Bjorn for being a sounding board to this idea and for his valuable suggestions.

I referred to these links [2][3][4] during development of this script.

Apropos workflow:

Thanks to Krzysztof for sharing his workflow - I found his suggestion to use git branch description as cover letter [5] particularly useful. Incorporating that into the ideal workflow envisioned [6] for this script, we get:

1. Do git config format.coverFromDescription subject
2. Do git branch --edit-description and write cover letter
3. Generate patches using git format-patch --cover-letter -n --thread -v<N>
4. Run add-maintainer.py on the above patches
5. git send-email the patches.

b4 is an amazing tool whose b4 prep --auto-to-cc does part of what this script does, but with the above workflow, we have an in-tree solution to the basic problem of preparing patches to be sent to LKML. For multiple patchsets, all one will need to do is to increment -v while git-formatting patches and make corresponding changes to the cover letter via step #2 as necessary!

Changelog:

(v2 -> v3)
- Change patches nargs * -> + (Nicolas)
- Add entry in MAINTAINERS and add self as maintainer (Pavan)
- Bail out early if file does not exist (Pavan)
- Change From: line determination logic (Nicolas)
- Look for From: line and stop at the first occurrence of it - don't search entire file
- Wrap the get_maintainer.pl call with a try-except block.
- Use a better (arguably so) email validation regex
- Don't disallow multiple "From:" in patch:
- When the change is authored by someone other than the person generating the patch, there will be two "From: <email address>" lines in the patch. This is very valid, so don't error out.
- Reviewers also go in To: in addition to Maintainers.
- Add new "--undo" flag to undo effects of this script on a patch (tested)

(v1 -> v2)
- Added set-union logic based on Pavan's comments [7] and Bjorn's early suggestion
- Expanded audience and added more mailing lists to get more review comments and feedback

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://stackoverflow.com/questions/4427542/how-to-do-sed-like-text-replace-with-python
[3] https://stackoverflow.com/questions/4146009/python-get-list-indexes-using-regular-expression
[4] https://stackoverflow.com/questions/10507230/insert-line-at-middle-of-file-with-python
[5] https://lore.kernel.org/lkml/[email protected]/
[6] https://lore.kernel.org/lkml/[email protected]/
[7] https://lore.kernel.org/lkml/[email protected]/

Guru Das Srinagesh (1):
scripts: Add add-maintainer.py

 MAINTAINERS               |   5 ++
 scripts/add-maintainer.py | 164 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 169 insertions(+)
 create mode 100755 scripts/add-maintainer.py
Signature · 7 lines
2.41.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel