git-lint icon indicating copy to clipboard operation
git-lint copied to clipboard

warning: xargs: illegal option -- -

Open thibaut-pro opened this issue 5 years ago • 2 comments

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?

thibaut-pro avatar Mar 07 '20 00:03 thibaut-pro

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-pro avatar Mar 07 '20 01:03 thibaut-pro

@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.

sk- avatar Mar 11 '20 19:03 sk-