From patchwork Fri Aug 15 03:59:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 380070 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id A5DA7140088 for ; Fri, 15 Aug 2014 14:00:27 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B51994B610; Fri, 15 Aug 2014 06:00:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BPkmKMxkk8Vt; Fri, 15 Aug 2014 06:00:18 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8AFBEA73E9; Fri, 15 Aug 2014 05:59:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6F9E84B14B for ; Fri, 15 Aug 2014 05:59:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RueEczJSuF91 for ; Fri, 15 Aug 2014 05:59:36 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-oi0-f73.google.com (mail-oi0-f73.google.com [209.85.218.73]) by theia.denx.de (Postfix) with ESMTPS id 109504A056 for ; Fri, 15 Aug 2014 05:59:26 +0200 (CEST) Received: by mail-oi0-f73.google.com with SMTP id u20so446460oif.0 for ; Thu, 14 Aug 2014 20:59:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UzeTPE2DF8cWfMPBNZI78ZE+Fk3mAJ6pXbEqDd3mkm4=; b=Yai1f6Fq23Y8rFWelcbiOFSDerEs+Z6E05QeXmP2sl515bPkEB/By6kY0CL5kt8CMh rhJKylZtlEk4Lo8kk52Vrby8VHFKGqW+n/biZ1J5HvytQ9AYgcEcwy/Dh9awC5QVaxrK BR6ylVOWn9NuOtBuNs4cvuHn5csBrx4e4su5+ouPbcT+H29e4Wdvgr5DKrwzAQI5OG/o oJdbV+BACB0tUG2R4JK8vhSs2OU+1tRYGjm9mFxfXZ79lVhY/q4CoDOSp/rLM9Mx8YW3 hKIslXPzsrEUeI2gRHGj8Hzg4GYJktxX0acRvBs8C9NMRbVHCpeqzbB13qXFgAl/ZABf 1q+w== X-Gm-Message-State: ALoCoQn1EuogtTVufFa6BhujRRlAzDvYcG8JTTkjlstFsjF9QYJJsC1vDU4jFsr7OtYwXJvQ/0Rz X-Received: by 10.182.142.135 with SMTP id rw7mr2372812obb.46.1408075164601; Thu, 14 Aug 2014 20:59:24 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id y50si512576yhk.4.2014.08.14.20.59.24 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Aug 2014 20:59:24 -0700 (PDT) Received: from kaki.bld.corp.google.com (kaki.bld.corp.google.com [172.29.216.32]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 66B9831C107; Thu, 14 Aug 2014 20:59:24 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id E97C72208C6; Thu, 14 Aug 2014 21:59:23 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Thu, 14 Aug 2014 21:59:14 -0600 Message-Id: <1408075156-6936-5-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 In-Reply-To: <1408075156-6936-1-git-send-email-sjg@chromium.org> References: <1408075156-6936-1-git-send-email-sjg@chromium.org> Cc: Tom Rini , u-boot-review@google.com, York Sun Subject: [U-Boot] [PATCH v8 4/6] patman: Remove the -a option X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de It seems that this is no longer needed, since checkpatch.pl will catch whitespace problems in patches. Also the option is not widely used, so it seems safe to just remove it. Suggested-by: Masahiro Yamada Signed-off-by: Simon Glass --- Changes in v8: None Changes in v7: None Changes in v6: - Add new patch to remove patman's -a option Changes in v5: None tools/patman/gitutil.py | 88 ------------------------------------------------- tools/patman/patman.py | 7 ---- 2 files changed, 95 deletions(-) diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index 29e6fdd..45276e6 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -215,94 +215,6 @@ def CreatePatches(start, count, series): else: return None, files -def ApplyPatch(verbose, fname): - """Apply a patch with git am to test it - - TODO: Convert these to use command, with stderr option - - Args: - fname: filename of patch file to apply - """ - col = terminal.Color() - cmd = ['git', 'am', fname] - pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - stdout, stderr = pipe.communicate() - re_error = re.compile('^error: patch failed: (.+):(\d+)') - for line in stderr.splitlines(): - if verbose: - print line - match = re_error.match(line) - if match: - print checkpatch.GetWarningMsg(col, 'warning', match.group(1), - int(match.group(2)), 'Patch failed') - return pipe.returncode == 0, stdout - -def ApplyPatches(verbose, args, start_point): - """Apply the patches with git am to make sure all is well - - Args: - verbose: Print out 'git am' output verbatim - args: List of patch files to apply - start_point: Number of commits back from HEAD to start applying. - Normally this is len(args), but it can be larger if a start - offset was given. - """ - error_count = 0 - col = terminal.Color() - - # Figure out our current position - cmd = ['git', 'name-rev', 'HEAD', '--name-only'] - pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE) - stdout, stderr = pipe.communicate() - if pipe.returncode: - str = 'Could not find current commit name' - print col.Color(col.RED, str) - print stdout - return False - old_head = stdout.splitlines()[0] - if old_head == 'undefined': - str = "Invalid HEAD '%s'" % stdout.strip() - print col.Color(col.RED, str) - return False - - # Checkout the required start point - cmd = ['git', 'checkout', 'HEAD~%d' % start_point] - pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - stdout, stderr = pipe.communicate() - if pipe.returncode: - str = 'Could not move to commit before patch series' - print col.Color(col.RED, str) - print stdout, stderr - return False - - # Apply all the patches - for fname in args: - ok, stdout = ApplyPatch(verbose, fname) - if not ok: - print col.Color(col.RED, 'git am returned errors for %s: will ' - 'skip this patch' % fname) - if verbose: - print stdout - error_count += 1 - cmd = ['git', 'am', '--skip'] - pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE) - stdout, stderr = pipe.communicate() - if pipe.returncode != 0: - print col.Color(col.RED, 'Unable to skip patch! Aborting...') - print stdout - break - - # Return to our previous position - cmd = ['git', 'checkout', old_head] - pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - stdout, stderr = pipe.communicate() - if pipe.returncode: - print col.Color(col.RED, 'Could not move back to head commit') - print stdout, stderr - return error_count == 0 - def BuildEmailList(in_list, tag=None, alias=None, raise_on_error=True): """Build a list of email addresses based on an input list. diff --git a/tools/patman/patman.py b/tools/patman/patman.py index c60aa5a..902fb36 100755 --- a/tools/patman/patman.py +++ b/tools/patman/patman.py @@ -25,9 +25,6 @@ import test parser = OptionParser() -parser.add_option('-a', '--no-apply', action='store_false', - dest='apply_patches', default=True, - help="Don't test-apply patches with git am") parser.add_option('-H', '--full-help', action='store_true', dest='full_help', default=False, help='Display the README file') parser.add_option('-c', '--count', dest='count', type='int', @@ -144,10 +141,6 @@ else: ok = checkpatch.CheckPatches(options.verbose, args) else: ok = True - if options.apply_patches: - if not gitutil.ApplyPatches(options.verbose, args, - options.count + options.start): - ok = False cc_file = series.MakeCcFile(options.process_tags, cover_fname, not options.ignore_bad_tags)