From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +M4kLbzVYmGfOwAAgWs5BA (envelope-from ) for ; Sun, 10 Oct 2021 13:59:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id uOL7J7zVYmEbfwAAB5/wlQ (envelope-from ) for ; Sun, 10 Oct 2021 11:59:56 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F2EBF2348D for ; Sun, 10 Oct 2021 13:59:55 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id CCD6926EE4; Sun, 10 Oct 2021 07:59:50 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id D12E126EE3 for ; Sun, 10 Oct 2021 07:59:47 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 691595FD5C; Sun, 10 Oct 2021 07:59:47 -0400 (EDT) Received: (nullmailer pid 1238188 invoked by uid 1000); Sun, 10 Oct 2021 11:59:45 -0000 From: David Bremner To: Tomi Ollila , David Bremner , notmuch@notmuchmail.org Subject: [PATCH v2] devel: script for checking a commit (series) Date: Sun, 10 Oct 2021 08:54:50 -0300 Message-Id: <20211010115449.1238093-1-david@tethera.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: References: MIME-Version: 1.0 Message-ID-Hash: 22YSQQAXW7BBLK643XJ3WUFTFL6SWXTH X-Message-ID-Hash: 22YSQQAXW7BBLK643XJ3WUFTFL6SWXTH X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633867196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=fSz6v9EAQuke9tpKp1+Riw4xuoN/tuFItYbcrC7vFdQ=; b=CdVZFuikkqer03iYxN/GKHGipukrqumadQGYjn50CN2j8W+1J2fzwOfM/3YEPfnr7Ys3bP 6WeuOcljC+trAIxl0YcLTcbUls45ZqdcIg9YivgA/C83wxa31ba6lphJq2hnRGSbhgM7ly 6KNtF09U4DHxAj3WCPnzm2CS8v461jmXz3ZzPyKpGdpoe5Sm/PSamGxTV6DRCt8txnYSfG PwoIrzpRpUY0NuZHloFVkkLIHuX9OmJ4UvqpM0DVz6jPyD9CbVlapWNijmxJfMvMeU7CTP cbmJzU1azKgzfwi9FEROropo/8tHG+WqfAyS5+nw6jBZgalCi2gz8oIlfjaSdw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633867196; a=rsa-sha256; cv=none; b=G/p4rS9wq9JmbOO7a1tHMl9vdBd0qzr/5H1e3H42mc7VITasg7QbwN8QsMXfpOlqhCVvv+ KdvdHBSHu7tT6qKbPfGNHqCuBWPiWDW3tODcqct9fwZGV2PsLmXD+DLU+aDJAjx8e6RMhW XicYjyK5eMEUvL8OYGRXpYmsdIk5MZL7tIo+ZU4C8QckaXmsImXkAd8TY5/lqsxPBP4191 yD5b3z9kREHzNw4zRhDqcNxXihPHX/mxQbXNNHA2dm7gBPF2Bew3PPUbHsjhozZRUc7c7r FbyCQivegt/1IYv9TP2eVZMFyGivAnO34JtbGHfmm/rOIu8MBrg2rM2WnxfTxQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.19 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: F2EBF2348D X-Spam-Score: -1.19 X-Migadu-Scanner: scn0.migadu.com X-TUID: A6Z+LzSf6ez6 'check-notmuch-commit' is an updated version of a script I have been using (although not always as consistently as I should) before sending patches to the list. Although it requires a bit more tooling, encouraging people to use check-notmuch-commit might reduce the number of round trips to the list for style nitpicks. --- devel/check-notmuch-commit | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 devel/check-notmuch-commit Changes since last round: ~ '--quick' argument to avoid expensive build/test ~ use Tomi's trick to avoid multiple calls to dirname ~ merge reindent-lisp into the main script. This eases development (only one script to put in path) and reduces execs. ~ include quoting fix for call to emacs ~ add diff-filter option diff --git a/devel/check-notmuch-commit b/devel/check-notmuch-commit new file mode 100755 index 00000000..99ed229d --- /dev/null +++ b/devel/check-notmuch-commit @@ -0,0 +1,32 @@ +#!/bin/sh + +# Usage suggestion: +# git rebase -i --exec devel/check-notmuch-commit origin/master + +set -e + +quick=0 +case "$1" in + -q|-Q|--quick) + quick=1 + ;; +esac + +if [ $quick = 0 ]; then + make test +fi + +unset uconf +for file in $(git diff --name-only --diff-filter=AM HEAD^); do + case $file in + *.c|*.h|*.cc|*.hh) + uncrustify --replace -c "${uconf=$(dirname "$0")/uncrustify.cfg}" "$file" + ;; + *.el) + emacs -Q --batch "$file" --eval '(indent-region (point-min) (point-max) nil)' -f save-buffer + ;; + esac +done + +git diff --quiet + -- 2.33.0