Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Quickly add all changed files in a commit #239

Open
wants to merge 4 commits into from

2 participants

Sean Keenan Henry.T
Sean Keenan

Not sure if it's good practice to use -a on a commit, but I do it all the time and wanted to add it!

Thanks for making the repo!

Henry.T

Well I used to think -a/-am can fix move file action from being separated into two action of delete and add, as well as rename.
But I tried it just now, but it's always delete&add operation, no matter if there is a -a.
The only thing -a do is to stage all tracked file to current commit command you are executing now.
So this modification is maybe not as useful as it seem like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 40 additions and 0 deletions.
  1. +8 −0 Default.sublime-commands
  2. +32 −0 commit.py
8 Default.sublime-commands
View
@@ -67,6 +67,14 @@
"command": "git_quick_commit"
}
,{
+ "caption": "Git: Quick All Commit",
+ "command": "git_quick_all_commit"
+ }
+ ,{
+ "caption": "Git: Quick All Commit and Push",
+ "command": "git_quick_all_commit_push"
+ }
+ ,{
"caption": "Git: Status",
"command": "git_status"
}
32 commit.py
View
@@ -29,6 +29,38 @@ def add_done(self, message, result):
self.run_command(['git', 'commit', '-m', message])
+class GitQuickAllCommitCommand(GitTextCommand):
+ def run(self, edit):
+ self.get_window().show_input_panel("Commit All Message", "",
+ self.on_input, None, None)
+
+ def on_input(self, message):
+ if message.strip() == "":
+ self.panel("No commit message provided")
+ return
+ self.run_command(['git', 'commit', '-am', message])
+
+
+
+class GitQuickAllCommitPushCommand(GitTextCommand):
+ def run(self, edit):
+ self.get_window().show_input_panel("Commit and Push All Message", "",
+ self.on_input, None, None)
+
+ def on_input(self, message):
+ if message.strip() == "":
+ self.panel("No commit message provided")
+ return
+ self.run_command(['git', 'commit', '-am', message],
+ functools.partial(self.commit_done, message))
+
+ def commit_done(self, message, result):
+ if result.strip() == "":
+ sublime.error_message("Error Commiting:\n" + result)
+ return
+ self.run_command(['git', 'push'])
+
+
# Commit is complicated. It'd be easy if I just wanted to let it run
# on OSX, and assume that subl was in the $PATH. However... I can't do
# that. Second choice was to set $GIT_EDITOR to sublime text for the call
Something went wrong with that request. Please try again.