From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=mJoIhxZRELYaAh5vx/fZdNNhmW4YflwRB3Une4M/lLI=; b=D0Y1JqXhFY+vx3bgRZP9Xll4MX6DmsDZdlpDllIzN/oxUzPIaqQz+JYvn437Vj02Wq wHlwd2rUzOcNvR0zUz5x9BXyemRf0uO1fP982wEyAUnTWVSh5Y+0eDx1kIpcNqR0pJsL ZiutoCcniRDNtwVKKVIZmvsmzdSDEs6OuAoQ4YdC6Kio/eMJjsHo7J8w1+7a1vQMTDU7 KxBTMuaUlqMVLF6XpcLoFMpEFuv3z6AQjbuc4q1v8HN0jPTATqSUZoJ6AK5H6G3bE0wM cTV/JFVMntV07zMGJ6/keta8j3o6xm/53k3CKNZBEyXi+XVLbeu1snvZy5vkS5js6W38 mEdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=mJoIhxZRELYaAh5vx/fZdNNhmW4YflwRB3Une4M/lLI=; b=lA9QBIA0qr1o4jj2GLrwccVbmNL4ZJnXCkCAdenNLExFeP3s00CzRfHOiXi19aC/He f/+uJInQ+9wCIONsq66zrPm44zVzALZ/5X52Q477fKEbaI+yLjoRV62jSG163sTiT8j7 8uOit1a8Kx4wVZTx2s8uC86EO6uhobuSVgtN7l5uf/nkJygrQQokdib+9fRZAI/X44mE Fqqu8mbEZlE55G2c8yT+/I+SZ8Beq605Qv72UEb3nZXKLA4pDDibVe6MGrk+jAQ0KVhZ X32Pe5OW0l5tCwPyvN5zxb4iBr2CR0/vvIYQSgLTFnkxP6xfLp81Rn7u+QXtHTcV675Y e9CA== X-Gm-Message-State: ABUngvfWqW+PDKlORb8NfJxpI4mKlK0UcK6jgZWqhJV7jcH62bwhajQ5s/A+MxrCEh+zNJ+/ X-Received: by 10.194.142.45 with SMTP id rt13mr7540955wjb.22.1478359717095; 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) From: Thomas Monjalon To: dev@dpdk.org Date: Sat, 5 Nov 2016 16:28:14 +0100 Message-Id: <1478359694-13420-1-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.7.0 Subject: [dpdk-dev] [PATCH] scripts: show full headline with checkpatch X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Nov 2016 15:28:37 -0000 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