pre-commit.hook: -v: unexpected operator
Environment:
- At commit f6ce1686 (
master
) - OS: Lubuntu 20.04, Linux 5.3.0-64-generic
#
58-Ubuntu SMP Fri Jul 10 19:33:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux - /bin/sh: provided by
dash
0.5.10.2-6 amd64
Steps:
- Check out master
- Build per the instructions (this copies
hooks/pre-commit.hook
to.git/hooks/pre-commit
) git commit --amend --allow-empty --no-edit
Expected:
- Normal git-commit output
Observed:
- Error message
-v: unexpected operator
Console log:
~/proj/gstreamer$ git commit --amend --allow-empty --no-edit
--Checking style--
--Checking style pass--
.git/hooks/pre-commit: 93: [: -v: unexpected operator
[issue624 c0ed16b8c] gstinfo WIP
Date: Sat Oct 31 12:52:55 2020 -0400
1 file changed, 3 insertions(+), 3 deletions(-)
Analysis:
The pre-commit hook uses #!/bin/sh
. On Debian, /bin/sh
is dash
, and dash
does not suport bash
-specific features. -v
is such a feature, so is not recognized by dash or by test(1)
.
Thanks for considering this report!