Open PotcFdk opened 3 months ago
After installing, or when running mix git_hooks.install, I get multiple fatal: --git-path requires an argument. I believe this is because there are cases that use some git commands incorrectly.
mix git_hooks.install
fatal: --git-path requires an argument
One example that I found seems to be here: https://github.com/qgadrian/elixir_git_hooks/blob/79b9aec14dbec5f0c24d0d2dfdadc102799c1ab0/lib/git/path.ex#L23-L24 This calls resolve_git_path_based_on_git_version without any arguments. That function then seems to default to "" and hence calls git rev-parse with the relevant argument missing: https://github.com/qgadrian/elixir_git_hooks/blob/79b9aec14dbec5f0c24d0d2dfdadc102799c1ab0/lib/git/path.ex#L56-L70
resolve_git_path_based_on_git_version
""
Let's see what rev-parse does with --git-path but with no further arguments:
--git-path
$ git rev-parse --git-path fatal: --git-path requires an argument
Aha. That same function, resolve_git_path_based_on_git_version, seems to also have a case that uses --git-dir. Let's see what that one does:
--git-dir
$ git rev-parse --git-dir .git
No errors there. Maybe the expected git rev-parse behavior changed?
Tested under Windows 11.
$ git version git version 2.46.0.windows.1
After installing, or when running
mix git_hooks.install
, I get multiplefatal: --git-path requires an argument
. I believe this is because there are cases that use some git commands incorrectly.One example that I found seems to be here: https://github.com/qgadrian/elixir_git_hooks/blob/79b9aec14dbec5f0c24d0d2dfdadc102799c1ab0/lib/git/path.ex#L23-L24 This calls
resolve_git_path_based_on_git_version
without any arguments. That function then seems to default to""
and hence calls git rev-parse with the relevant argument missing: https://github.com/qgadrian/elixir_git_hooks/blob/79b9aec14dbec5f0c24d0d2dfdadc102799c1ab0/lib/git/path.ex#L56-L70Let's see what rev-parse does with
--git-path
but with no further arguments:Aha. That same function,
resolve_git_path_based_on_git_version
, seems to also have a case that uses--git-dir
. Let's see what that one does:No errors there. Maybe the expected git rev-parse behavior changed?
Tested under Windows 11.