summaryrefslogtreecommitdiff
path: root/bin/git-push-all
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-08-13 20:16:53 +0100
committerSean Whitton <spwhitton@spwhitton.name>2019-08-13 20:16:53 +0100
commit2523ef611eabc6dfbbd1b26e32e0127a237c77c6 (patch)
tree4f6d575f0ddd52375afa34323433c3c07bb16041 /bin/git-push-all
parent7f843918efd1859d6e21e9090cd333889f8addfa (diff)
downloaddotfiles-2523ef611eabc6dfbbd1b26e32e0127a237c77c6.tar.gz
factor out and rewrite unpushed tags checking code
Diffstat (limited to 'bin/git-push-all')
-rwxr-xr-xbin/git-push-all19
1 files changed, 4 insertions, 15 deletions
diff --git a/bin/git-push-all b/bin/git-push-all
index 99e7a88c..a737d1f5 100755
--- a/bin/git-push-all
+++ b/bin/git-push-all
@@ -44,12 +44,14 @@
use strict;
use warnings;
+use lib "$ENV{HOME}/lib/perl5";
no warnings "experimental::smartmatch";
use Array::Utils qw{ array_minus };
use Git::Wrapper;
use Config::GitLike;
-use List::MoreUtils qw{ uniq apply };
+use List::MoreUtils qw{ apply };
+use Local::Util::Git qw(unpushed_tags);
my $git = Git::Wrapper->new(".");
my $config = Config::GitLike->new( confname => 'config' );
@@ -110,20 +112,7 @@ foreach my $remote ( keys %pushes ) {
# src-unregistered
unless ( "--no-tags" ~~ @ARGV ) {
- my @tags = grep { !(m|archive/debian/\S+|) } $git->tag;
- my @remotes = $git->remote;
- my @pushed_tags;
-
- foreach my $remote ( @remotes ) {
- unless ( $remote eq "dgit" ) {
- my @this_remote_tags = apply { s|\^\{\}$||; s|[a-f0-9]+\trefs/tags/|| }
- $git->ls_remote( { tags => 1 }, $remote );
- push @pushed_tags, @this_remote_tags;
- }
- }
-
- @pushed_tags = uniq @pushed_tags;
- my @unpushed_tags = array_minus ( @tags, @pushed_tags );
+ my @unpushed_tags = unpushed_tags();
if ( scalar @unpushed_tags > 0 ) {
print "E: the following tags have not been pushed to any remote:\n";