Let gitcheckup push to all remotes.

This commit is contained in:
voussoir 2021-07-24 12:51:40 -07:00
parent 90fe477ad9
commit de5aca14a9
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -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()