From patchwork Mon Jan 21 16:48:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 214226 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B2B202C0082 for ; Tue, 22 Jan 2013 03:49:18 +1100 (EST) Received: from localhost ([::1]:36411 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxKYe-0004gc-Tu for incoming@patchwork.ozlabs.org; Mon, 21 Jan 2013 11:49:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxKYW-0004gG-9s for qemu-devel@nongnu.org; Mon, 21 Jan 2013 11:49:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxKYV-00034g-4h for qemu-devel@nongnu.org; Mon, 21 Jan 2013 11:49:08 -0500 Received: from e35.co.us.ibm.com ([32.97.110.153]:60747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxKYU-00033g-UF for qemu-devel@nongnu.org; Mon, 21 Jan 2013 11:49:07 -0500 Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 21 Jan 2013 09:49:05 -0700 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 21 Jan 2013 09:49:02 -0700 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id EAB223E40045 for ; Mon, 21 Jan 2013 09:48:54 -0700 (MST) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r0LGn0Ka193026 for ; Mon, 21 Jan 2013 09:49:00 -0700 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r0LGmviw003516 for ; Mon, 21 Jan 2013 09:48:57 -0700 Received: from titi.austin.rr.com (sig-9-65-136-57.mts.ibm.com [9.65.136.57]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r0LGmutD003376; Mon, 21 Jan 2013 09:48:56 -0700 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Mon, 21 Jan 2013 10:48:56 -0600 Message-Id: <1358786936-14818-1-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.8.0 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13012116-4834-0000-0000-000002D480EF X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.97.110.153 Cc: Blue Swirl , Anthony Liguori Subject: [Qemu-devel] [PATCH] checkpatch: add a little script to run checkpatch against a git refspec X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This makes it easier to use checkpatch with a git hook or via patches. Signed-off-by: Anthony Liguori --- scripts/check-patches.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 scripts/check-patches.sh diff --git a/scripts/check-patches.sh b/scripts/check-patches.sh new file mode 100755 index 0000000..5a693fe --- /dev/null +++ b/scripts/check-patches.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# +# checkpatch helper - run checkpatch against each commit given a refspec +# +# Copyright IBM, Corp. 2013 +# +# Authors: +# Anthony Liguori +# +# This work is licensed under the terms of the GNU GPLv2 or later. +# See the COPYING file in the top-level directory. + +if test -z "$1"; then + echo "Usage: $0 REFSPEC" + exit 1 +fi + +git log --format="%H" "$@" | while read commit; do + git show --format=email $commit | scripts/checkpatch.pl - + rc=$? + if test $rc -ne 0; then + exit $rc + fi +done