From patchwork Mon Oct 7 19:14:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 21531 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 94324BD80A for ; Mon, 7 Oct 2024 19:14:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AC4CC6353A; Mon, 7 Oct 2024 21:14:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="t1RRrfJM"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AECF56351F for ; Mon, 7 Oct 2024 21:14:10 +0200 (CEST) Received: from pendragon.ideasonboard.com (unknown [132.205.230.14]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E745675A for ; Mon, 7 Oct 2024 21:12:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1728328354; bh=kLuxvkTCkSPrBlnr8dLdCpUQr6zsEB4m/bvwRTQ9giE=; h=From:To:Subject:Date:From; b=t1RRrfJMRAc8z4EG2p11VSOo4HzZLK0wVuUHiAHlapr1eHKVz+joRexBRngb3e3y+ obeadqduAwxIH3FeXntRDzOV78Pex4apfMjXnQxPMzXcYneGuAYa1L0vULlgf2X37w YhxzmeFHwLaBN1GjmRPZsHjUE+JOK66XgOA1BtWk= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH] hooks: pre-push: Verify that co-authors have a SoB line Date: Mon, 7 Oct 2024 22:14:03 +0300 Message-ID: <20241007191403.26881-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The Co-developed-by tag must be followed by a corresponding SoB line. Enforce this rule in the git pre-push hook. Signed-off-by: Laurent Pinchart Tested-by: Kieran Bingham Reviewed-by: Kieran Bingham --- utils/hooks/pre-push | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) base-commit: a7d573df53ff2fe2edaaf4c11a269f12b1a9e305 diff --git a/utils/hooks/pre-push b/utils/hooks/pre-push index 9918b2861705..68dcbd0cccc8 100755 --- a/utils/hooks/pre-push +++ b/utils/hooks/pre-push @@ -68,7 +68,7 @@ do fi # 2. The commit message shall have Signed-off-by lines - # corresponding the committer and the author. + # corresponding the committer, author, and all co-developers. committer=$(echo "$msg" | grep '^committer ' | head -1 | \ cut -d ' ' -f 2- | rev | cut -d ' ' -f 3- | rev) if ! echo -E "$msg" | grep -F -q "Signed-off-by: ${committer}" @@ -85,6 +85,15 @@ do errors=$((errors+1)) fi + while read -r codev + do + if ! echo -E "$msg" | grep -F -q "Signed-off-by: ${codev}" + then + echo >&2 "Missing co-developer '${codev}' Signed-off-by in commit $commit" + errors=$((errors+1)) + fi + done < <(echo "$msg" | grep '^Co-developed-by: ' | cut -d ' ' -f 2-) + # 3. A Reviewed-by or Acked-by is required. if ! echo -E "$msg" | grep -q '^\(Reviewed\|Acked\)-by: ' then