{"action":"created","issue":{"url":"https://api.github.com/repos/pi-hole/pi-hole/issues/1033","repository_url":"https://api.github.com/repos/pi-hole/pi-hole","labels_url":"https://api.github.com/repos/pi-hole/pi-hole/issues/1033/labels{/name}","comments_url":"https://api.github.com/repos/pi-hole/pi-hole/issues/1033/comments","events_url":"https://api.github.com/repos/pi-hole/pi-hole/issues/1033/events","html_url":"https://github.com/pi-hole/pi-hole/pull/1033","id":197465937,"number":1033,"title":"update.sh code refactoring","user":{"login":"DL6ER","id":16748619,"avatar_url":"https://avatars.githubusercontent.com/u/16748619?v=3","gravatar_id":"","url":"https://api.github.com/users/DL6ER","html_url":"https://github.com/DL6ER","followers_url":"https://api.github.com/users/DL6ER/followers","following_url":"https://api.github.com/users/DL6ER/following{/other_user}","gists_url":"https://api.github.com/users/DL6ER/gists{/gist_id}","starred_url":"https://api.github.com/users/DL6ER/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DL6ER/subscriptions","organizations_url":"https://api.github.com/users/DL6ER/orgs","repos_url":"https://api.github.com/users/DL6ER/repos","events_url":"https://api.github.com/users/DL6ER/events{/privacy}","received_events_url":"https://api.github.com/users/DL6ER/received_events","type":"User","site_admin":false},"labels":[{"id":473394418,"url":"https://api.github.com/repos/pi-hole/pi-hole/labels/Bug%20fix","name":"Bug fix","color":"129e5e","default":false},{"id":105416351,"url":"https://api.github.com/repos/pi-hole/pi-hole/labels/Enhancement","name":"Enhancement","color":"3A96E2","default":false},{"id":316397980,"url":"https://api.github.com/repos/pi-hole/pi-hole/labels/Testing%20Required","name":"Testing Required","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/pi-hole/pi-hole/milestones/16","html_url":"https://github.com/pi-hole/pi-hole/milestone/16","labels_url":"https://api.github.com/repos/pi-hole/pi-hole/milestones/16/labels","id":2200983,"number":16,"title":"v2.11","description":"","creator":{"login":"DL6ER","id":16748619,"avatar_url":"https://avatars.githubusercontent.com/u/16748619?v=3","gravatar_id":"","url":"https://api.github.com/users/DL6ER","html_url":"https://github.com/DL6ER","followers_url":"https://api.github.com/users/DL6ER/followers","following_url":"https://api.github.com/users/DL6ER/following{/other_user}","gists_url":"https://api.github.com/users/DL6ER/gists{/gist_id}","starred_url":"https://api.github.com/users/DL6ER/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DL6ER/subscriptions","organizations_url":"https://api.github.com/users/DL6ER/orgs","repos_url":"https://api.github.com/users/DL6ER/repos","events_url":"https://api.github.com/users/DL6ER/events{/privacy}","received_events_url":"https://api.github.com/users/DL6ER/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":11,"state":"open","created_at":"2016-12-16T15:12:05Z","updated_at":"2016-12-24T14:47:25Z","due_on":"2017-01-05T08:00:00Z","closed_at":null},"comments":2,"created_at":"2016-12-24T14:47:25Z","updated_at":"2016-12-24T19:47:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pi-hole/pi-hole/pulls/1033","html_url":"https://github.com/pi-hole/pi-hole/pull/1033","diff_url":"https://github.com/pi-hole/pi-hole/pull/1033.diff","patch_url":"https://github.com/pi-hole/pi-hole/pull/1033.patch"},"body":"**By submitting this pull request, I confirm the following (please check boxes, eg [X]) _Failure to fill the template will close your PR_:**\r\n\r\n***Please submit all pull requests against the `development` branch. Failure to do so will delay or deny your request***\r\n\r\n- [X] I have read and understood the [contributors guide](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md).\r\n- [X] I have checked that [another pull request](https://github.com/pi-hole/pi-hole/pulls) for this purpose does not exist.\r\n- [X] I have considered, and confirmed that this submission will be valuable to others.\r\n- [X] I accept that this submission may not be used, and the pull request closed at the will of the maintainer.\r\n- [X] I give this submission freely, and claim no ownership to its content.\r\n\r\n**How familiar are you with the codebase?:** 10\r\n\r\n---\r\n\r\nCode refactoring of the existing `update.sh` without changing its external behavior. Internally, the behavior changes (getting completely independent of GitHub tags).\r\n\r\nThe old logic has been:\r\n\r\n1. Get tag from GitHub\r\n2. Get local tag\r\n3. Compare tags and update the corresponding parts, if necessary\r\n\r\nProposed new logic (we discussed about that):\r\n\r\n1. Fetch (possible) changes from `origin`\r\n2. Get local git status\r\n3. Update if local copy is behind remote version\r\n\r\nNote that the new behavior is independent of tags but relies on the git log, only. Hence, it is much more reliable and trustworthy.\r\n\r\n_This template was created based on the work of [`udemy-dl`](https://github.com/nishad/udemy-dl/blob/master/LICENSE)._\r\n"},"comment":{"url":"https://api.github.com/repos/pi-hole/pi-hole/issues/comments/269097903","html_url":"https://github.com/pi-hole/pi-hole/pull/1033#issuecomment-269097903","issue_url":"https://api.github.com/repos/pi-hole/pi-hole/issues/1033","id":269097903,"user":{"login":"dschaper","id":2782850,"avatar_url":"https://avatars.githubusercontent.com/u/2782850?v=3","gravatar_id":"","url":"https://api.github.com/users/dschaper","html_url":"https://github.com/dschaper","followers_url":"https://api.github.com/users/dschaper/followers","following_url":"https://api.github.com/users/dschaper/following{/other_user}","gists_url":"https://api.github.com/users/dschaper/gists{/gist_id}","starred_url":"https://api.github.com/users/dschaper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dschaper/subscriptions","organizations_url":"https://api.github.com/users/dschaper/orgs","repos_url":"https://api.github.com/users/dschaper/repos","events_url":"https://api.github.com/users/dschaper/events{/privacy}","received_events_url":"https://api.github.com/users/dschaper/received_events","type":"User","site_admin":false},"created_at":"2016-12-24T19:47:07Z","updated_at":"2016-12-24T19:47:07Z","body":"`pihole -v` would show the tag for the release, but not the hash (currently.) Ideally, the update script shouldn't output any kind of information, just a return value that the caller would identify and then let the caller print the information. `update.sh` shouldn't ever be run bare, it should be called as a utility script/library function. Will the user ever see any of the output from this script?"}}
{"actor":{"display_login":"dschaper"}}