2 Commits

Author SHA1 Message Date
Maciej Borzecki
7ec49c006d check-commit-email: do not fail when current dir is not under git
The check fails with a source tarball, like the one used during spread tests.

```
Error: 2022-01-21 07:44:44 Error executing google:ubuntu-20.04-64:tests/unit/go (jan210735-282406) :
-----
...
Obtaining c-dependencies
HEAD is now at 74f4fe8 Merge pull request #63 from vasi/vasi-win-ci
Checking docs
fatal: not a git repository (or any of the parent directories): .git
Traceback (most recent call last):
  File "./check-commit-email.py", line 42, in <module>
    commitrange = get_commit_range()
  File "./check-commit-email.py", line 22, in get_commit_range
    lines = subprocess.check_output(
  File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'cat-file', '-p', '@']' returned non-zero exit status 128.

Crushing failure and despair.
```

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2022-01-21 11:25:48 +01:00
Ian Johnson
f787f81503 run-checks, check-commit-email.py: check commit email addresses for validity
Adapted from script from Michael to prevent commits that have non-unicode (or
otherwise invalid) emails set in the commit message from being merged, as this
will break the LP git import.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2022-01-19 12:05:08 -06:00