From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 56A424284B; Mon, 27 Mar 2023 16:52:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1406C40EE1; Mon, 27 Mar 2023 16:52:39 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 5B6E940ED8; Mon, 27 Mar 2023 16:52:37 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8E5F85C018B; Mon, 27 Mar 2023 10:52:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 27 Mar 2023 10:52:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm2; t=1679928755; x=1680015155; bh=5eLZ8gGdJ9 8Sqpd28h/djow4BhDG4dMveqZ8fl33P60=; b=AavimkP9ox0bBC8lOOW5enRAlH CC/JxlM+gMT/26e1GFcG+x5u2k4zb9vChdjxFHktrW+5TxFjUTrbnLLTBJmH6GMC KE2uqw+9MKJpbPBzHHGT/U8ZbY6oZjDjvDtfYVJYNBaUHT0K2LFfmfTPCHSNrLMT A0A9n1A/NLZDvNGWMWamM3HSjW7A381pZIHGDSwUuSlEi7ygwOQPraL0ng2u0Q8B 23guvCS6TXeLzMq1wOx1LE+lQDTgxQ9jGAKGR21QXJQUY/x9UBijZebZqfbDZUp+ P5nHlVO3m7q+leLCaOCJ0NJVULTqJ6BRVgTFdp/Yd/yccC4sTMBFbAJZ0jmg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1679928755; x=1680015155; bh=5eLZ8gGdJ98Sq pd28h/djow4BhDG4dMveqZ8fl33P60=; b=RL3iTThzJuFLJCfO6h5NhC3txEM9o goopCjUpfGuQg+QL/BUwSNrgMymaSI7SODEmqFpmzUioX8ivkt7lMk71MAqlFJuw 6ZzJkdfdKD8fdDfcL3I3kzaDRuxCo5B9Lhj/M/HFqAJxE0hfIsQ63hAO9cbSKp7f sFTiew1P0zRW1SekqrfNmdHLgxgtrdnW9QmPbuQ6d2HvxcBnK0f/IA4PpW/vIAwg naMDKp3k3PAbgZ/SMC3pQ4uTUnqwBC4iJwwcX9mRMpep/oKWYOmcHbNwzCD2nNfU iwy0SatStyb+2He9e2BfGBSB2Bz+Ium7BiNdkKiz+emjBevV/ZNoxdlag== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdehvddgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpeevveefveeiiefhtedukeegkeelieegffeukeevudetueffieduveet iedukeefleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Mar 2023 10:52:34 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: stable@dpdk.org, Bruce Richardson , David Marchand Subject: [PATCH] devtools: move mailmap check after patch applied Date: Mon, 27 Mar 2023 16:52:19 +0200 Message-Id: <20230327145219.1927159-1-thomas@monjalon.net> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The names in a patch were possibly checked with checkpatches.sh before applying the patch, so before .mailmap file was updated. The check is moved and translated in check-git-log.sh, which is run only on a repository, not a detached patch file. Fixes: e83d41f0694d ("mailmap: add list of contributors") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- devtools/check-git-log.sh | 15 +++++++++++++++ devtools/checkpatches.sh | 30 ------------------------------ 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh index e26205814b..af751e49ab 100755 --- a/devtools/check-git-log.sh +++ b/devtools/check-git-log.sh @@ -259,6 +259,21 @@ done) [ -z "$bad" ] || { printf "Missing 'Signed-off-by:' tag: \n$bad\n"\ && failure=true;} +# check names +names=$(git log --format='From: %an <%ae>%n%b' --reverse $range | + sed -rn 's,.*: (.*<.*@.*>),\1,p' | + sort -u) +bad=$(for contributor in $names ; do + ! grep -qE "^$contributor($| <)" $selfdir/../.mailmap || continue + if grep -q "^${contributor%% <*} <" .mailmap ; then + printf "\t$contributor is not the primary email address\n" + else + printf "\t$contributor is unknown in .mailmap\n" + fi +done) +[ -z "$bad" ] || { printf "Contributor name/email mismatch with .mailmap: \n$bad\n"\ + && failure=true;} + total=$(echo "$commits" | wc -l) if $failure ; then printf "\nInvalid patch(es) found - checked $total patch" diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index 1dee094c7a..a07bbc83cb 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -248,28 +248,6 @@ check_release_notes() { # grep -v $current_rel_notes } -check_names() { # - res=0 - - old_IFS=$IFS - IFS=' -' - for contributor in $(sed -rn '/^$/,/^--- / {s/.*: (.*<.*@.*>)/\1/p}' $1); do - ! grep -qE "^$contributor($| <)" .mailmap || continue - name=${contributor%% <*} - if grep -q "^$name <" .mailmap; then - reason="$name mail differs from primary mail" - else - reason="$contributor is unknown" - fi - echo "$reason, please fix the commit message or update .mailmap." - res=1 - done - IFS=$old_IFS - - return $res -} - number=0 range='origin/main..' quiet=false @@ -378,14 +356,6 @@ check () { # ret=1 fi - ! $verbose || printf '\nChecking names in commit log:\n' - report=$(check_names "$tmpinput") - if [ $? -ne 0 ] ; then - $headline_printed || print_headline "$subject" - printf '%s\n' "$report" - ret=1 - fi - if [ "$tmpinput" != "$1" ]; then rm -f "$tmpinput" trap - INT -- 2.39.1