all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arun Isaac <arunisaac@systemreboot.net>
To: guix-devel <guix-devel@gnu.org>
Subject: Re: Automatically checking commit messages
Date: Sat, 23 Sep 2017 10:14:55 +0530	[thread overview]
Message-ID: <f64cd886.AEAAQgSr3S4AAAAAAAAAAAOtZhgAAAACwQwAAAAAAAW9WABZxebW@mailjet.com> (raw)
In-Reply-To: <CAPsKtf+-TZ2SCyqc8YvAfb0PLhVSXnNzG632U+PeM8JcBTbRDg@mail.gmail.com>


> What parts of the commit message guidelines do you expect to be
> verifiable, and which parts do you think will be too hard/restrictive
> to automatically verify?

I haven't thought too hard about this. I thought that, if we have a good
parser for commit messages, we can later add any number of
tests. Anyways, here are a few tests that immediately come to mind:

* Check for commit signature. Our existing pre-push hook already does
  this.
* Verify that the modules listed on the first line of the commit message
  ("gnu: you-get", "guix: build:", etc.) are accurate.
* Verify mundane things like capitalization of first word of sentence,
  period at the end of a sentence, no indentation when a changelog entry
  continues for more than one line, etc.
* Maybe, enforce templates for common commits like updating a package,
  enabling/disabling tests/parallel-build/parallel-tests, etc.
* Verify that the changelog lists all changes in the commit. This might
  require actually parsing the patch, and may not be easy.

> If you haven't done so already, adding test cases (from existing
> proper and improper commit messages) would ease understanding.

I will work on this script further, and post a patch once I have
something more complete.

>> This is a good idea, and it would be even better if that same thing
>> could be used to generate a commit message with all the automatable
>> pieces pre-filled, with only the human parts left to the user.

This is an interesting thought. I also just found out that git supports
commit message templates, and I wonder if it could be useful.

https://robots.thoughtbot.com/better-commit-messages-with-a-gitmessage-template

> FWIW 'magit' can already fill out file names and variables by navigating
> to the hunks in the diff buffer and pressing 'C'.

True, magit is very useful in that regard. But, at least for common
commits like updating patches, it would help to have something more
automated than that.

  reply	other threads:[~2017-09-23  4:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20 15:47 Automatically checking commit messages Arun Isaac
2017-09-21 11:45 ` Jelle Licht
2017-09-23  4:44   ` Arun Isaac [this message]
2017-09-21 12:20 ` Vincent Legoll
2017-09-21 18:59   ` Marius Bakke

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

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

  git send-email \
    --in-reply-to=f64cd886.AEAAQgSr3S4AAAAAAAAAAAOtZhgAAAACwQwAAAAAAAW9WABZxebW@mailjet.com \
    --to=arunisaac@systemreboot.net \
    --cc=guix-devel@gnu.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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.