git-lint
git-lint copied to clipboard
warning: xargs: illegal option -- -
I get the follow warning when running the git pre-commit hook:
xargs: illegal option -- -
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
[-L number] [-n number [-x]] [-P maxprocs] [-s size]
[utility [argument ...]]
This is on MacOS. Any tips on how to address that?
Replacing
# First part return the files being commited, excluding deleted files.
git diff-index -z --cached HEAD --name-only --diff-filter=ACMRTUXB |
xargs --null --no-run-if-empty git lint;
with
git lint;
in the pre-commit hook fixed it for me.
@thibaut-singlefile Thanks for the report. It's rather hard to maintain these scripts across oses. I started the development while I was using Linux, and then there were some PRs to fix it for mac. But is not that straightforward. That is one of the reasons, I'd like to get rid of them, and instead change the CLI so that it's easier to integrate in custom hooks.