Skip to contentSkip to conversation

'patman' patch generation, checking and submission script

PATCH New Simon Glass 2 participants 4 messages Nov 30, 2011 – Jan 8, 2012

lore
Share & tools
lore
#0 lore raw

v3 cover 'patman' patch generation, checking and submission script

What is this?
=============

This tool is a Python script which:
- Creates patch directly from your branch
- Cleans them up by removing unwanted tags
- Inserts a cover letter with change lists
- Runs the patches through checkpatch.pl and its own checks
- Optionally emails them out to selected people

It is intended to automate patch creation and make it a less error-prone process. It is useful for U-Boot and Linux work so far, since it uses the checkpatch.pl script.

It is configured almost entirely by tags it finds in your commits. This means that you can work on a number of different branches at once, and keep the settings with each branch rather than having to git format-patch, git send-email, etc. with the correct parameters each time. So for example if you put:

Series-to: fred.blogs at napier.co.nz

in one of your commits, the series will be sent there.

See the README file for full details.

Changes in v2:
- Fix up use of Color in series.py (avoid runtime error)

Changes in v3:
- Use -M with git format-patch to so that file moves are tracked
- Fix generation of cc list to match patch names correctly
- Change cc-list tmpfile name to start with patman
- Support git's alias file if found in config sendemail.aliasesfile
- Support recursive aliases
- Use @{upstream} instead of the previous mess (thanks Anton Staff)
- Find checkpatch.pl in U-Boot tree
- Expand the README to include info about suggested workflow
- Add option to display the README
- Add a few more tests (but still very incomplete)
- Tidy up gitutil and settings to separate code better

Simon Glass (1):
Add 'patman' patch generation, checking and submission script

 tools/scripts/patman/.gitignore     |    1 +
 tools/scripts/patman/README         |  408 ++++++++++++++++++++++++++++++++
 tools/scripts/patman/checkpatch.py  |  161 +++++++++++++
 tools/scripts/patman/command.py     |   72 ++++++
 tools/scripts/patman/commit.py      |   81 +++++++
 tools/scripts/patman/gitutil.py     |  369 +++++++++++++++++++++++++++++
 tools/scripts/patman/patchstream.py |  437 +++++++++++++++++++++++++++++++++++
 tools/scripts/patman/patman         |    1 +
 tools/scripts/patman/patman.py      |  151 ++++++++++++
 tools/scripts/patman/series.py      |  229 ++++++++++++++++++
 tools/scripts/patman/settings.py    |   81 +++++++
 tools/scripts/patman/terminal.py    |   86 +++++++
 tools/scripts/patman/test.py        |  250 ++++++++++++++++++++
 13 files changed, 2327 insertions(+), 0 deletions(-)
 create mode 100644 tools/scripts/patman/.gitignore
 create mode 100644 tools/scripts/patman/README
 create mode 100644 tools/scripts/patman/checkpatch.py
 create mode 100644 tools/scripts/patman/command.py
 create mode 100644 tools/scripts/patman/commit.py
 create mode 100644 tools/scripts/patman/gitutil.py
 create mode 100644 tools/scripts/patman/patchstream.py
 create mode 120000 tools/scripts/patman/patman
 create mode 100755 tools/scripts/patman/patman.py
 create mode 100644 tools/scripts/patman/series.py
 create mode 100644 tools/scripts/patman/settings.py
 create mode 100644 tools/scripts/patman/terminal.py
 create mode 100644 tools/scripts/patman/test.py
Signature · 1 line
1.7.3.1
#1 lore raw

PATCH v3 1/1 Add 'patman' patch generation, checking and submission script

This is a script for automating submission of patches to the U-Boot mailing list.

---
Changes in v2:
- Fix up use of Color in series.py (avoid runtime error)

Changes in v3:
- Use -M with git format-patch to so that file moves are tracked
- Fix generation of cc list to match patch names correctly
- Change cc-list tmpfile name to start with patman
- Support git's alias file if found in config sendemail.aliasesfile
- Support recursive aliases
- Use @{upstream} instead of the previous mess (thanks Anton Staff)
- Find checkpatch.pl in U-Boot tree
- Expand the README to include info about suggested workflow
- Add option to display the README
- Add a few more tests (but still very incomplete)
- Tidy up gitutil and settings to separate code better

 tools/scripts/patman/.gitignore     |    1 +
 tools/scripts/patman/README         |  408 ++++++++++++++++++++++++++++++++
 tools/scripts/patman/checkpatch.py  |  161 +++++++++++++
 tools/scripts/patman/command.py     |   72 ++++++
 tools/scripts/patman/commit.py      |   81 +++++++
 tools/scripts/patman/gitutil.py     |  369 +++++++++++++++++++++++++++++
 tools/scripts/patman/patchstream.py |  437 +++++++++++++++++++++++++++++++++++
 tools/scripts/patman/patman         |    1 +
 tools/scripts/patman/patman.py      |  151 ++++++++++++
 tools/scripts/patman/series.py      |  229 ++++++++++++++++++
 tools/scripts/patman/settings.py    |   81 +++++++
 tools/scripts/patman/terminal.py    |   86 +++++++
 tools/scripts/patman/test.py        |  250 ++++++++++++++++++++
 13 files changed, 2327 insertions(+), 0 deletions(-)
 create mode 100644 tools/scripts/patman/.gitignore
 create mode 100644 tools/scripts/patman/README
 create mode 100644 tools/scripts/patman/checkpatch.py
 create mode 100644 tools/scripts/patman/command.py
 create mode 100644 tools/scripts/patman/commit.py
 create mode 100644 tools/scripts/patman/gitutil.py
 create mode 100644 tools/scripts/patman/patchstream.py
 create mode 120000 tools/scripts/patman/patman
 create mode 100755 tools/scripts/patman/patman.py
 create mode 100644 tools/scripts/patman/series.py
 create mode 100644 tools/scripts/patman/settings.py
 create mode 100644 tools/scripts/patman/terminal.py
 create mode 100644 tools/scripts/patman/test.py
tools/scripts/patman/.gitignore new file +1 -0
new file mode 100644
index 0000000..0d20b64
@@ -0,0 +1 @@
+*.pyc
tools/scripts/patman/README new file +408 -0

408 lines not on this page · raw message

tools/scripts/patman/checkpatch.py new file +161 -0

161 lines not on this page · raw message

tools/scripts/patman/command.py new file +72 -0

72 lines not on this page · raw message

tools/scripts/patman/commit.py new file +81 -0

81 lines not on this page · raw message

tools/scripts/patman/gitutil.py new file +369 -0

369 lines not on this page · raw message

tools/scripts/patman/patchstream.py new file +437 -0

437 lines not on this page · raw message

tools/scripts/patman/patman new file +1 -0
new file mode 120000
index 0000000..6cc3d7a
@@ -0,0 +1 @@
+patman.py
\ No newline at end of file
tools/scripts/patman/patman.py new file +151 -0

151 lines not on this page · raw message

tools/scripts/patman/series.py new file +229 -0

229 lines not on this page · raw message

tools/scripts/patman/settings.py new file +81 -0

81 lines not on this page · raw message

tools/scripts/patman/terminal.py new file +86 -0

86 lines not on this page · raw message

tools/scripts/patman/test.py new file +250 -0

250 lines not on this page · raw message

Signature · 1 line
1.7.3.1
#2 lore raw

PATCH v3 1/1 Add 'patman' patch generation, checking and submission script

Quoted 1 line · On Tuesday 29 November 2011 21:35:46 Simon Glass wrote:
 tools/scripts/patman/.gitignore     |    1 +

seems like tools/patman/ would be better. i wonder if anyone else here uses it and so would be useful for actually committing ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120108/2ca81620/attachment.pgp>

#3 lore raw

PATCH v3 1/1 Add 'patman' patch generation, checking and submission script

Hi Mike,

Quoted 6 lines · Mike Frysinger
Quoted 1 line · On Tuesday 29 November 2011 21:35:46 Simon Glass wrote:

?tools/scripts/patman/.gitignore ? ? | ? ?1 +

seems like tools/patman/ would be better. ?i wonder if anyone else here uses it and so would be useful for actually committing ...
-mike

OK, I will update it. I have a few more fixes anyway.

I know it is used by a few people, but I suppose it is much easier to use if it is actually in the tree. It probably has some rough edges that will only come out when more people use it. But it is most useful for those with patcharrohea particularly when you have several series in progress.

Regards,
Simon