chiark / gitweb /
dgit: Introduce "deliberatelies"
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 17 Mar 2015 22:22:44 +0000 (22:22 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 22 Mar 2015 15:19:27 +0000 (15:19 +0000)
No underlying recipient of this info yet - just plumbing.

dgit
dgit.1
infra/dgit-repos-server

diff --git a/dgit b/dgit
index d2ca495a7871d493ebbb18bf63f8f73314bc42cb..7e642c037b8dedef77c9f62c9750efccf73fe5e4 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -51,6 +51,7 @@ our $buildproductsdir = '..';
 our $new_package = 0;
 our $ignoredirty = 0;
 our $rmonerror = 1;
+our @deliberatelies;
 our $existing_package = 'dpkg';
 our $cleanmode = 'dpkg-source';
 our $changes_since_version;
@@ -192,6 +193,10 @@ sub stat_exists ($) {
     die "stat $f: $!";
 }
 
+sub deliberately ($) {
+    return !!grep { $_[0] eq $_ } @deliberatelies;
+}
+
 #---------- remote protocol support, common ----------
 
 # remote push initiator/responder protocol:
@@ -1564,6 +1569,7 @@ sub push_mktag ($$$$$$$) {
     # We make the git tag by hand because (a) that makes it easier
     # to control the "tagger" (b) we can do remote signing
     my $authline = clogp_authline $clogp;
+    my $delibs = join(" ", "",@deliberatelies);
     open TO, '>', $tfn->('.tmp') or die $!;
     print TO <<END or die $!;
 object $head
@@ -1572,7 +1578,7 @@ tag $tag
 tagger $authline
 
 $package release $cversion for $clogsuite ($csuite) [dgit]
-[dgit distro=$distro]
+[dgit distro=$distro$delibs]
 END
     close TO or die $!;
 
@@ -2716,6 +2722,9 @@ sub parseopts () {
            } elsif (m/^--no-rm-on-error$/s) {
                push @ropts, $_;
                $rmonerror = 0;
+           } elsif (m/^--deliberately-($suite_re)$/s) {
+               push @ropts, $_;
+               push @deliberatelies, $&;
            } else {
                badusage "unknown long option \`$_'";
            }
diff --git a/dgit.1 b/dgit.1
index 260b742d8421efbd92c91ba7e2b08e63c64ce588..35a09223fdeff8d7a025b15336c64c4f814ef256 100644 (file)
--- a/dgit.1
+++ b/dgit.1
@@ -255,6 +255,29 @@ This can be useful with build, if you plan to commit later.  (dgit
 push will still ensure that the .dsc you upload and the git tree
 you push are identical, so this option won't make broken pushes.)
 .TP
+.BI --deliberately- something
+Declare that you are deliberately doing
+.IR something .
+This can be used to override safety catches, including safety catches
+which relate to distro-specific policies.  The meanings of
+.IR something s
+understood in the context of Debian are discussed below:
+.TP
+.BR --deliberately-not-fast-forward
+Declare that you are deliberately rewinding history.  When pushing to
+Debian, use this when you are making a renewed upload of an entirely
+new source package whose previous version was not accepted for release
+from NEW because of problems with copyright or redistributibility.
+.TP
+.BR --deliberately-include-questionable-history
+Declare that you are deliberately including, in the git history of
+your current push, history which contains a previously-submitted
+version of this package which was not approved (or has not yet been
+approved) by the ftpmasters.  When pushing to Debian, only use this
+option after verifying that: none of the rejected-from-NEW (or
+never-accepted) versions in the git history of your current push, were
+rejected by ftpmaster for copyright or redistributability reasons.
+.TP
 .BR --quilt=linear
 When fixing up source format `3.0 (quilt)' metadata, insist on
 generating a linear patch stack.  If such a stack cannot be generated,
index 22e6ea7987980baf245456dff135785e181be689..56fc4fd0ef766bbfd617aac8dfc34148ccfd55c2 100755 (executable)
@@ -100,6 +100,8 @@ our $workrepo;
 our $keyrings;
 our @lockfhs;
 our $debug='';
+our @deliberatelies;
+our $policy;
 
 #----- utilities -----
 
@@ -336,7 +338,9 @@ sub parsetag () {
            for (;;) {
                if (s/^distro\=(\S+) //) {
                    die "$1 != $distro" unless $1 eq $distro;
-               } elsif (s/^[-+.=0-9a-z]+ //) {
+               } elsif (s/^(--deliberately-$package_re) //) {
+                   push @deliberatelies, $1;
+               } elsif (s/^[-+.=0-9a-z]\S* //) {
                } else {
                    die "unknown dgit info in tag";
                }