[{"id":31608,"web_url":"https://patchwork.libcamera.org/comment/31608/","msgid":"<172834330583.1449549.3076027635843430575@ping.linuxembedded.co.uk>","date":"2024-10-07T23:21:45","subject":"Re: [PATCH] hooks: pre-push: Verify that co-authors have a SoB line","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-10-07 20:14:03)\n> The Co-developed-by tag must be followed by a corresponding SoB line.\n> Enforce this rule in the git pre-push hook.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  utils/hooks/pre-push | 11 ++++++++++-\n>  1 file changed, 10 insertions(+), 1 deletion(-)\n> \n> diff --git a/utils/hooks/pre-push b/utils/hooks/pre-push\n> index 9918b2861705..68dcbd0cccc8 100755\n> --- a/utils/hooks/pre-push\n> +++ b/utils/hooks/pre-push\n> @@ -68,7 +68,7 @@ do\n>                 fi\n>  \n>                 # 2. The commit message shall have Signed-off-by lines\n> -               # corresponding the committer and the author.\n> +               # corresponding the committer, author, and all co-developers.\n>                 committer=$(echo \"$msg\" | grep '^committer ' | head -1 | \\\n>                                 cut -d ' ' -f 2- | rev | cut -d ' ' -f 3- | rev)\n>                 if ! echo -E \"$msg\" | grep -F -q \"Signed-off-by: ${committer}\"\n> @@ -85,6 +85,15 @@ do\n>                         errors=$((errors+1))\n>                 fi\n>  \n> +               while read -r codev\n> +               do\n> +                       if ! echo -E \"$msg\" | grep -F -q \"Signed-off-by: ${codev}\"\n> +                       then\n> +                               echo >&2 \"Missing co-developer '${codev}' Signed-off-by in commit $commit\"\n> +                               errors=$((errors+1))\n> +                       fi\n> +               done < <(echo \"$msg\" | grep '^Co-developed-by: ' | cut -d ' ' -f 2-)\n> +\n\n$ echo test-main 5982c728cd0b2f247058b5aa57994c273fdd8d04 refs/heads/integration/pre-push-test a7d573df53ff2fe2edaaf4c11a269f12b1a9e305 | ./utils/hooks/pre-push maintest\n...\nMissing co-developer 'Harvey Yang <chenghaoyang@chromium.org>' Signed-off-by in commit 2baad75b4420b4533c998b63d4588fcef1f3b356\nMissing co-developer 'Yunke Cao <yunkec@chromium.org>' Signed-off-by in commit 2baad75b4420b4533c998b63d4588fcef1f3b356\nMissing co-developer 'Tomasz Figa <tfiga@chromium.org>' Signed-off-by in commit 2baad75b4420b4533c998b63d4588fcef1f3b356\nNo Reviewed-by or Acked-by in commit 2baad75b4420b4533c998b63d4588fcef1f3b356\n...\n\nLooks good to me \n\nTested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>                 # 3. A Reviewed-by or Acked-by is required.\n>                 if ! echo -E \"$msg\" | grep -q '^\\(Reviewed\\|Acked\\)-by: '\n>                 then\n> \n> base-commit: a7d573df53ff2fe2edaaf4c11a269f12b1a9e305\n> -- \n> Regards,\n> \n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 26CFBBE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Oct 2024 23:21:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 29EF962C91;\n\tTue,  8 Oct 2024 01:21:51 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 02A9A62C91\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  8 Oct 2024 01:21:48 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A52FA2EC;\n\tTue,  8 Oct 2024 01:20:12 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"I433EsZh\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1728343212;\n\tbh=f1aFn9UwpEhs0xqd7LcqOmH9TYzq6+6uic+0yXdiTjo=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=I433EsZhxpTDPbZhBY01aLRQWXqF5lQsN9nuubT4ZmdaB6ufOruNgIfiB/EE+oPK8\n\tjnp9lymRroFKft2eaycszGcDgs4A/TkdiLNHLVFazwoXEGy1bi94u2NJ2pkzD5M70F\n\tujiMikJd+U06FgoUni1QmV/k/WQELe2+5oC+2swM=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241007191403.26881-1-laurent.pinchart@ideasonboard.com>","References":"<20241007191403.26881-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH] hooks: pre-push: Verify that co-authors have a SoB line","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 08 Oct 2024 00:21:45 +0100","Message-ID":"<172834330583.1449549.3076027635843430575@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]