{"action":"created","issue":{"url":"https://api.github.com/repos/Charcoal-SE/SmokeDetector/issues/2399","repository_url":"https://api.github.com/repos/Charcoal-SE/SmokeDetector","labels_url":"https://api.github.com/repos/Charcoal-SE/SmokeDetector/issues/2399/labels{/name}","comments_url":"https://api.github.com/repos/Charcoal-SE/SmokeDetector/issues/2399/comments","events_url":"https://api.github.com/repos/Charcoal-SE/SmokeDetector/issues/2399/events","html_url":"https://github.com/Charcoal-SE/SmokeDetector/issues/2399","id":358257376,"node_id":"MDU6SXNzdWUzNTgyNTczNzY=","number":2399,"title":"We shouldn't parse output of git-status","user":{"login":"iBug","id":7273074,"node_id":"MDQ6VXNlcjcyNzMwNzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7273074?v=4","gravatar_id":"","url":"https://api.github.com/users/iBug","html_url":"https://github.com/iBug","followers_url":"https://api.github.com/users/iBug/followers","following_url":"https://api.github.com/users/iBug/following{/other_user}","gists_url":"https://api.github.com/users/iBug/gists{/gist_id}","starred_url":"https://api.github.com/users/iBug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iBug/subscriptions","organizations_url":"https://api.github.com/users/iBug/orgs","repos_url":"https://api.github.com/users/iBug/repos","events_url":"https://api.github.com/users/iBug/events{/privacy}","received_events_url":"https://api.github.com/users/iBug/received_events","type":"User","site_admin":false},"labels":[{"id":914221714,"node_id":"MDU6TGFiZWw5MTQyMjE3MTQ=","url":"https://api.github.com/repos/Charcoal-SE/SmokeDetector/labels/area:%20git","name":"area: git","color":"1d76db","default":false},{"id":708416962,"node_id":"MDU6TGFiZWw3MDg0MTY5NjI=","url":"https://api.github.com/repos/Charcoal-SE/SmokeDetector/labels/hacktoberfest","name":"hacktoberfest","color":"ff8f00","default":false},{"id":77882206,"node_id":"MDU6TGFiZWw3Nzg4MjIwNg==","url":"https://api.github.com/repos/Charcoal-SE/SmokeDetector/labels/type:%20feature%20request","name":"type: feature request","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-08T02:43:42Z","updated_at":"2018-09-08T03:16:37Z","closed_at":null,"author_association":"MEMBER","body":"Currently in `globalvars.py`, we parse the output of `git status` and check for `HEAD detached`, to determine whether we're on a branch or not.\r\n\r\nThis is a bad practice because the output of `git status` is meant to be human-readable, not to be parsed by programs. We should probably use a program-friendly interface to determine whether HEAD is detached from branch."},"comment":{"url":"https://api.github.com/repos/Charcoal-SE/SmokeDetector/issues/comments/419608625","html_url":"https://github.com/Charcoal-SE/SmokeDetector/issues/2399#issuecomment-419608625","issue_url":"https://api.github.com/repos/Charcoal-SE/SmokeDetector/issues/2399","id":419608625,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTYwODYyNQ==","user":{"login":"iBug","id":7273074,"node_id":"MDQ6VXNlcjcyNzMwNzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7273074?v=4","gravatar_id":"","url":"https://api.github.com/users/iBug","html_url":"https://github.com/iBug","followers_url":"https://api.github.com/users/iBug/followers","following_url":"https://api.github.com/users/iBug/following{/other_user}","gists_url":"https://api.github.com/users/iBug/gists{/gist_id}","starred_url":"https://api.github.com/users/iBug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iBug/subscriptions","organizations_url":"https://api.github.com/users/iBug/orgs","repos_url":"https://api.github.com/users/iBug/repos","events_url":"https://api.github.com/users/iBug/events{/privacy}","received_events_url":"https://api.github.com/users/iBug/received_events","type":"User","site_admin":false},"created_at":"2018-09-08T03:16:37Z","updated_at":"2018-09-08T03:16:37Z","author_association":"MEMBER","body":"![contrib-guidance](https://user-images.githubusercontent.com/10406565/45100551-949aa500-b121-11e8-93e9-0bda7186d113.png)\r\n\r\n# Summary\r\n**Difficulty:**\r\n![1/5 stars](https://user-images.githubusercontent.com/10406565/45103061-edb90780-b126‌​-11e8-920a-1f25b8943efa.png)  \r\n**Scope:**\r\n![Narrow scope](https://user-images.githubusercontent.com/10406565/45105247-bbf66f80-b12b-11e8-9a46-79972ec1f7e3.png)  \r\n**Issue Owner:** iBug\r\n\r\nThis issue involved rewriting a function that calls `git` binary and checking its result (output or exit code), as well as an boolean test for detached HEAD state.\r\n\r\n# Guidance\r\nIf you have any experience with Python and the `subprocess` module, that's great. With some knowledge of `git` interface, this won't be too hard. You may want to rewrite [`git_status()`](https://github.com/Charcoal-SE/SmokeDetector/blob/master/globalvars.py#L27) so it doesn't call `git status` but a program-friendly interface (like `rev-parse`, but not this one). Then, you can rewrite [this check on Line 162](https://github.com/Charcoal-SE/SmokeDetector/blob/master/globalvars.py#L162) so it uses your rewritten function to determine the state of HEAD.\r\n\r\nIf you don't know how to elegantly interact with Git, don't worry. I asked [this question](https://stackoverflow.com/q/52221558/5958455) on Stack Overflow. You can learn the highest-voted answer and use the solution directly.\r\n\r\nOnce you're happy with your work, send us a pull request to this repository, and we'll review it together.\r\n\r\n# How to get help\r\nFor additional support in completing this issue, either:\r\n\r\n - comment on this thread\r\n - if you have a Stack Overflow account, drop into [our chatroom](https://chat.stackexchange.com/rooms/11540) (you'll need 20 reputation - if you don't have that, let the issue owner know your username or ID here so they can arrange for access)"}}
{"actor":{"display_login":"iBug"}}