I want to check by pre-commit files that was changed in git branch in Gitlab CI. What arg for --from-ref
I need to use?
pre-commit run --from-ref=? --to-ref=HEAD
Example from pre-commit
documentation raises error.
$ pre-commit run --from-ref=origin/HEAD --to-ref HEAD
An unexpected error has occurred: CalledProcessError: command: ('/usr/bin/git', 'diff', '--name-only', '--no-ext-diff', '-z', 'origin/HEAD...HEAD')
return code: 128
expected return code: 0
stdout: (none)
stderr:
fatal: ambiguous argument 'origin/HEAD...HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'