From patchwork Tue Nov 24 17:14:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Tomsich X-Patchwork-Id: 1405734 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=vrull-eu.20150623.gappssmtp.com header.i=@vrull-eu.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=ek8MyuBR; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cgb613J6cz9s0b for ; Wed, 25 Nov 2020 07:22:01 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7546E82607; Tue, 24 Nov 2020 21:21:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=vrull-eu.20150623.gappssmtp.com header.i=@vrull-eu.20150623.gappssmtp.com header.b="ek8MyuBR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C2085825D0; Tue, 24 Nov 2020 18:15:35 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CF86C825EC for ; Tue, 24 Nov 2020 18:15:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=philipp.tomsich@vrull.eu Received: by mail-lf1-x12a.google.com with SMTP id a9so29953801lfh.2 for ; Tue, 24 Nov 2020 09:15:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull-eu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=k++UjmnDi/rf7hTYKhSxis+B6iB594BvVN6nm6iFjSw=; b=ek8MyuBRhazNTHzGYUUHnTPagD6JIJSzI1gPM0NsMwFdb4YjEMwwdc+5fuonde7HU2 DrEfBvvtBlpP0V3FO1bFXfbsnBMLb7xcKhweZ68oY2N/3VtzjO/dWRexcWun+5GcPeH9 Lt9j+xxEZdrqSzWrMoP00kg6BHLQjntO8qhvX/l+c4A5HZpBinCve8c+AWDAauF4AkDW aPN2IPjokSajeF+bHAr0RMhmR/l1UilYJFwa5+nElMYIFi8g72Ge2p7pUh5El1oz9t3Q GKnmABF5stMUgzQdM3LkQ0Uy4EYt7Y+wMc6WZsUK98n5iMprhtduC0vyP8lOcv2mHwAt AL9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=k++UjmnDi/rf7hTYKhSxis+B6iB594BvVN6nm6iFjSw=; b=XvpLe3Z6MD4/S8Gup6CCKK1j/XDf0yFXRLpGmAQbyzjgz7RviOeyf+ZvtMEf7V6XWL dJ7VWrzV3/pPhQk2yfFldhzotjR6vfzbIWbjjPH8nhLZ8iX27WHuhrBZCTmseqpEGoHz waN6WJLH2Xz/FpVxFPFnyLvDqgekBXjri5q+3ETgkvhi+mMdFmSTF62nmzEPhisvb7eP yZ3MXDGlZE3sK9IY/jxsq3LDaX7w05u2+TcErdp7+xhdjleTv7EmqqHNoGBx0q5MgaP4 a0m4jTYA775qcep5qRbTLMa1K7cBGdsDIjUktiO5rU+pOcpOERvgvc0HmASoYLdioMtZ 7xsg== X-Gm-Message-State: AOAM530Z3tsyqUB8Eph07qTO69GO7+o+NHupmqjE+Z7E20ra83V9aGKh q4Sv8k4CpGW+AFvCrq1/lHgtOTbcd+vWuQ== X-Google-Smtp-Source: ABdhPJwzjVvsK1CJVlH8Ukwmq03FD98V+XjNr33Sv/++0qP56WRgiMpWbGgpak50yZ1kLISLg2niCQ== X-Received: by 2002:a19:bce:: with SMTP id 197mr2346642lfl.468.1606238109841; Tue, 24 Nov 2020 09:15:09 -0800 (PST) Received: from centos7.localdomain (static.214.61.181.135.clients.your-server.de. [135.181.61.214]) by smtp.gmail.com with ESMTPSA id x24sm393200ljj.112.2020.11.24.09.15.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Nov 2020 09:15:09 -0800 (PST) From: Philipp Tomsich To: u-boot@lists.denx.de Cc: Simon Glass , Philipp Tomsich Subject: [PATCH 1/3] patman: Add --no-signoff to suppress adding signoffs Date: Tue, 24 Nov 2020 18:14:52 +0100 Message-Id: <1606238094-28940-1-git-send-email-philipp.tomsich@vrull.eu> X-Mailer: git-send-email 1.8.3.1 X-Mailman-Approved-At: Tue, 24 Nov 2020 21:21:28 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean To enable use of patman with FSF/GNU projects, such as GCC or Binutils, no Signed-off-by may be added. This adds a command line flag '--no-signoff' to suppress adding signoffs in patman when processing commits. Signed-off-by: Philipp Tomsich Reviewed-by: Simon Glass Reviewed-by: Simon Glass --- tools/patman/control.py | 6 +++--- tools/patman/gitutil.py | 6 ++++-- tools/patman/main.py | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/patman/control.py b/tools/patman/control.py index 2330682..ee9717c 100644 --- a/tools/patman/control.py +++ b/tools/patman/control.py @@ -20,7 +20,7 @@ def setup(): """Do required setup before doing anything""" gitutil.Setup() -def prepare_patches(col, branch, count, start, end, ignore_binary): +def prepare_patches(col, branch, count, start, end, ignore_binary, signoff): """Figure out what patches to generate, then generate them The patch files are written to the current directory, e.g. 0001_xxx.patch @@ -56,7 +56,7 @@ def prepare_patches(col, branch, count, start, end, ignore_binary): to_do = count - end series = patchstream.get_metadata(branch, start, to_do) cover_fname, patch_files = gitutil.CreatePatches( - branch, start, to_do, ignore_binary, series) + branch, start, to_do, ignore_binary, series, signoff) # Fix up the patch files to our liking, and insert the cover letter patchstream.fix_patches(series, patch_files) @@ -163,7 +163,7 @@ def send(args): col = terminal.Color() series, cover_fname, patch_files = prepare_patches( col, args.branch, args.count, args.start, args.end, - args.ignore_binary) + args.ignore_binary, args.add_signoff) ok = check_patches(series, patch_files, args.check_patch, args.verbose) diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index 31fb3b2..5736d37 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -305,7 +305,7 @@ def PruneWorktrees(git_dir): if result.return_code != 0: raise OSError('git worktree prune: %s' % result.stderr) -def CreatePatches(branch, start, count, ignore_binary, series): +def CreatePatches(branch, start, count, ignore_binary, series, signoff = True): """Create a series of patches from the top of the current branch. The patch files are written to the current directory using @@ -323,7 +323,9 @@ def CreatePatches(branch, start, count, ignore_binary, series): """ if series.get('version'): version = '%s ' % series['version'] - cmd = ['git', 'format-patch', '-M', '--signoff'] + cmd = ['git', 'format-patch', '-M' ] + if signoff: + cmd.append('--signoff') if ignore_binary: cmd.append('--no-binary') if series.get('cover'): diff --git a/tools/patman/main.py b/tools/patman/main.py index 342fd44..c4e4d80 100755 --- a/tools/patman/main.py +++ b/tools/patman/main.py @@ -81,6 +81,8 @@ send.add_argument('--no-check', action='store_false', dest='check_patch', help="Don't check for patch compliance") send.add_argument('--no-tags', action='store_false', dest='process_tags', default=True, help="Don't process subject tags as aliases") +send.add_argument('--no-signoff', action='store_false', dest='add_signoff', + default=True, help="Don't add Signed-off-by to patches") send.add_argument('--smtp-server', type=str, help="Specify the SMTP server to 'git send-email'")