From: Ian Jackson Date: Sun, 31 Jul 2016 17:49:55 +0000 (+0100) Subject: Split tags: Push the maintainer view tag, where supported X-Git-Tag: archive/debian/2.0~221 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=626570adb7708d465460d236c9da1b82a23c22b4 Split tags: Push the maintainer view tag, where supported We introduce a new `maint' possibility in to the dgit-tag-format access cfg list, presence of which indicates that the receiver is content to receive DEP-14-style maintainer-view (ie, non-dgit0 tags. For now, we default this to true. However, repos handled by dgit-repos-server cannot currently cope with this, because: * dgit-repos-server currently tries to be compatible with old dgits which send DEP-14-named dgit tags; * dgit-repos-server doesn't currently permit the creation of `extraneous' (ie, non-dgit) tags and branches. So for Debian, we do not set this flag. Signed-off-by: Ian Jackson --- diff --git a/TODO.BRANCH b/TODO.BRANCH index 7138c3b5..74514768 100644 --- a/TODO.BRANCH +++ b/TODO.BRANCH @@ -20,6 +20,8 @@ Want tests for old tag - rejecting push of same version with one tag when then the other +That, where appropriate, maint view tags are pushed to dgit git repo + ---------- Provide --gpbpq[=:] options diff --git a/dgit b/dgit index 548a25bd..288fc78d 100755 --- a/dgit +++ b/dgit @@ -34,6 +34,7 @@ use POSIX; use IPC::Open2; use Digest::SHA; use Digest::MD5; +use List::Util qw(any); use List::MoreUtils qw(pairwise); use Debian::Dgit; @@ -513,7 +514,7 @@ our %defcfg = ('dgit.default.distro' => 'debian', 'dgit.default.ssh' => 'ssh', 'dgit.default.archive-query' => 'madison:', 'dgit.default.sshpsql-dbname' => 'service=projectb', - 'dgit.default.dgit-tag-format' => 'old,new', + 'dgit.default.dgit-tag-format' => 'old,new,maint', 'dgit-distro.debian.archive-query' => 'ftpmasterapi:', 'dgit-distro.debian.git-check' => 'url', 'dgit-distro.debian.git-check-suffix' => '/info/refs', @@ -1161,7 +1162,7 @@ sub select_tagformat () { die 'bug' if $tagformatfn && $tagformat_want; # ... $tagformat_want assigned after previous select_tagformat - my (@supported) = access_cfg_tagformats(); + my (@supported) = grep { $_ ne 'maint' } access_cfg_tagformats(); printdebug "select_tagformat supported @supported\n"; $tagformat_want //= [ $supported[0], "distro access configuration", 0 ]; @@ -2247,7 +2248,8 @@ END my @pushrefs = $forceflag."HEAD:".rrref(); foreach my $tw (@tagwants) { my $view = $tw->{View}; - next unless $view eq 'dgit'; + next unless $view eq 'dgit' + or any { $_ eq $view } access_cfg_tagformats(); push @pushrefs, $forceflag."refs/tags/$tw->{Tag}"; } diff --git a/tests/lib b/tests/lib index f1ffa8b1..bd83be70 100644 --- a/tests/lib +++ b/tests/lib @@ -594,6 +594,7 @@ t-drs () { t-git-config dgit-distro.test-dummy.git-url "ext::$troot/drs-git-ext %S " t-git-config dgit-distro.test-dummy.git-check true t-git-config dgit-distro.test-dummy.git-create true + t-git-config dgit-distro.test-dummy.dgit-tag-format old,new cp $troot/gnupg/{dd.gpg,dm.gpg,dm.txt} $tmp/. cp $troot/suites $tmp/. cp $troot/suites $tmp/suites-master