unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: Re: [PATCH v2] devel: script for checking a commit (series)
Date: Sun, 10 Oct 2021 22:02:17 +0300	[thread overview]
Message-ID: <m2k0ik9006.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <20211010115449.1238093-1-david@tethera.net>

On Sun, Oct 10 2021, David Bremner wrote:

> '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"

The above line does not have TAB, otherwise looks good to me.

(there might be other tab/spaces inconsistencies, but this was local enough for me
to notice ;/)

Tomi

> +	    ;;
> +	*.el)
> +	    emacs -Q --batch "$file" --eval '(indent-region (point-min) (point-max) nil)' -f save-buffer
> +	    ;;
> +    esac
> +done
> +
> +git diff --quiet
> +
> -- 
> 2.33.0

  reply	other threads:[~2021-10-10 19:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 14:08 [PATCH] devel: two scripts for checking proposed changes David Bremner
2021-06-28 14:19 ` Tomi Ollila
2021-06-29 11:27   ` David Bremner
2021-07-23 20:13     ` Tomi Ollila
2021-10-10 11:54       ` [PATCH v2] devel: script for checking a commit (series) David Bremner
2021-10-10 19:02         ` Tomi Ollila [this message]
2021-10-10 23:57           ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2k0ik9006.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).