{"action":"created","comment":{"url":"https://api.github.com/repos/divmain/GitSavvy/pulls/comments/26821754","id":26821754,"diff_hunk":"@@ -57,11 +59,37 @@ class GsCommitInitializeViewCommand(TextCommand, GitCommand):\n     the previous commit message if amending.\n     \"\"\"\n \n+    def amending(self):\n+        return self.view.settings().get(\"git_savvy.commit_view.amend\")\n+\n+    def fetch_commit_summary(self):\n+        \"\"\"\n+        Fetch the same pre-commit template git would use if you were doing\n+        `git commit` (showing staged, unstaged, etc.)\n+        \"\"\"\n+\n+        args = []\n+        if self.amending():\n+            args.append(\"--amend\")\n+\n+        dryrun = self.git(\"commit\", \"--dry-run\", *args, throw_on_stderr = False)\n+        # detect trying to do a commit with nothing staged\n+        if dryrun.find('no changes added') != -1:\n+            sublime.error_message(NO_STAGED_FILES)\n+\n+        commented_lines = map(lambda x: \"# {}\".format(x), dryrun.strip().split(\"\\n\"))\n+\n+        filtered_lines = []\n+        for line in commented_lines:\n+            if line.find('(use \"git') == -1:\n+                filtered_lines.append(line)\n+\n+        return \"\\n\".join(filtered_lines)\n+\n     def run(self, edit):\n         merge_msg_path = os.path.join(self.repo_path, \".git\", \"MERGE_MSG\")\n \n-        option_amend = self.view.settings().get(\"git_savvy.commit_view.amend\")\n-        if option_amend:\n+        if self.amending():","path":"core/commands/commit.py","position":61,"original_position":61,"commit_id":"2a490a37dd70fef199fac35560a37bfe68a28331","original_commit_id":"2a490a37dd70fef199fac35560a37bfe68a28331","user":{"login":"divmain","id":5016978,"avatar_url":"https://avatars.githubusercontent.com/u/5016978?v=3","gravatar_id":"","url":"https://api.github.com/users/divmain","html_url":"https://github.com/divmain","followers_url":"https://api.github.com/users/divmain/followers","following_url":"https://api.github.com/users/divmain/following{/other_user}","gists_url":"https://api.github.com/users/divmain/gists{/gist_id}","starred_url":"https://api.github.com/users/divmain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/divmain/subscriptions","organizations_url":"https://api.github.com/users/divmain/orgs","repos_url":"https://api.github.com/users/divmain/repos","events_url":"https://api.github.com/users/divmain/events{/privacy}","received_events_url":"https://api.github.com/users/divmain/received_events","type":"User","site_admin":false},"body":"This is an unnecessary change.","created_at":"2015-03-20T06:56:54Z","updated_at":"2015-03-20T06:56:54Z","html_url":"https://github.com/divmain/GitSavvy/pull/111#discussion_r26821754","pull_request_url":"https://api.github.com/repos/divmain/GitSavvy/pulls/111","_links":{"self":{"href":"https://api.github.com/repos/divmain/GitSavvy/pulls/comments/26821754"},"html":{"href":"https://github.com/divmain/GitSavvy/pull/111#discussion_r26821754"},"pull_request":{"href":"https://api.github.com/repos/divmain/GitSavvy/pulls/111"}}},"pull_request":{"url":"https://api.github.com/repos/divmain/GitSavvy/pulls/111","id":31583705,"html_url":"https://github.com/divmain/GitSavvy/pull/111","diff_url":"https://github.com/divmain/GitSavvy/pull/111.diff","patch_url":"https://github.com/divmain/GitSavvy/pull/111.patch","issue_url":"https://api.github.com/repos/divmain/GitSavvy/issues/111","number":111,"state":"open","locked":false,"title":"Commit: show summary when commiting","user":{"login":"yyyc514","id":6473,"avatar_url":"https://avatars.githubusercontent.com/u/6473?v=3","gravatar_id":"","url":"https://api.github.com/users/yyyc514","html_url":"https://github.com/yyyc514","followers_url":"https://api.github.com/users/yyyc514/followers","following_url":"https://api.github.com/users/yyyc514/following{/other_user}","gists_url":"https://api.github.com/users/yyyc514/gists{/gist_id}","starred_url":"https://api.github.com/users/yyyc514/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yyyc514/subscriptions","organizations_url":"https://api.github.com/users/yyyc514/orgs","repos_url":"https://api.github.com/users/yyyc514/repos","events_url":"https://api.github.com/users/yyyc514/events{/privacy}","received_events_url":"https://api.github.com/users/yyyc514/received_events","type":"User","site_admin":false},"body":null,"created_at":"2015-03-20T02:26:18Z","updated_at":"2015-03-20T06:56:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"403f80cb842875519f1f2145bb0050cad9cd63d4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/divmain/GitSavvy/pulls/111/commits","review_comments_url":"https://api.github.com/repos/divmain/GitSavvy/pulls/111/comments","review_comment_url":"https://api.github.com/repos/divmain/GitSavvy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/divmain/GitSavvy/issues/111/comments","statuses_url":"https://api.github.com/repos/divmain/GitSavvy/statuses/2a490a37dd70fef199fac35560a37bfe68a28331","head":{"label":"yyyc514:feature/show_commit_summary","ref":"feature/show_commit_summary","sha":"2a490a37dd70fef199fac35560a37bfe68a28331","user":{"login":"yyyc514","id":6473,"avatar_url":"https://avatars.githubusercontent.com/u/6473?v=3","gravatar_id":"","url":"https://api.github.com/users/yyyc514","html_url":"https://github.com/yyyc514","followers_url":"https://api.github.com/users/yyyc514/followers","following_url":"https://api.github.com/users/yyyc514/following{/other_user}","gists_url":"https://api.github.com/users/yyyc514/gists{/gist_id}","starred_url":"https://api.github.com/users/yyyc514/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yyyc514/subscriptions","organizations_url":"https://api.github.com/users/yyyc514/orgs","repos_url":"https://api.github.com/users/yyyc514/repos","events_url":"https://api.github.com/users/yyyc514/events{/privacy}","received_events_url":"https://api.github.com/users/yyyc514/received_events","type":"User","site_admin":false},"repo":{"id":32553844,"name":"GitSavvy","full_name":"yyyc514/GitSavvy","owner":{"login":"yyyc514","id":6473,"avatar_url":"https://avatars.githubusercontent.com/u/6473?v=3","gravatar_id":"","url":"https://api.github.com/users/yyyc514","html_url":"https://github.com/yyyc514","followers_url":"https://api.github.com/users/yyyc514/followers","following_url":"https://api.github.com/users/yyyc514/following{/other_user}","gists_url":"https://api.github.com/users/yyyc514/gists{/gist_id}","starred_url":"https://api.github.com/users/yyyc514/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yyyc514/subscriptions","organizations_url":"https://api.github.com/users/yyyc514/orgs","repos_url":"https://api.github.com/users/yyyc514/repos","events_url":"https://api.github.com/users/yyyc514/events{/privacy}","received_events_url":"https://api.github.com/users/yyyc514/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yyyc514/GitSavvy","description":"Full git and GitHub integration with Sublime Text 3.","fork":true,"url":"https://api.github.com/repos/yyyc514/GitSavvy","forks_url":"https://api.github.com/repos/yyyc514/GitSavvy/forks","keys_url":"https://api.github.com/repos/yyyc514/GitSavvy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yyyc514/GitSavvy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yyyc514/GitSavvy/teams","hooks_url":"https://api.github.com/repos/yyyc514/GitSavvy/hooks","issue_events_url":"https://api.github.com/repos/yyyc514/GitSavvy/issues/events{/number}","events_url":"https://api.github.com/repos/yyyc514/GitSavvy/events","assignees_url":"https://api.github.com/repos/yyyc514/GitSavvy/assignees{/user}","branches_url":"https://api.github.com/repos/yyyc514/GitSavvy/branches{/branch}","tags_url":"https://api.github.com/repos/yyyc514/GitSavvy/tags","blobs_url":"https://api.github.com/repos/yyyc514/GitSavvy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yyyc514/GitSavvy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yyyc514/GitSavvy/git/refs{/sha}","trees_url":"https://api.github.com/repos/yyyc514/GitSavvy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yyyc514/GitSavvy/statuses/{sha}","languages_url":"https://api.github.com/repos/yyyc514/GitSavvy/languages","stargazers_url":"https://api.github.com/repos/yyyc514/GitSavvy/stargazers","contributors_url":"https://api.github.com/repos/yyyc514/GitSavvy/contributors","subscribers_url":"https://api.github.com/repos/yyyc514/GitSavvy/subscribers","subscription_url":"https://api.github.com/repos/yyyc514/GitSavvy/subscription","commits_url":"https://api.github.com/repos/yyyc514/GitSavvy/commits{/sha}","git_commits_url":"https://api.github.com/repos/yyyc514/GitSavvy/git/commits{/sha}","comments_url":"https://api.github.com/repos/yyyc514/GitSavvy/comments{/number}","issue_comment_url":"https://api.github.com/repos/yyyc514/GitSavvy/issues/comments{/number}","contents_url":"https://api.github.com/repos/yyyc514/GitSavvy/contents/{+path}","compare_url":"https://api.github.com/repos/yyyc514/GitSavvy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yyyc514/GitSavvy/merges","archive_url":"https://api.github.com/repos/yyyc514/GitSavvy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yyyc514/GitSavvy/downloads","issues_url":"https://api.github.com/repos/yyyc514/GitSavvy/issues{/number}","pulls_url":"https://api.github.com/repos/yyyc514/GitSavvy/pulls{/number}","milestones_url":"https://api.github.com/repos/yyyc514/GitSavvy/milestones{/number}","notifications_url":"https://api.github.com/repos/yyyc514/GitSavvy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yyyc514/GitSavvy/labels{/name}","releases_url":"https://api.github.com/repos/yyyc514/GitSavvy/releases{/id}","created_at":"2015-03-20T00:33:57Z","updated_at":"2015-03-20T00:33:58Z","pushed_at":"2015-03-20T05:55:09Z","git_url":"git://github.com/yyyc514/GitSavvy.git","ssh_url":"git@github.com:yyyc514/GitSavvy.git","clone_url":"https://github.com/yyyc514/GitSavvy.git","svn_url":"https://github.com/yyyc514/GitSavvy","homepage":"","size":1741,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"divmain:master","ref":"master","sha":"3098732961bc669a380011633935f9ed4600679c","user":{"login":"divmain","id":5016978,"avatar_url":"https://avatars.githubusercontent.com/u/5016978?v=3","gravatar_id":"","url":"https://api.github.com/users/divmain","html_url":"https://github.com/divmain","followers_url":"https://api.github.com/users/divmain/followers","following_url":"https://api.github.com/users/divmain/following{/other_user}","gists_url":"https://api.github.com/users/divmain/gists{/gist_id}","starred_url":"https://api.github.com/users/divmain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/divmain/subscriptions","organizations_url":"https://api.github.com/users/divmain/orgs","repos_url":"https://api.github.com/users/divmain/repos","events_url":"https://api.github.com/users/divmain/events{/privacy}","received_events_url":"https://api.github.com/users/divmain/received_events","type":"User","site_admin":false},"repo":{"id":29417074,"name":"GitSavvy","full_name":"divmain/GitSavvy","owner":{"login":"divmain","id":5016978,"avatar_url":"https://avatars.githubusercontent.com/u/5016978?v=3","gravatar_id":"","url":"https://api.github.com/users/divmain","html_url":"https://github.com/divmain","followers_url":"https://api.github.com/users/divmain/followers","following_url":"https://api.github.com/users/divmain/following{/other_user}","gists_url":"https://api.github.com/users/divmain/gists{/gist_id}","starred_url":"https://api.github.com/users/divmain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/divmain/subscriptions","organizations_url":"https://api.github.com/users/divmain/orgs","repos_url":"https://api.github.com/users/divmain/repos","events_url":"https://api.github.com/users/divmain/events{/privacy}","received_events_url":"https://api.github.com/users/divmain/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/divmain/GitSavvy","description":"Full git and GitHub integration with Sublime Text 3.","fork":false,"url":"https://api.github.com/repos/divmain/GitSavvy","forks_url":"https://api.github.com/repos/divmain/GitSavvy/forks","keys_url":"https://api.github.com/repos/divmain/GitSavvy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/divmain/GitSavvy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/divmain/GitSavvy/teams","hooks_url":"https://api.github.com/repos/divmain/GitSavvy/hooks","issue_events_url":"https://api.github.com/repos/divmain/GitSavvy/issues/events{/number}","events_url":"https://api.github.com/repos/divmain/GitSavvy/events","assignees_url":"https://api.github.com/repos/divmain/GitSavvy/assignees{/user}","branches_url":"https://api.github.com/repos/divmain/GitSavvy/branches{/branch}","tags_url":"https://api.github.com/repos/divmain/GitSavvy/tags","blobs_url":"https://api.github.com/repos/divmain/GitSavvy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/divmain/GitSavvy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/divmain/GitSavvy/git/refs{/sha}","trees_url":"https://api.github.com/repos/divmain/GitSavvy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/divmain/GitSavvy/statuses/{sha}","languages_url":"https://api.github.com/repos/divmain/GitSavvy/languages","stargazers_url":"https://api.github.com/repos/divmain/GitSavvy/stargazers","contributors_url":"https://api.github.com/repos/divmain/GitSavvy/contributors","subscribers_url":"https://api.github.com/repos/divmain/GitSavvy/subscribers","subscription_url":"https://api.github.com/repos/divmain/GitSavvy/subscription","commits_url":"https://api.github.com/repos/divmain/GitSavvy/commits{/sha}","git_commits_url":"https://api.github.com/repos/divmain/GitSavvy/git/commits{/sha}","comments_url":"https://api.github.com/repos/divmain/GitSavvy/comments{/number}","issue_comment_url":"https://api.github.com/repos/divmain/GitSavvy/issues/comments{/number}","contents_url":"https://api.github.com/repos/divmain/GitSavvy/contents/{+path}","compare_url":"https://api.github.com/repos/divmain/GitSavvy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/divmain/GitSavvy/merges","archive_url":"https://api.github.com/repos/divmain/GitSavvy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/divmain/GitSavvy/downloads","issues_url":"https://api.github.com/repos/divmain/GitSavvy/issues{/number}","pulls_url":"https://api.github.com/repos/divmain/GitSavvy/pulls{/number}","milestones_url":"https://api.github.com/repos/divmain/GitSavvy/milestones{/number}","notifications_url":"https://api.github.com/repos/divmain/GitSavvy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/divmain/GitSavvy/labels{/name}","releases_url":"https://api.github.com/repos/divmain/GitSavvy/releases{/id}","created_at":"2015-01-18T05:40:08Z","updated_at":"2015-03-19T20:08:21Z","pushed_at":"2015-03-20T05:55:47Z","git_url":"git://github.com/divmain/GitSavvy.git","ssh_url":"git@github.com:divmain/GitSavvy.git","clone_url":"https://github.com/divmain/GitSavvy.git","svn_url":"https://github.com/divmain/GitSavvy","homepage":"","size":1741,"stargazers_count":842,"watchers_count":842,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":33,"forks":25,"open_issues":33,"watchers":842,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/divmain/GitSavvy/pulls/111"},"html":{"href":"https://github.com/divmain/GitSavvy/pull/111"},"issue":{"href":"https://api.github.com/repos/divmain/GitSavvy/issues/111"},"comments":{"href":"https://api.github.com/repos/divmain/GitSavvy/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/divmain/GitSavvy/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/divmain/GitSavvy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/divmain/GitSavvy/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/divmain/GitSavvy/statuses/2a490a37dd70fef199fac35560a37bfe68a28331"}}}}