From 049b039de40fac19d02770b9fd31cfc4fe25bd5c Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Mon, 27 Jun 2022 15:07:09 -0400 Subject: Remove "b4 attest" subcommand We've deprecated "b4 attest" two versions ago, so remove it completely now. Everyone should use "patatt attest" instead. Signed-off-by: Konstantin Ryabitsev --- b4/attest.py | 32 -------------------------------- b4/command.py | 22 ---------------------- man/b4.5 | 25 ------------------------- man/b4.5.rst | 20 -------------------- 4 files changed, 99 deletions(-) delete mode 100644 b4/attest.py diff --git a/b4/attest.py b/b4/attest.py deleted file mode 100644 index a6acb28..0000000 --- a/b4/attest.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (C) 2020 by the Linux Foundation -# - -import sys -import b4 -import argparse -try: - import patatt - can_patatt = True -except ModuleNotFoundError: - can_patatt = False - -from collections import namedtuple - -logger = b4.logger - - -def attest_patches(cmdargs: argparse.Namespace) -> None: - if not can_patatt: - logger.critical('ERROR: b4 now uses patatt for patch attestation. See:') - logger.critical(' https://git.kernel.org/pub/scm/utils/patatt/patatt.git/about/') - sys.exit(1) - - # directly invoke cmd_sign in patatt - config = patatt.get_config_from_git(r'patatt\..*', multivals=['keyringsrc']) - fakeargs = namedtuple('Struct', ['hookmode', 'msgfile']) - fakeargs.hookmode = True - fakeargs.msgfile = cmdargs.patchfile - patatt.cmd_sign(fakeargs, config) diff --git a/b4/command.py b/b4/command.py index d746efb..0338c0d 100644 --- a/b4/command.py +++ b/b4/command.py @@ -81,15 +81,6 @@ def cmd_shazam(cmdargs): b4.mbox.main(cmdargs) -def cmd_attest(cmdargs): - import b4.attest - if len(cmdargs.patchfile): - b4.attest.attest_patches(cmdargs) - else: - logger.critical('ERROR: missing patches to attest') - sys.exit(1) - - def cmd_pr(cmdargs): import b4.pr b4.pr.main(cmdargs) @@ -164,19 +155,6 @@ def cmd(): '(default: 3 weeks)')) sp_sh.set_defaults(func=cmd_shazam) - # b4 attest - sp_att = subparsers.add_parser('attest', help='(DEPRECATED) Create cryptographic attestation for a set of patches') - sp_att.add_argument('-f', '--from', dest='sender', default=None, - help='OBSOLETE: this option does nothing and will be removed') - sp_att.add_argument('-n', '--no-submit', dest='nosubmit', action='store_true', default=False, - help='OBSOLETE: this option does nothing and will be removed') - sp_att.add_argument('-o', '--output', default=None, - help='OBSOLETE: this option does nothing and will be removed') - sp_att.add_argument('-m', '--mutt-filter', default=None, - help='OBSOLETE: this option does nothing and will be removed') - sp_att.add_argument('patchfile', nargs='*', help='Patches to attest') - sp_att.set_defaults(func=cmd_attest) - # b4 pr sp_pr = subparsers.add_parser('pr', help='Fetch a pull request found in a message ID') sp_pr.add_argument('-g', '--gitdir', default=None, diff --git a/man/b4.5 b/man/b4.5 index 86c5277..66236cc 100644 --- a/man/b4.5 +++ b/man/b4.5 @@ -58,8 +58,6 @@ precursor to Lore and Data in the Star Trek universe. \fIty\fP: Create templated replies for processed patches and pull requests .IP \(bu 2 \fIkr\fP (EXPERIMENTAL) Operate on patatt\-compatible keyrings -.IP \(bu 2 -\fIattest\fP: (DEPRECATED) Add cryptographic attestation to patches .UNINDENT .SH OPTIONS .INDENT 0.0 @@ -320,29 +318,6 @@ Attempt to merge series as if it were a pull request (execs git\-merge) .UNINDENT .sp \fIExample\fP: b4 shazam \-H \fI\%20200313231252.64999\-1\-keescook@chromium.org\fP -.SS b4 attest -.sp -\fBNOTE:\fP -.INDENT 0.0 -.INDENT 3.5 -\fBThis subcommand is deprecated and will be removed in a future -version of b4.\fP -.sp -This functionality is now implemented via an auxiliary library called -"patatt". You may instead install and use patatt directly with the -same results. -.UNINDENT -.UNINDENT -.INDENT 0.0 -.TP -.B usage: -b4 attest [\-h] patchfile [patchfile ...] -.TP -.B positional arguments: -patchfile Patches to attest -.UNINDENT -.sp -\fIExample\fP: b4 attest outgoing/*.patch .SS b4 pr .sp This command is for working with pull requests submitted using diff --git a/man/b4.5.rst b/man/b4.5.rst index d4a26de..dd8ea29 100644 --- a/man/b4.5.rst +++ b/man/b4.5.rst @@ -34,7 +34,6 @@ SUBCOMMANDS * *diff*: Show range-diff style diffs between patch versions * *ty*: Create templated replies for processed patches and pull requests * *kr* (EXPERIMENTAL) Operate on patatt-compatible keyrings -* *attest*: (DEPRECATED) Add cryptographic attestation to patches OPTIONS ------- @@ -214,25 +213,6 @@ options: *Example*: b4 shazam -H 20200313231252.64999-1-keescook@chromium.org -b4 attest -~~~~~~~~~ -.. note:: - - **This subcommand is deprecated and will be removed in a future - version of b4.** - - This functionality is now implemented via an auxiliary library called - "patatt". You may instead install and use patatt directly with the - same results. - -usage: - b4 attest [-h] patchfile [patchfile ...] - -positional arguments: - patchfile Patches to attest - -*Example*: b4 attest outgoing/\*.patch - b4 pr ~~~~~ This command is for working with pull requests submitted using -- cgit v1.2.3