KAUTH / pre-commit-git-checks

A series of basic Git checks meant for linting of your work.

Home Page:https://pypi.org/project/pre-commit-git-checks/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`git-signoff` hook fails on first commit

KAUTH opened this issue · comments

Traceback:

[INFO] Installing environment for https://github.com/KAUTH/pre-commit-git-checks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Git Signoff Check........................................................Failed
- hook id: git-signoff
- exit code: 1

Traceback (most recent call last):
  File "/home/user/.cache/pre-commit/repoz2idhxv_/py_env-python3/lib/python3.8/site-packages/pre_commit_git_checks/hooks/utils.py", line 30, in run_cmd
    p = subprocess.run(
  File "/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'log', '--format=%B', '-n', '1']' returned non-zero exit status 128.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/.cache/pre-commit/repoz2idhxv_/py_env-python3/bin/pgchecks", line 8, in <module>
    sys.exit(cli())
  File "/home/user/.cache/pre-commit/repoz2idhxv_/py_env-python3/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/.cache/pre-commit/repoz2idhxv_/py_env-python3/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/user/.cache/pre-commit/repoz2idhxv_/py_env-python3/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/.cache/pre-commit/repoz2idhxv_/py_env-python3/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/.cache/pre-commit/repoz2idhxv_/py_env-python3/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/user/.cache/pre-commit/repoz2idhxv_/py_env-python3/lib/python3.8/site-packages/pre_commit_git_checks/cli.py", line 23, in signoff
    check_git_signoff()
  File "/home/user/.cache/pre-commit/repoz2idhxv_/py_env-python3/lib/python3.8/site-packages/pre_commit_git_checks/hooks/check_git_signoff.py", line 173, in check_git_signoff
    git_commit_message = run_cmd("git log --format=%B -n 1")
  File "/home/user/.cache/pre-commit/repoz2idhxv_/py_env-python3/lib/python3.8/site-packages/pre_commit_git_checks/hooks/utils.py", line 37, in run_cmd
    raise CalledProcessError(e)
pre_commit_git_checks.hooks.utils.CalledProcessError: Command '['git', 'log', '--format=%B', '-n', '1']' returned non-zero exit status 128.