From patchwork Wed Jul 26 10:27:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 108752 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp649548obm; Wed, 26 Jul 2017 03:28:04 -0700 (PDT) X-Received: by 10.84.254.78 with SMTP id a14mr434567pln.69.1501064884343; Wed, 26 Jul 2017 03:28:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501064884; cv=none; d=google.com; s=arc-20160816; b=h8qu+D0zDqx0oWDoIA5wU7/OVtymfLHo/8O6OvBRaoSoX//+N5aS5WhiyKNWi0z5d8 56NrZBbDoHp082adW1kgKYRRfIGlym/MlQygfiK+pKgPMa8tnWGyrFfU+6wzux1bgLG5 7goZQ5Tc1hvOz1XfSIAv0zUc9wQAb2D70osXU5Ldr5PpzRZn/CyRfMJFNBIF9xCC+i4e RyBx6L3K6MrVRDnNKb6+vWwQpKOaNa6DKYSDLaxPd+H3t2jrZ8KNTWqttFg0gfcW/Sii A76V+4iobs8oJH3gnJQgDlWusPODY2nF4ahb7Wj/FO3Y0JM5WwAjxdJnRjVEp6sZXEZN 70iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:message-id:date:subject:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=qsgJrgJGWEvpfb3V3ekUnSlQiViEbZiu0QXZrBJE+ys=; b=CAmwRCdJB6Ru+kKmZwV9PjhMcxwTgu2Hf/uXRhGwugVdf5uxnHBNPi85OlP8D2b5kZ OP1ekV8hd9ouCuDQOnBFXA9Ht6DW8Hp/6oP/RcsXy46M5dJc1Aqnmne82JdGXXWIR7BQ LryGwnlJYjntI/urrpDbv5ijiLGHDmPDflDJYm619q+VB9UCmAuWk/NF4LPIdYWA/o+Z 8ylVgT9zQrjqoFvdUiTF2qLILdFc4RCb6f7L8tCXHxx9GPYC+DADiZrxSlJstX3a6ece 2DwkQrFizY3ypWbzP8hAL8ilRr7NW1cuImZvf2q5OusiysZ8TSuD+5bAKhPXmDRtyhyc L6ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=HFRZiakL; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id b8si9357070pfl.282.2017.07.26.03.28.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Jul 2017 03:28:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=HFRZiakL; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 296B16E6CE; Wed, 26 Jul 2017 10:27:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) by gabe.freedesktop.org (Postfix) with ESMTPS id 342546E6CE for ; Wed, 26 Jul 2017 10:27:30 +0000 (UTC) Received: by mail-wm0-x233.google.com with SMTP id t201so68355056wmt.1 for ; Wed, 26 Jul 2017 03:27:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=A/M3JFFl4LUHPUoeZ98sDZhvl1nxL+YiLkli74mJlJU=; b=HFRZiakLNMW/JmErZMzkoRgnsJz6K7bCPxVN4qQtyENQPNybLF0gl76W/t5MQbeBGO XMEJ7rTfaFQvj78Cs4LDnzerEnryuLq3MivSJ2lkTzCJO/hofnP83W152VKaqrlmjSiC g2reX8E32jvIb9c/bV1MFXKGltKp67GNBcX/0= 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; bh=A/M3JFFl4LUHPUoeZ98sDZhvl1nxL+YiLkli74mJlJU=; b=TyG3AtE6iIvzTQ5BSLRs4IUue70e8okDIaZWEz3DVvlb4n2hEy2mpsr1W1Ks+HmN9X E0pahoDxKVid7xqe6TYG9ZsQWljOQeNQeM/HLaIbOVdqwmkL/BYYbZXzVlNGYZVRbgno JG0vsjjaotIYQKmSBDEoCPoKaQsCjw4gmTJeEAkv7s9XzOqgdZYktY+N6dSuGxGnaiXS EC94romWAutM7iKaGKP5g0SqdCHNkJMsAwUp3nfF+czZpHqJ4X6EYCPPP/ZwB1kXKcpG +bnhuDSr6qtZbbMGNeLzaTAXeH5XJR4yn1GCp55EnqMK1dycXEVBZxRutQ7tLste6Kl/ YIpA== X-Gm-Message-State: AIVw113dnqi4daOywlA95SXCzdV+9f/qSlUoMyruJl3tGiYx1pDfV6r4 Dhu1choIcuMyFC1CjHW0H3zS X-Received: by 10.28.54.214 with SMTP id y83mr363687wmh.103.1501064848534; Wed, 26 Jul 2017 03:27:28 -0700 (PDT) Received: from lmenx321.lme.st.com. ([80.215.134.35]) by smtp.gmail.com with ESMTPSA id x98sm31228072wrb.47.2017.07.26.03.27.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Jul 2017 03:27:28 -0700 (PDT) From: Benjamin Gaignard To: dri-devel@lists.freedesktop.org, daniel.vetter@ffwll.ch Subject: [PATCH] dim: add checks for author and committer sign-off-by Date: Wed, 26 Jul 2017 12:27:11 +0200 Message-Id: <1501064831-23404-1-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Rework checkpatch_commit_push logic to check for author and committer sign-off-by. Also add a check for "Link" tag added by dim apply-branch. Remove the committer != author check because obviously some authors commit their patches themselves. This test was never done anyway because the first check of the function directly return if true. Signed-off-by: Benjamin Gaignard --- dim | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/dim b/dim index 786fe6b..103334c 100755 --- a/dim +++ b/dim @@ -661,18 +661,28 @@ function checkpatch_commit_push local sha1 sha1=$1 + author=$(git show -s $sha1 --format="format:%ae") + committer=$(git show -s $sha1 --format="format:%ce") # check for a-b/r-b tag - if git show -s $sha1 | grep -qi '\(reviewed\|acked\)\S*-by:' ; then - return + if ! git show -s $sha1 | grep -qi '\(reviewed\|acked\)\S*-by:' ; then + warn_or_fail "$sha1 is lacking mandatory review" fi - # check for committer != author - if [[ $(git show -s $sha1 --format="format:%ce") != $(git show -s $sha1 --format="format:%ae") ]]; then - return + # check for author sign-off + if ! git show -s $sha1 | grep -qi "S.*-by:.*$author" ; then + warn_or_fail "$sha1 is lacking author of sign-off" fi - warn_or_fail "$sha1 is lacking mandatory review" + # check for committer sign-off + if ! git show -s $sha1 | grep -qi "S.*-by:.*$committer" ; then + warn_or_fail "$sha1 is lacking committer of sign-off" + fi + + # check for Link tag + if ! git show -s $sha1 | grep -qi 'Link:' ; then + warn_or_fail "$sha1 is lacking of link tag" + fi } # push branch $1, rebuild drm-tip. the rest of the arguments are passed to git