{"action":"created","issue":{"url":"https://api.github.com/repos/brigade/overcommit/issues/574","repository_url":"https://api.github.com/repos/brigade/overcommit","labels_url":"https://api.github.com/repos/brigade/overcommit/issues/574/labels{/name}","comments_url":"https://api.github.com/repos/brigade/overcommit/issues/574/comments","events_url":"https://api.github.com/repos/brigade/overcommit/issues/574/events","html_url":"https://github.com/brigade/overcommit/issues/574","id":313604211,"number":574,"title":"TrailingWhitespace does not get run automatically","user":{"login":"rabcat","id":6800849,"avatar_url":"https://avatars0.githubusercontent.com/u/6800849?v=4","gravatar_id":"","url":"https://api.github.com/users/rabcat","html_url":"https://github.com/rabcat","followers_url":"https://api.github.com/users/rabcat/followers","following_url":"https://api.github.com/users/rabcat/following{/other_user}","gists_url":"https://api.github.com/users/rabcat/gists{/gist_id}","starred_url":"https://api.github.com/users/rabcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rabcat/subscriptions","organizations_url":"https://api.github.com/users/rabcat/orgs","repos_url":"https://api.github.com/users/rabcat/repos","events_url":"https://api.github.com/users/rabcat/events{/privacy}","received_events_url":"https://api.github.com/users/rabcat/received_events","type":"User","site_admin":false},"labels":[{"id":464215461,"url":"https://api.github.com/repos/brigade/overcommit/labels/need-more-info","name":"need-more-info","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-04-12T07:17:03Z","updated_at":"2018-04-15T03:03:41Z","closed_at":null,"author_association":"NONE","body":"config file:\r\n```yaml\r\nquiet: false\r\n\r\nPreCommit:\r\n  TrailingWhitespace:\r\n    enabled: true\r\n```\r\n\r\nWhen I run git commit, vim pops up at once.\r\nBut with overcommit -r, I get\r\n\r\n```\r\nRunning pre-commit hooks\r\nCheck for trailing whitespace....................[TrailingWhitespace] FAILED\r\nErrors on modified lines:\r\n/home/rabcat/Desktop/testProj/hello_world.cpp:6:    cout << \"Hello World\" << endl;                   \r\n\r\n✗ One or more pre-commit hooks failed\r\n```\r\n\r\nWhy is  TrailingWhitespace not run automatically upon git commit?"},"comment":{"url":"https://api.github.com/repos/brigade/overcommit/issues/comments/381376607","html_url":"https://github.com/brigade/overcommit/issues/574#issuecomment-381376607","issue_url":"https://api.github.com/repos/brigade/overcommit/issues/574","id":381376607,"user":{"login":"rabcat","id":6800849,"avatar_url":"https://avatars0.githubusercontent.com/u/6800849?v=4","gravatar_id":"","url":"https://api.github.com/users/rabcat","html_url":"https://github.com/rabcat","followers_url":"https://api.github.com/users/rabcat/followers","following_url":"https://api.github.com/users/rabcat/following{/other_user}","gists_url":"https://api.github.com/users/rabcat/gists{/gist_id}","starred_url":"https://api.github.com/users/rabcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rabcat/subscriptions","organizations_url":"https://api.github.com/users/rabcat/orgs","repos_url":"https://api.github.com/users/rabcat/repos","events_url":"https://api.github.com/users/rabcat/events{/privacy}","received_events_url":"https://api.github.com/users/rabcat/received_events","type":"User","site_admin":false},"created_at":"2018-04-15T03:03:41Z","updated_at":"2018-04-15T03:03:41Z","author_association":"NONE","body":"Yeah, I literally did\r\n```\r\nmv pre-commit.sample pre-commit\r\n```\r\n\r\n```\r\n#!/bin/sh\r\n#\r\n# An example hook script to verify what is about to be committed.\r\n# Called by \"git commit\" with no arguments.  The hook should\r\n# exit with non-zero status after issuing an appropriate message if\r\n# it wants to stop the commit.\r\n#\r\n# To enable this hook, rename this file to \"pre-commit\".\r\n\r\nif git rev-parse --verify HEAD >/dev/null 2>&1\r\nthen\r\n        against=HEAD\r\nelse\r\n        # Initial commit: diff against an empty tree object\r\n        against=4b825dc642cb6eb9a060e54bf8d69288fbee4904\r\nfi\r\n\r\n# If you want to allow non-ASCII filenames set this variable to true.\r\nallownonascii=$(git config --bool hooks.allownonascii)\r\n\r\n# Redirect output to stderr.\r\nexec 1>&2\r\n\r\n# Cross platform projects tend to avoid non-ASCII filenames; prevent\r\n# them from being added to the repository. We exploit the fact that the\r\n# printable range starts at the space character and ends with tilde.\r\nif [ \"$allownonascii\" != \"true\" ] &&\r\n        # Note that the use of brackets around a tr range is ok here, (it's\r\n        # even required, for portability to Solaris 10's /usr/bin/tr), since\r\n        # the square bracket bytes happen to fall in the designated range.\r\n        test $(git diff --cached --name-only --diff-filter=A -z $against |\r\n          LC_ALL=C tr -d '[ -~]\\0' | wc -c) != 0\r\nthen\r\n        cat <<\\EOF\r\nError: Attempt to add a non-ASCII file name.\r\n\r\nThis can cause problems if you want to work with people on other platforms.\r\n\r\nTo be portable it is advisable to rename the file.\r\n\r\nIf you know what you are doing you can disable this check using:\r\n\r\n  git config hooks.allownonascii true\r\nEOF\r\n        exit 1\r\nfi\r\n\r\n# If there are whitespace errors, print the offending file names and fail.\r\nexec git diff-index --check --cached $against --\r\n\r\n```"}}
{"actor":{"display_login":"rabcat"}}