[Concept,33/37] patman: Add review and notes command-line arguments

Message ID 20260404213020.372253-34-sjg@u-boot.org
State New
Headers
Series patman: Autolink fixes and AI-assisted patch review |

Commit Message

Simon Glass April 4, 2026, 9:29 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

Add new arguments to the review subparser:
 - --gmail-account, --signoff, --spelling for draft creation
 - --learn-voice/--voice-count for voice profile learning
 - --sync for draft status synchronisation
 - -f/--force for re-reviewing completed series

Add series subcommands:
 - save-notes: store review-handling notes in the database
 - show-notes: display notes from all previous versions

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/patman/cmdline.py | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
  

Patch

diff --git a/tools/patman/cmdline.py b/tools/patman/cmdline.py
index bee9fd21483..cbb6e4742b7 100644
--- a/tools/patman/cmdline.py
+++ b/tools/patman/cmdline.py
@@ -324,6 +324,13 @@  def add_series_subparser(subparsers):
 
     series_subparsers.add_parser('rm')
 
+    snotes = series_subparsers.add_parser('save-notes')
+    snotes.add_argument(
+        'notes_file', nargs='?', default='review-notes.txt',
+        help='Path to the review notes file (default: review-notes.txt)')
+
+    series_subparsers.add_parser('show-notes')
+
     sup = series_subparsers.add_parser('set-upstream')
     sup.add_argument('upstream_name', nargs='?',
                      help='Name of the upstream for this series')
@@ -548,6 +555,9 @@  def add_review_subparser(subparsers):
     review.add_argument(
         '--create-drafts', action='store_true',
         help='Create Gmail draft emails for each review')
+    review.add_argument(
+        '--gmail-account', type=str, default=None,
+        help='Gmail account to create drafts in (e.g. user@gmail.com)')
     review.add_argument(
         '--no-cover', action='store_true',
         help='Skip reviewing the cover letter')
@@ -560,6 +570,29 @@  def add_review_subparser(subparsers):
     review.add_argument(
         '--apply-only', action='store_true',
         help='Only download and apply patches, skip AI review')
+    review.add_argument(
+        '--signoff', type=str, default='',
+        help="Sign-off for reviews with comments (from .patman settings)")
+    review.add_argument(
+        '--spelling', type=str, default='British',
+        help="Spelling convention for review comments (from .patman "
+             "settings)")
+    review.add_argument(
+        '--learn-voice', type=str, nargs='?', const='gmail',
+        choices=['gmail', 'patchwork'],
+        help="Analyse past reviews to build a voice profile "
+             "(from 'gmail' or 'patchwork', default: gmail)")
+    review.add_argument(
+        '--voice-count', type=int, default=20,
+        help='Number of review emails/comments to collect for '
+             '--learn-voice (default: 20)')
+    review.add_argument(
+        '--sync', action='store_true',
+        help='Check if review drafts have been sent and record the '
+             'final email content')
+    review.add_argument(
+        '-f', '--force', action='store_true',
+        help='Force re-review even if the series was already reviewed')
     return review