From patchwork Thu Jun 8 12:39:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Angel Ajo X-Patchwork-Id: 773025 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wk4kw0KV9z9s71 for ; Thu, 8 Jun 2017 22:40:08 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 94F3BC1E; Thu, 8 Jun 2017 12:39:39 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 6593CC07 for ; Thu, 8 Jun 2017 12:39:38 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id CFD7313D for ; Thu, 8 Jun 2017 12:39:37 +0000 (UTC) Received: by mail-wm0-f45.google.com with SMTP id d73so30138505wma.0 for ; Thu, 08 Jun 2017 05:39:37 -0700 (PDT) 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:in-reply-to :references; bh=XGH7CzivFxe3k3Oqxy/0/hY33lfEjh0BKsI0aCxQrRs=; b=Wrh2TGzynNIe3vX12319mJk5yuk/LDK0ivdWALkK4S33qHJJqYl63UlVtPqI+ZImN5 PfKfQcyQe4mj3fzJVrOWU6dmQkgxXmHWo0gkiGBFBmW6HXvxmD27Tp1zSBvinhBHRPmG xYTIIVz9DFDbO24rN+23EYe0L+/uJj/Fr8uibSdGQCpLpWZsB8ywMWnYKVzxOxhUa74E AQ0RhRHxOdfp5OgcYj+ZFXjFgTs4wLifDaDY1wWqw3PYqx5UWSj58w+I/rfXtTHILP7V mr43vYJK+ICXUtffwDeyQAC/ilOf+RCKs+DJwQeqmPfyT9ojq5NSYw7YkKCfkAxhmcUR ATEg== X-Gm-Message-State: AODbwcDWHLQwLI64oqfMzzDmmgv+RhFMr5Z7QTNXzmXXWz7vMlu2X8Aj m2+pN/++wQoiPDASXrjANA== X-Received: by 10.28.238.213 with SMTP id j82mr3267923wmi.33.1496925576272; Thu, 08 Jun 2017 05:39:36 -0700 (PDT) Received: from gw1.localdomain (111.148.134.37.dynamic.jazztel.es. [37.134.148.111]) by smtp.gmail.com with ESMTPSA id e21sm6903653wma.24.2017.06.08.05.39.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 05:39:35 -0700 (PDT) From: majopela@redhat.com To: dev@openvswitch.org Date: Thu, 8 Jun 2017 12:39:27 +0000 Message-Id: <1496925567-11752-2-git-send-email-majopela@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1496925567-11752-1-git-send-email-majopela@redhat.com> References: <1496925567-11752-1-git-send-email-majopela@redhat.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Miguel Angel Ajo Subject: [ovs-dev] [PATCH] Add a git-checkpatches script X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Miguel Angel Ajo This utility script exports the on the tail of your current branch, and runs utilities/checkpatch.py on each of them. Signed-off-by: Miguel Angel Ajo --- utilities/git-checkpatches | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 utilities/git-checkpatches diff --git a/utilities/git-checkpatches b/utilities/git-checkpatches new file mode 100755 index 0000000..d25f41f --- /dev/null +++ b/utilities/git-checkpatches @@ -0,0 +1,26 @@ +#!/bin/sh + +# usage: git-checkpatches [number of patches] +# +# this script can be used to pass checkpatch on a set of patches +# of your git history +# + +# just one patch by default +PATCHES=${1:-1} + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +TMPDIR=$(mktemp -d) + +git_span="HEAD~$PATCHES..HEAD" + +echo "Checking patches $git_span" + +git format-patch -n $git_span -o $TMPDIR +for patch in $TMPDIR/*.patch; do + echo "Checking patch $patch ========================" + $DIR/checkpatch.py $patch + echo "" +done + +rm -rf $TMPDIR