{"action":"closed","issue":{"url":"https://api.github.com/repos/standard/standard/issues/1018","repository_url":"https://api.github.com/repos/standard/standard","labels_url":"https://api.github.com/repos/standard/standard/issues/1018/labels{/name}","comments_url":"https://api.github.com/repos/standard/standard/issues/1018/comments","events_url":"https://api.github.com/repos/standard/standard/issues/1018/events","html_url":"https://github.com/standard/standard/issues/1018","id":275840601,"number":1018,"title":"Git pre-commit hook doesn't work with BSD grep.","user":{"login":"adriantrunzo","id":1218900,"avatar_url":"https://avatars3.githubusercontent.com/u/1218900?v=4","gravatar_id":"","url":"https://api.github.com/users/adriantrunzo","html_url":"https://github.com/adriantrunzo","followers_url":"https://api.github.com/users/adriantrunzo/followers","following_url":"https://api.github.com/users/adriantrunzo/following{/other_user}","gists_url":"https://api.github.com/users/adriantrunzo/gists{/gist_id}","starred_url":"https://api.github.com/users/adriantrunzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriantrunzo/subscriptions","organizations_url":"https://api.github.com/users/adriantrunzo/orgs","repos_url":"https://api.github.com/users/adriantrunzo/repos","events_url":"https://api.github.com/users/adriantrunzo/events{/privacy}","received_events_url":"https://api.github.com/users/adriantrunzo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-11-21T19:57:43Z","updated_at":"2018-05-15T10:28:52Z","closed_at":"2018-05-15T10:28:52Z","author_association":"CONTRIBUTOR","body":"The pre-commit hook was recently changed in commit bd5445c, but unfortunately the use of `grep -z` (after git-diff) doesn't seem valid for BSD grep. To note I am on macOS 10.13.1 and have verified the following on both the system bash (GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17) and brew installed bash (GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.3.0).\r\n\r\nIn this case the `-z` option is meant to handle null-terminated input lines created with `git-diff -z` (and later parsed by `xargs -0`). However, `grep -z` on macOS/BSD is defined as:\r\n\r\n```\r\n-Z, -z, --decompress\r\n             Force grep to behave as zgrep.\r\n```\r\n\r\nThat definition is obviously not want we want, and unfortunately seems to be subject to it's own issues, namely if you try to use the `-z` option you will see `grep: invalid option -- z`.\r\n\r\nTo make the pre-commit hook work in my setup I changed the `grep -z` to `grep -a --null`, which is not quite functionally equivalent (treating input as text vs null-terminated lines) but close enough to get things working. I believe the `-a` and `--null` options are the same across most grep versions."}}
{"actor":{"display_login":"feross"}}