From a2f81bdad0c4a3cbc2dca4e78424030310219ba4 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Fri, 15 Jul 2022 16:15:00 -0400 Subject: Initial implementation of b4 submit This is the first rough implementation of "b4 submit". Currently implemented: - b4 submit --new : to start a new branch - b4 submit --edit-cover : to edit the cover message - b4 submit --update-trailers : to receive latest trailer updates from the mailing lists - b4 submit --send : sends the messages using existing git.sendemail configs For details, see "b4 submit --help". Signed-off-by: Konstantin Ryabitsev --- b4/command.py | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'b4/command.py') diff --git a/b4/command.py b/b4/command.py index 6a29f0a..49ce767 100644 --- a/b4/command.py +++ b/b4/command.py @@ -71,6 +71,11 @@ def cmd_kr(cmdargs): b4.kr.main(cmdargs) +def cmd_submit(cmdargs): + import b4.submit + b4.submit.main(cmdargs) + + def cmd_am(cmdargs): import b4.mbox b4.mbox.main(cmdargs) @@ -235,6 +240,53 @@ def cmd(): help='Show all developer keys found in a thread') sp_kr.set_defaults(func=cmd_kr) + # b4 submit + sp_submit = subparsers.add_parser('submit', help='Submit patches for review') + # xg_submit = sp_submit.add_mutually_exclusive_group() + # xg_submit.add_argument('--web-auth-new', action='store_true', default=False, + # help='Register a new email and pubkey with a web submission endpoint') + # xg_submit.add_argument('--web-auth-verify', + # help='Submit a response to a challenge received from a web submission endpoint') + sp_submit.add_argument('--edit-cover', action='store_true', default=False, + help='Edit the cover letter in your defined $EDITOR (or core.editor)') + sp_submit.add_argument('--reroll', action='store_true', default=False, + help='Increment revision and add changelog templates to the cover letter') + nn_submit = sp_submit.add_argument_group('New series', 'Set up a new work branch for a new patch series') + nn_submit.add_argument('-n', '--new', dest='new_series_name', + help='Create a new branch and start working on new series') + nn_submit.add_argument('-f', '--fork-point', dest='fork_point', + help='Create new branch at this fork point instead of HEAD') + ag_submit = sp_submit.add_argument_group('Sync trailers', 'Update series with latest received trailers') + ag_submit.add_argument('-u', '--update-trailers', action='store_true', default=False, + help='Update commits with latest received trailers') + ag_submit.add_argument('-s', '--signoff', action='store_true', default=False, + help='Add my Signed-off-by trailer, if not already present') + ag_submit.add_argument('-S', '--sloppy-trailers', dest='sloppytrailers', action='store_true', default=False, + help='Apply trailers without email address match checking') + ag_submit.add_argument('-F', '--trailers-from', dest='thread_msgid', + help='Look for new trailers in the thread with this msgid instead of using the change-id') + se_submit = sp_submit.add_argument_group('Send series', 'Submits your series for review') + se_submit.add_argument('--send', action='store_true', default=False, + help='Submit the series for review') + se_submit.add_argument('-d', '--dry-run', dest='dryrun', action='store_true', default=False, + help='Do not actually send, just dump out raw smtp messages to the stdout') + se_submit.add_argument('-o', '--output-dir', + help='Do not send, just write patches into this directory (git-format-patch mode)') + se_submit.add_argument('--prefixes', nargs='+', choices=['RFC', 'WIP', 'RESEND'], + help='Prefixes to add to PATCH (e.g. RFC, WIP, RESEND)') + se_submit.add_argument('--no-auto-to-cc', action='store_true', default=False, + help='Do not automatically collect To: and Cc: addresses') + se_submit.add_argument('--to', nargs='+', + help='Addresses to add to the automatically collected To: list') + se_submit.add_argument('--cc', nargs='+', + help='Addresses to add to the automatically collected Cc: list') + se_submit.add_argument('--not-me-too', action='store_true', default=False, + help='Remove yourself from the To: or Cc: list') + se_submit.add_argument('--no-sign', action='store_true', default=False, + help='Do not cryptographically sign your patches with patatt') + + sp_submit.set_defaults(func=cmd_submit) + cmdargs = parser.parse_args() logger.setLevel(logging.DEBUG) -- cgit v1.2.3