{"action":"created","comment":{"url":"https://api.github.com/repos/jisaacks/GitGutter/pulls/comments/88801053","pull_request_review_id":9364085,"id":88801053,"diff_hunk":"@@ -285,33 +292,44 @@ def process_diff_line_change(self, line_nr, diff_str):\n         return ([], -1, -1, {})\n \n     def diff_line_change(self, line):\n+        \"\"\"Run git diff and extract the changes of a certain line.\n+\n+        NOTE: This method is used for diff popup.\n+        \"\"\"\n         return self.diff_str().then(\n             partial(self.process_diff_line_change, line))\n \n     def diff(self):\n+        \"\"\"Run git diff to check for inserted, modified and deleted lines.\n+\n+        NOTE: This method is used to update the gutter markers.\n+        \"\"\"\n         return self.diff_str().then(self.process_diff)\n \n     def untracked(self):\n+        \"\"\"Determine whether the view shows an untracked file.\"\"\"\n         return self.handle_files([])\n \n     def ignored(self):\n+        \"\"\"Determine whether the view shows an ignored file.\"\"\"\n         return self.handle_files(['-i'])\n \n     def handle_files(self, additional_args):\n+        \"\"\"Run git ls-files to check for untracked or ignored file.\"\"\"\n         if self.on_disk() and self.git_path:\n             def is_nonempty(results):\n-                encoding = self._get_view_encoding()\n-                try:\n-                    decoded_results = results.decode(encoding.replace(' ', ''))\n-                except UnicodeError:\n-                    decoded_results = results.decode(\"utf-8\")\n-                return (decoded_results != \"\")\n+                \"\"\"Determine if view's file is in git's index.\n+\n+                If the view's file is not part of the index\n+                git returns empty output to stdout.\n+                \"\"\"\n+                return bool(results[1])","path":"git_gutter_handler.py","position":null,"original_position":130,"commit_id":"63d3554aedf11b3a1689264fbeed38cf1f3ac0f4","original_commit_id":"59d5b09b85667248dcf6e56487424c3fa318c576","user":{"login":"deathaxe","id":16542113,"avatar_url":"https://avatars.githubusercontent.com/u/16542113?v=3","gravatar_id":"","url":"https://api.github.com/users/deathaxe","html_url":"https://github.com/deathaxe","followers_url":"https://api.github.com/users/deathaxe/followers","following_url":"https://api.github.com/users/deathaxe/following{/other_user}","gists_url":"https://api.github.com/users/deathaxe/gists{/gist_id}","starred_url":"https://api.github.com/users/deathaxe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deathaxe/subscriptions","organizations_url":"https://api.github.com/users/deathaxe/orgs","repos_url":"https://api.github.com/users/deathaxe/repos","events_url":"https://api.github.com/users/deathaxe/events{/privacy}","received_events_url":"https://api.github.com/users/deathaxe/received_events","type":"User","site_admin":false},"body":"Regression! I returned git exit code in the results in the reverted changes, when running git diff directly against the file. This is obiously wrong and you are right as usual.","created_at":"2016-11-20T13:07:23Z","updated_at":"2016-11-20T13:07:23Z","html_url":"https://github.com/jisaacks/GitGutter/pull/331#discussion_r88801053","pull_request_url":"https://api.github.com/repos/jisaacks/GitGutter/pulls/331","_links":{"self":{"href":"https://api.github.com/repos/jisaacks/GitGutter/pulls/comments/88801053"},"html":{"href":"https://github.com/jisaacks/GitGutter/pull/331#discussion_r88801053"},"pull_request":{"href":"https://api.github.com/repos/jisaacks/GitGutter/pulls/331"}}},"pull_request":{"url":"https://api.github.com/repos/jisaacks/GitGutter/pulls/331","id":94012359,"html_url":"https://github.com/jisaacks/GitGutter/pull/331","diff_url":"https://github.com/jisaacks/GitGutter/pull/331.diff","patch_url":"https://github.com/jisaacks/GitGutter/pull/331.patch","issue_url":"https://api.github.com/repos/jisaacks/GitGutter/issues/331","number":331,"state":"open","locked":false,"title":"Some usage optimization","user":{"login":"deathaxe","id":16542113,"avatar_url":"https://avatars.githubusercontent.com/u/16542113?v=3","gravatar_id":"","url":"https://api.github.com/users/deathaxe","html_url":"https://github.com/deathaxe","followers_url":"https://api.github.com/users/deathaxe/followers","following_url":"https://api.github.com/users/deathaxe/following{/other_user}","gists_url":"https://api.github.com/users/deathaxe/gists{/gist_id}","starred_url":"https://api.github.com/users/deathaxe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deathaxe/subscriptions","organizations_url":"https://api.github.com/users/deathaxe/orgs","repos_url":"https://api.github.com/users/deathaxe/repos","events_url":"https://api.github.com/users/deathaxe/events{/privacy}","received_events_url":"https://api.github.com/users/deathaxe/received_events","type":"User","site_admin":false},"body":"Hello guys, very much thanks for your incredible good work with GitGutter 1.4.0. \r\n\r\nA also made up my mind how to improve this plug-in a little bit and found two things I would like to discuss or already started to in the issues section.\r\n\r\nSorry for I was not yet able to distinguish the commits to make a pull request for each.\r\n\r\n1. Create temp files only for views, whose content is stored in a git repository. (trivial minor improvement)\r\n2. Run Git and diff only if necessary and avoid running it twice.\r\n\r\nI think it's better to talk about real code, than generally discuss things. I know there are some concerns about the second probosal and I am sure it needs extensive testing before productive use, but I think it could generally help saving some CPU in the background.\r\n\r\nThe basic idea behind it is to let git_gutter run only for visible views if live_mode or focus_change_mode are active as git_gutter will run for each view being activated anyway.\r\n\r\nI was already able to prevent git_gutter from running 100 times when doing a search and replace in files with this commit and did not find significant issues with gutter not being updated for none active but visible views. \r\n\r\nHope you are willing to test and discuss it. :-)\r\n\r\n","created_at":"2016-11-16T17:28:46Z","updated_at":"2016-11-20T13:07:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c9c53c94788a8d32e34da3aedd40f064391c2c2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jisaacks/GitGutter/pulls/331/commits","review_comments_url":"https://api.github.com/repos/jisaacks/GitGutter/pulls/331/comments","review_comment_url":"https://api.github.com/repos/jisaacks/GitGutter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jisaacks/GitGutter/issues/331/comments","statuses_url":"https://api.github.com/repos/jisaacks/GitGutter/statuses/63d3554aedf11b3a1689264fbeed38cf1f3ac0f4","head":{"label":"deathaxe:develop","ref":"develop","sha":"63d3554aedf11b3a1689264fbeed38cf1f3ac0f4","user":{"login":"deathaxe","id":16542113,"avatar_url":"https://avatars.githubusercontent.com/u/16542113?v=3","gravatar_id":"","url":"https://api.github.com/users/deathaxe","html_url":"https://github.com/deathaxe","followers_url":"https://api.github.com/users/deathaxe/followers","following_url":"https://api.github.com/users/deathaxe/following{/other_user}","gists_url":"https://api.github.com/users/deathaxe/gists{/gist_id}","starred_url":"https://api.github.com/users/deathaxe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deathaxe/subscriptions","organizations_url":"https://api.github.com/users/deathaxe/orgs","repos_url":"https://api.github.com/users/deathaxe/repos","events_url":"https://api.github.com/users/deathaxe/events{/privacy}","received_events_url":"https://api.github.com/users/deathaxe/received_events","type":"User","site_admin":false},"repo":{"id":73742164,"name":"GitGutter","full_name":"deathaxe/GitGutter","owner":{"login":"deathaxe","id":16542113,"avatar_url":"https://avatars.githubusercontent.com/u/16542113?v=3","gravatar_id":"","url":"https://api.github.com/users/deathaxe","html_url":"https://github.com/deathaxe","followers_url":"https://api.github.com/users/deathaxe/followers","following_url":"https://api.github.com/users/deathaxe/following{/other_user}","gists_url":"https://api.github.com/users/deathaxe/gists{/gist_id}","starred_url":"https://api.github.com/users/deathaxe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deathaxe/subscriptions","organizations_url":"https://api.github.com/users/deathaxe/orgs","repos_url":"https://api.github.com/users/deathaxe/repos","events_url":"https://api.github.com/users/deathaxe/events{/privacy}","received_events_url":"https://api.github.com/users/deathaxe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/deathaxe/GitGutter","description":"A Sublime Text 2/3 plugin to see git diff in gutter","fork":true,"url":"https://api.github.com/repos/deathaxe/GitGutter","forks_url":"https://api.github.com/repos/deathaxe/GitGutter/forks","keys_url":"https://api.github.com/repos/deathaxe/GitGutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deathaxe/GitGutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deathaxe/GitGutter/teams","hooks_url":"https://api.github.com/repos/deathaxe/GitGutter/hooks","issue_events_url":"https://api.github.com/repos/deathaxe/GitGutter/issues/events{/number}","events_url":"https://api.github.com/repos/deathaxe/GitGutter/events","assignees_url":"https://api.github.com/repos/deathaxe/GitGutter/assignees{/user}","branches_url":"https://api.github.com/repos/deathaxe/GitGutter/branches{/branch}","tags_url":"https://api.github.com/repos/deathaxe/GitGutter/tags","blobs_url":"https://api.github.com/repos/deathaxe/GitGutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deathaxe/GitGutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deathaxe/GitGutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/deathaxe/GitGutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deathaxe/GitGutter/statuses/{sha}","languages_url":"https://api.github.com/repos/deathaxe/GitGutter/languages","stargazers_url":"https://api.github.com/repos/deathaxe/GitGutter/stargazers","contributors_url":"https://api.github.com/repos/deathaxe/GitGutter/contributors","subscribers_url":"https://api.github.com/repos/deathaxe/GitGutter/subscribers","subscription_url":"https://api.github.com/repos/deathaxe/GitGutter/subscription","commits_url":"https://api.github.com/repos/deathaxe/GitGutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/deathaxe/GitGutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/deathaxe/GitGutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/deathaxe/GitGutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/deathaxe/GitGutter/contents/{+path}","compare_url":"https://api.github.com/repos/deathaxe/GitGutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deathaxe/GitGutter/merges","archive_url":"https://api.github.com/repos/deathaxe/GitGutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deathaxe/GitGutter/downloads","issues_url":"https://api.github.com/repos/deathaxe/GitGutter/issues{/number}","pulls_url":"https://api.github.com/repos/deathaxe/GitGutter/pulls{/number}","milestones_url":"https://api.github.com/repos/deathaxe/GitGutter/milestones{/number}","notifications_url":"https://api.github.com/repos/deathaxe/GitGutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deathaxe/GitGutter/labels{/name}","releases_url":"https://api.github.com/repos/deathaxe/GitGutter/releases{/id}","deployments_url":"https://api.github.com/repos/deathaxe/GitGutter/deployments","created_at":"2016-11-14T20:00:30Z","updated_at":"2016-11-14T20:00:31Z","pushed_at":"2016-11-20T13:05:23Z","git_url":"git://github.com/deathaxe/GitGutter.git","ssh_url":"git@github.com:deathaxe/GitGutter.git","clone_url":"https://github.com/deathaxe/GitGutter.git","svn_url":"https://github.com/deathaxe/GitGutter","homepage":"","size":366,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jisaacks:master","ref":"master","sha":"6c6c09f06bfee06d6c90da7a5ac546355192881c","user":{"login":"jisaacks","id":1355481,"avatar_url":"https://avatars.githubusercontent.com/u/1355481?v=3","gravatar_id":"","url":"https://api.github.com/users/jisaacks","html_url":"https://github.com/jisaacks","followers_url":"https://api.github.com/users/jisaacks/followers","following_url":"https://api.github.com/users/jisaacks/following{/other_user}","gists_url":"https://api.github.com/users/jisaacks/gists{/gist_id}","starred_url":"https://api.github.com/users/jisaacks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jisaacks/subscriptions","organizations_url":"https://api.github.com/users/jisaacks/orgs","repos_url":"https://api.github.com/users/jisaacks/repos","events_url":"https://api.github.com/users/jisaacks/events{/privacy}","received_events_url":"https://api.github.com/users/jisaacks/received_events","type":"User","site_admin":false},"repo":{"id":7064308,"name":"GitGutter","full_name":"jisaacks/GitGutter","owner":{"login":"jisaacks","id":1355481,"avatar_url":"https://avatars.githubusercontent.com/u/1355481?v=3","gravatar_id":"","url":"https://api.github.com/users/jisaacks","html_url":"https://github.com/jisaacks","followers_url":"https://api.github.com/users/jisaacks/followers","following_url":"https://api.github.com/users/jisaacks/following{/other_user}","gists_url":"https://api.github.com/users/jisaacks/gists{/gist_id}","starred_url":"https://api.github.com/users/jisaacks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jisaacks/subscriptions","organizations_url":"https://api.github.com/users/jisaacks/orgs","repos_url":"https://api.github.com/users/jisaacks/repos","events_url":"https://api.github.com/users/jisaacks/events{/privacy}","received_events_url":"https://api.github.com/users/jisaacks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jisaacks/GitGutter","description":"A Sublime Text 2/3 plugin to see git diff in gutter","fork":false,"url":"https://api.github.com/repos/jisaacks/GitGutter","forks_url":"https://api.github.com/repos/jisaacks/GitGutter/forks","keys_url":"https://api.github.com/repos/jisaacks/GitGutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jisaacks/GitGutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jisaacks/GitGutter/teams","hooks_url":"https://api.github.com/repos/jisaacks/GitGutter/hooks","issue_events_url":"https://api.github.com/repos/jisaacks/GitGutter/issues/events{/number}","events_url":"https://api.github.com/repos/jisaacks/GitGutter/events","assignees_url":"https://api.github.com/repos/jisaacks/GitGutter/assignees{/user}","branches_url":"https://api.github.com/repos/jisaacks/GitGutter/branches{/branch}","tags_url":"https://api.github.com/repos/jisaacks/GitGutter/tags","blobs_url":"https://api.github.com/repos/jisaacks/GitGutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jisaacks/GitGutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jisaacks/GitGutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/jisaacks/GitGutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jisaacks/GitGutter/statuses/{sha}","languages_url":"https://api.github.com/repos/jisaacks/GitGutter/languages","stargazers_url":"https://api.github.com/repos/jisaacks/GitGutter/stargazers","contributors_url":"https://api.github.com/repos/jisaacks/GitGutter/contributors","subscribers_url":"https://api.github.com/repos/jisaacks/GitGutter/subscribers","subscription_url":"https://api.github.com/repos/jisaacks/GitGutter/subscription","commits_url":"https://api.github.com/repos/jisaacks/GitGutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/jisaacks/GitGutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/jisaacks/GitGutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/jisaacks/GitGutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/jisaacks/GitGutter/contents/{+path}","compare_url":"https://api.github.com/repos/jisaacks/GitGutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jisaacks/GitGutter/merges","archive_url":"https://api.github.com/repos/jisaacks/GitGutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jisaacks/GitGutter/downloads","issues_url":"https://api.github.com/repos/jisaacks/GitGutter/issues{/number}","pulls_url":"https://api.github.com/repos/jisaacks/GitGutter/pulls{/number}","milestones_url":"https://api.github.com/repos/jisaacks/GitGutter/milestones{/number}","notifications_url":"https://api.github.com/repos/jisaacks/GitGutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jisaacks/GitGutter/labels{/name}","releases_url":"https://api.github.com/repos/jisaacks/GitGutter/releases{/id}","deployments_url":"https://api.github.com/repos/jisaacks/GitGutter/deployments","created_at":"2012-12-08T05:29:00Z","updated_at":"2016-11-19T20:16:45Z","pushed_at":"2016-11-20T13:05:24Z","git_url":"git://github.com/jisaacks/GitGutter.git","ssh_url":"git@github.com:jisaacks/GitGutter.git","clone_url":"https://github.com/jisaacks/GitGutter.git","svn_url":"https://github.com/jisaacks/GitGutter","homepage":"","size":528,"stargazers_count":3285,"watchers_count":3285,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":212,"mirror_url":null,"open_issues_count":50,"forks":212,"open_issues":50,"watchers":3285,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jisaacks/GitGutter/pulls/331"},"html":{"href":"https://github.com/jisaacks/GitGutter/pull/331"},"issue":{"href":"https://api.github.com/repos/jisaacks/GitGutter/issues/331"},"comments":{"href":"https://api.github.com/repos/jisaacks/GitGutter/issues/331/comments"},"review_comments":{"href":"https://api.github.com/repos/jisaacks/GitGutter/pulls/331/comments"},"review_comment":{"href":"https://api.github.com/repos/jisaacks/GitGutter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jisaacks/GitGutter/pulls/331/commits"},"statuses":{"href":"https://api.github.com/repos/jisaacks/GitGutter/statuses/63d3554aedf11b3a1689264fbeed38cf1f3ac0f4"}}}}
{"actor":{"display_login":"deathaxe"}}