Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #87 from frasergraham/master

Commit Selected Hunk
  • Loading branch information...
commit 8ab5ebd16115e7cef0943f00db285dfda14a8697 2 parents cf682ac + 28c117d
@sheldon sheldon authored
Showing with 12 additions and 0 deletions.
  1. +4 −0 Default.sublime-commands
  2. +1 −0  Main.sublime-menu
  3. +7 −0 git.py
View
4 Default.sublime-commands
@@ -115,4 +115,8 @@
"caption": "Git: Add Selected Hunk",
"command": "git_add_selected_hunk"
}
+ ,{
+ "caption": "Git: Commit Selected Hunk",
+ "command": "git_commit_selected_hunk"
+ }
]
View
1  Main.sublime-menu
@@ -22,6 +22,7 @@
,{ "caption": "Annotate", "command": "git_annotate" }
,{ "caption": "Clear Annotation", "command": "git_clear_annotation" }
,{ "caption": "Add Selected Hunk", "command": "git_add_selected_hunk" }
+ ,{ "caption": "Commit Selected Hunk", "command": "git_commit_selected_hunk" }
]
}
,{
View
7 git.py
@@ -904,3 +904,10 @@ def cull_diff(self, result):
self.run_command(['git', 'apply', '--cached'], stdin=diffs)
else:
sublime.status_message("No selected hunk")
+
+
+class GitCommitSelectedHunk(GitAddSelectedHunkCommand):
+ def run(self, edit):
+ self.run_command(['git', 'diff', '--no-color', self.get_file_name()], self.cull_diff)
+ self.get_window().run_command('git_commit')
+
Please sign in to comment.
Something went wrong with that request. Please try again.