chiark / gitweb /
Split brain: Better tag format filtering
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 22 Sep 2016 11:59:18 +0000 (12:59 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 26 Sep 2016 00:16:59 +0000 (01:16 +0100)
The code only makes tag formats `old' and `new'.  Make it easier to
add a new tag format config item entry later.

No functional change with existing configurations.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index 216a9c3ed6112aece96bb25659330cd959b55c89..5dfd97c7fdc45d3a0f4b9f2f53d67669845d8681 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -534,6 +534,9 @@ our %defcfg = ('dgit.default.distro' => 'debian',
               'dgit.default.archive-query' => 'madison:',
               'dgit.default.sshpsql-dbname' => 'service=projectb',
               'dgit.default.dgit-tag-format' => 'old,new,maint',
+              # old means "repo server accepts pushes with old dgit tags"
+              # new means "repo server accepts pushes with new dgit tags"
+              # maint means "repo server accepts split brain pushes"
               'dgit-distro.debian.archive-query' => 'ftpmasterapi:',
               'dgit-distro.debian.git-check' => 'url',
               'dgit-distro.debian.git-check-suffix' => '/info/refs',
@@ -1194,7 +1197,7 @@ sub select_tagformat () {
     die 'bug' if $tagformatfn && $tagformat_want;
     # ... $tagformat_want assigned after previous select_tagformat
 
-    my (@supported) = grep { $_ ne 'maint' } access_cfg_tagformats();
+    my (@supported) = grep { $_ =~ m/^(?:old|new)$/ } access_cfg_tagformats();
     printdebug "select_tagformat supported @supported\n";
 
     $tagformat_want //= [ $supported[0], "distro access configuration", 0 ];