From patchwork Sat Mar 26 17:46:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 15561 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 B1371BD80A for ; Sat, 26 Mar 2022 17:46:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E3D63604C7; Sat, 26 Mar 2022 18:46:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1648316806; bh=VFoWgGqRiNZXgsc8S0VJhREWLY4diTSAA+qboqGKAGc=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=oeFU5ctlv/e+Fo/LgAGBPoKfU0Qb6hUgPKkoYz2lbIHyWhsUfpRWy/8EviTa6+nEr WiZZmDQbrSH23H2rgdpU08pBPOh/B10tTnKc7qsqm9mCmSfsTbZ1S18Ls4dqABQrmA 9tFsQ9hn+lj1Dny5hhrEea7AxqLDDemEadmrrS7oVwSYPtt85MaK8VNqpZBrrMlIz/ Y9MHExU/oelqz4ZjnENaTzeNYzt9bdq3bUh+ZgqsWeUray7/3DIPd3TeOJ5x0SL83y kk78VG88jurszJgEqV3g57veZvTLPufl5OYWDuobgqB1167YxfGsbtl09OHLiTAgXz 1EKjPpTEex61A== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B5CF7604C4 for ; Sat, 26 Mar 2022 18:46:44 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="RKEZXDYS"; dkim-atps=neutral Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2E75A474 for ; Sat, 26 Mar 2022 18:46:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1648316804; bh=VFoWgGqRiNZXgsc8S0VJhREWLY4diTSAA+qboqGKAGc=; h=From:To:Subject:Date:From; b=RKEZXDYSZE1aFW9ikkDrMT2L+XQRUyFIQeOuwSkDyL2TskUtMpl7d2wTvASqH1NKR QlPCxCu8MsueCWYEcsO8a399n/Js08EUYb3y7rcf/unfFPodqqCn5XnW2j53xQva53 CO/ilHKWLXdwP3VeLZb1Qd61rYUknnZhYhZWtoAw= To: libcamera-devel@lists.libcamera.org Date: Sat, 26 Mar 2022 19:46:39 +0200 Message-Id: <20220326174639.32199-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] utils: hooks: pre-push: Catch commits without author's SoB 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: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The pre-push git hook script catches commits without a SoB line corresponding to the committer, but doesn't perform the same check on the author. Fix it. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- utils/hooks/pre-push | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/utils/hooks/pre-push b/utils/hooks/pre-push index e4187f381a43..90ffdf6f1755 100755 --- a/utils/hooks/pre-push +++ b/utils/hooks/pre-push @@ -67,8 +67,8 @@ do errors=$((errors+1)) fi - # 2. The commit message shall have a Signed-off-by line - # corresponding the committer. + # 2. The commit message shall have Signed-off-by lines + # corresponding the committer and the author. committer=$(echo "$msg" | grep '^committer ' | head -1 | \ cut -d ' ' -f 2- | rev | cut -d ' ' -f 3- | rev) if ! echo "$msg" | grep -F -q "Signed-off-by: ${committer}" @@ -77,6 +77,14 @@ do errors=$((errors+1)) fi + author=$(echo "$msg" | grep '^author ' | head -1 | \ + cut -d ' ' -f 2- | rev | cut -d ' ' -f 3- | rev) + if ! echo "$msg" | grep -F -q "Signed-off-by: ${author}" + then + echo >&2 "Missing author Signed-off-by in commit $commit" + errors=$((errors+1)) + fi + # 3. A Reviewed-by or Acked-by is required. if ! echo "$msg" | grep -q '^\(Reviewed\|Acked\)-by: ' then