summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-10-08 06:49:56 -0700
committerSean Whitton <spwhitton@spwhitton.name>2019-10-08 06:49:56 -0700
commit22031938b14c6cbb06b59f87495b475538b15082 (patch)
tree50018f89c64858b4294d6aae254178eb6c095ca9 /lib
parentd7908e1b59deb8877294a87acaa3a447fd7311ba (diff)
downloaddotfiles-22031938b14c6cbb06b59f87495b475538b15082.tar.gz
ignore debian/foo tags where archive/debian/foo exists
Diffstat (limited to 'lib')
-rw-r--r--lib/perl5/Local/Util/Git.pm21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/perl5/Local/Util/Git.pm b/lib/perl5/Local/Util/Git.pm
index ebbb0318..2db20c89 100644
--- a/lib/perl5/Local/Util/Git.pm
+++ b/lib/perl5/Local/Util/Git.pm
@@ -43,11 +43,24 @@ sub unpushed_tags {
# (note that dgit doesn't create an origin remote pointing to
# dgit-repos anymore)
#
- # We could also ignore a debian/foo tag where the corresponding
- # archive/debian/foo tag exists, because that means the latter has
- # been pushed to dgit repos?
- chomp(my @tags = grep !m|^archive/debian/|, `$git tag`);
+ # We also ignore a debian/foo tag where the corresponding
+ # archive/debian/foo tag exists, because that means the former has
+ # been pushed to dgit repos
+ chomp(my @all_tags = `$git tag`);
die "failed to get git tags" unless ($? == 0);
+ my @tags;
+ my %dgit_archive_tags;
+ for (@all_tags) {
+ if (m|^archive/debian/|) {
+ $dgit_archive_tags{$_} = undef;
+ } else {
+ push @tags, $_;
+ }
+ }
+ @tags
+ = grep { !(m|^debian/| and exists $dgit_archive_tags{"archive/$_"}) }
+ @tags;
+
chomp(my @remotes = `$git remote`);
die "failed to get git remotes" unless ($? == 0);
@remotes = grep !/\Adgit\z/, @remotes;