sublime-text-git-autocommit icon indicating copy to clipboard operation
sublime-text-git-autocommit copied to clipboard

Add push

Open ghost opened this issue 10 years ago • 1 comments

I want push too

ghost avatar Jan 13 '15 08:01 ghost

First of all what you propose won't work, because git add doesn't support the push argument.

I bet you wanted to push after commit, then this should be done after line 41, something like:

self.run_command(['git', 'push'], callback=self.update_status)

But:

  1. Since this handler will be invoked after each git commit, and if you saved multiple files at once you will end with multiple pushes. I'd expected push only happen once. Probably once in a period of time, say, 30 seconds after last commit, same as commits are done 30 seconds after last modification of a file. So probably would be better to delay git push after line 66?
  2. Git commits usually always succeed (unless you have disk IO error), but git push in your case will likely require a network connection which may be unreachable at the moment. What would you expect in this case?
  3. I wouldn't want automatic git push for my repo, so I'd prefer a separate setting for this, probably inside the .sublime-text-git-autocommit:
auto_push: true

By the way, do you know git push is just a few key presses when you need it: CMD+P -> push -> Enter.

dmitrygusev avatar Jan 13 '15 09:01 dmitrygusev