From patchwork Tue May 12 07:27:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 471163 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CC73A1400A0 for ; Tue, 12 May 2015 17:29:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ksAw4oVE; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=X6ISerK0WJD6SB7/PTb62KahjJTvPP6NXXf3X3qbrA+oxL HdGR6ju8+MUBWJRinUXTQnn8I5c4EMzI3mcz+1yqq3lRXXHvu/t8Z89FNyE51YWK rX4X0YhQ0WF74whHun0SMoorVA1G4wYAsEjGwnoxiHyox79kPoBGTsmqJddhU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=o/p4e35/URbWGHzXCN83GLLJsRg=; b=ksAw4oVEYlc6n+muxgVy ULGPtlMOB+Anh3gltfK2BYFCRfyzf9cMKci+KyOej2Ob92CjqjAEf3B/plcqyHP6 ZbsTOjx9sFO7rhHqu5ASWw8F7NIv32I2x4vOAtVo9V1a8H0cp9tbPgvUw0k2EawZ UboxpJM+BufzsR66am73CkU= Received: (qmail 42887 invoked by alias); 12 May 2015 07:28:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 42851 invoked by uid 89); 12 May 2015 07:28:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 May 2015 07:28:42 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Ys4cI-0000LF-T6 from Tom_deVries@mentor.com for gcc-patches@gcc.gnu.org; Tue, 12 May 2015 00:28:39 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.224.2; Tue, 12 May 2015 08:27:27 +0100 Message-ID: <5551AB5D.3070409@mentor.com> Date: Tue, 12 May 2015 09:27:25 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: GCC Patches Subject: [PATCH, 1/5] check_GNU_style.sh: Don't use filename prefix for one patch Hi, this patch makes sure that we don't print the patch filename in front of the error messages, if we're checking just one file. Making the lines shorter makes things easier to read. And since we're only processing one file, there's no information lost. OK for trunk? Thanks, - Tom [PATCH 1/5] check_GNU_style.sh: Don't use filename prefix for one patch 2015-05-11 Tom de Vries * check_GNU_style.sh: Don't use a filename prefix if we're only processing one patch file. --- contrib/check_GNU_style.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh index e8d5dca..eeff48f 100755 --- a/contrib/check_GNU_style.sh +++ b/contrib/check_GNU_style.sh @@ -36,6 +36,8 @@ EOF } test $# -eq 0 && usage +nfiles=$# +files="$*" inp=check_GNU_style.inp tmp=check_GNU_style.tmp @@ -44,9 +46,15 @@ tmp=check_GNU_style.tmp trap "rm -f $inp $tmp" 0 trap "rm -f $inp $tmp ; exit 1" 1 2 3 5 9 13 15 -grep -nH '^+' $* \ - | grep -v ':+++' \ - > $inp +if [ $nfiles -eq 1 ]; then + # There's no need for the file prefix if we're dealing only with one file. + format="-n" +else + format="-nH" +fi +grep $format '^+' $files \ + | grep -v ':+++' \ + > $inp # Grep g (){ -- 1.9.1