Re: FYI: git-hooks update on sourceware.org

Simon Marchi
2020-08-07T16:00:31Z

[-- Attachment #1: Type: text/plain, Size: 772 bytes --]

On 2020-08-07 11:50 a.m., Joel Brobecker wrote:
>> These changes have been extensively tested, and we've been using
>> the same version at AdaCore for over a week, now; but do let me
>> know if you have any issues.
>
> Well, that didn't take long. Simon just emailed me about an error.
> Apparently, the Python installed on sourceware.org doesn't have
> the enum module installed.

What version of Python are you using, is it really old? All the reasonably recent
and supported Python versions ship with the enum module.

> I will revert the update, and ask overseers to install it.

See the attached file, it's a very simple script to reject commits with the author
name/email munged by the mailing list. I don't think it will produce too many false
positives.

Simon

[-- Attachment #2: reject-via-ml.py --]
[-- Type: text/x-python, Size: 512 bytes --]

#!/usr/bin/env python3

import json
import sys

data = sys.stdin.read()
data = json.loads(data)

author_name = data["author_name"]
author_email = data["author_email"]

if " via " in author_name and "@sourceware.org" in author_email:
print(
"The author name ({}) and email address ({}) appear to have been munged by a mailing list.".format(
author_name, author_email
)
)
print("Please amend to the commit to put the proper author name and email address.")
sys.exit(1)