Let gitcheckup push to all remotes.
This commit is contained in:
parent
90fe477ad9
commit
de5aca14a9
1 changed files with 18 additions and 2 deletions
|
@ -54,6 +54,7 @@ import sys
|
||||||
from voussoirkit import betterhelp
|
from voussoirkit import betterhelp
|
||||||
from voussoirkit import dotdict
|
from voussoirkit import dotdict
|
||||||
from voussoirkit import pathclass
|
from voussoirkit import pathclass
|
||||||
|
from voussoirkit import subproctools
|
||||||
from voussoirkit import vlogging
|
from voussoirkit import vlogging
|
||||||
from voussoirkit import winwhich
|
from voussoirkit import winwhich
|
||||||
|
|
||||||
|
@ -177,10 +178,25 @@ def git_pull():
|
||||||
command = [GIT, 'pull', '--all']
|
command = [GIT, 'pull', '--all']
|
||||||
return check_output(command)
|
return check_output(command)
|
||||||
|
|
||||||
def git_push():
|
def git_push_all():
|
||||||
|
remotes = git_remotes()
|
||||||
|
branch = git_current_branch()
|
||||||
|
for remote in remotes:
|
||||||
|
git_push(remote, branch)
|
||||||
|
|
||||||
|
def git_push(remote=None, branch=None):
|
||||||
command = [GIT, 'push']
|
command = [GIT, 'push']
|
||||||
|
if remote:
|
||||||
|
command.append(remote)
|
||||||
|
if branch:
|
||||||
|
command.append(branch)
|
||||||
return check_output(command)
|
return check_output(command)
|
||||||
|
|
||||||
|
def git_remotes():
|
||||||
|
command = [GIT, 'remote']
|
||||||
|
remotes = check_output(command).splitlines()
|
||||||
|
return remotes
|
||||||
|
|
||||||
def git_rev_parse(rev):
|
def git_rev_parse(rev):
|
||||||
command = [GIT, 'rev-parse', rev]
|
command = [GIT, 'rev-parse', rev]
|
||||||
return check_output(command)
|
return check_output(command)
|
||||||
|
@ -278,7 +294,7 @@ def gitcheckup(
|
||||||
git_pull()
|
git_pull()
|
||||||
|
|
||||||
if do_push:
|
if do_push:
|
||||||
git_push()
|
git_push_all()
|
||||||
|
|
||||||
commit_details = checkup_committed()
|
commit_details = checkup_committed()
|
||||||
push_details = checkup_pushed()
|
push_details = checkup_pushed()
|
||||||
|
|
Loading…
Reference in a new issue