Necessary for users that have signature output enabled by default, since the script would stumble on them and error out.
Testing setup
Set local repo config to show signatures in log by default, simulating a user having that setting turned on globally.
0₿ git config set log.showSignature true
Command under test
0₿ ( cd ./test/lint/test_runner/ && COMMIT_RANGE='HEAD^..HEAD' cargo run )
Before
0...
1fatal: invalid object name 'gpg'.
2Traceback (most recent call last):
3 File "/home/hodlinator/bitcoin/test/lint/lint-git-commit-check.py", line 52, in <module>
4 main()
5 File "/home/hodlinator/bitcoin/test/lint/lint-git-commit-check.py", line 42, in main
6 commit_info = check_output(["git", "log", "--format=%B", "-n", "1", hash], text=True, encoding="utf8").splitlines()
7 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8 File "/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/lib/python3.12/subprocess.py", line 466, in check_output
9 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
10 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 File "/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/lib/python3.12/subprocess.py", line 571, in run
12 raise CalledProcessError(retcode, process.args,
13subprocess.CalledProcessError: Command '['git', 'log', '--format=%B', '-n', '1', 'gpg: Signature made ons 11 dec 2024 10:46:34 CET']' returned non-zero exit status 128.
14^---- ⚠️ Failure generated from lint-git-commit-check.py
15...
After
(No failure generated by lint-git-commit-check.py).