summaryrefslogtreecommitdiff
path: root/bin/git-push-all
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2016-06-26 20:01:39 +0900
committerSean Whitton <spwhitton@spwhitton.name>2016-06-26 20:01:39 +0900
commitc49292fcfb71562a1969f9cdfe4aaebb9a461296 (patch)
tree990dae86d4028085751793903c2e6cbfb1bdb4e8 /bin/git-push-all
parentdb5e4edb7a965de36cb109bf9960776a8ca867cf (diff)
downloaddotfiles-c49292fcfb71562a1969f9cdfe4aaebb9a461296.tar.gz
start git-push-all
Diffstat (limited to 'bin/git-push-all')
-rwxr-xr-xbin/git-push-all66
1 files changed, 66 insertions, 0 deletions
diff --git a/bin/git-push-all b/bin/git-push-all
new file mode 100755
index 00000000..0ddc339b
--- /dev/null
+++ b/bin/git-push-all
@@ -0,0 +1,66 @@
+#!/usr/bin/perl
+
+# git-push-all -- intelligently push most branches
+
+# Copyright (C) 2016 Sean Whitton
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Prerequisites:
+
+# The Git::Wrapper and Config::GitLike perl library. On a Debian system,
+# apt-get install libgit-wrapper-perl libconfig-gitlike-perl
+
+# Description:
+
+# This script will try to push all your branches to the places they
+# should be pushed. Specifically,
+#
+# - If remote.pushDefault is set, push all matching branches to each
+# remote mentioned in remote.pushDefault or a
+# branch.<name>.pushRemote, with --follow-tags. I.e. for *each* remote
+#
+# git push --follow-tags <remote> :
+#
+# - Otherwise, push all matching branches and all tags to each remote. I.e.
+# for *each* remote
+#
+# git push --tags <remote> :
+#
+# In summary, this script is similar to `git push --all --tags` except
+# that it doesn't create any new remote branches. The recommended
+# usage is to run `git push-all` followed by some command which lists
+# branches that haven't been pushed anywhere, such as `mr status` from
+# the myrepos package. These can then be manually pushed to the right
+# places.
+
+use strict;
+use warnings;
+
+use Git::Wrapper;
+use Config::GitLike;
+
+use Data::Dumper;
+
+my $git = Git::Wrapper->new(".");
+my $config = Config::GitLike->load_file(".git/config");
+
+# $config->get_regexp( key => "branch.*pushRemote" );
+
+# my @remotes = $git->remote;
+# foreach my $remote ( @remotes ) {
+# unless ( $remote eq "dgit" ) {
+
+# }
+# }