From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [PATCH] scripts: show full headline with checkpatch Date: Sat, 5 Nov 2016 16:28:14 +0100 Message-ID: <1478359694-13420-1-git-send-email-thomas.monjalon@6wind.com> To: dev@dpdk.org Return-path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 849B52A07 for ; Sat, 5 Nov 2016 16:28:37 +0100 (CET) Received: by mail-wm0-f44.google.com with SMTP id a197so104051281wmd.0 for ; Sat, 05 Nov 2016 08:28:37 -0700 (PDT) Received: from XPS13.localdomain (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id c4sm2783757wmh.4.2016.11.05.08.28.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 05 Nov 2016 08:28:36 -0700 (PDT) List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The Subject in an email can be split on two lines. In such case, the second line (starting with a space) can be joined to the first one. It is handled differently when parsing stdin or a file. Signed-off-by: Thomas Monjalon --- scripts/checkpatches.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatches.sh b/scripts/checkpatches.sh index 619ac21..2f67d24 100755 --- a/scripts/checkpatches.sh +++ b/scripts/checkpatches.sh @@ -101,13 +101,16 @@ check () { # if [ -n "$1" ] ; then for patch in "$@" ; do - subject=$(sed -n 's,^Subject: ,,p' "$patch") + # Subject can be on 2 lines + subject=$(sed '/^Subject: */!d;s///;N;s,\n[[:space:]]\+, ,;s,\n.*,,;q' "$patch") check "$patch" '' "$subject" done elif [ ! -t 0 ] ; then # stdin subject=$(while read header value ; do if [ "$header" = 'Subject:' ] ; then - echo $value + IFS= read next + continuation=$(echo "$next" | sed -n 's,^[[:space:]]\+, ,p') + echo $value$continuation break fi done) -- 2.7.0