chiark / gitweb /
wip changes for remote push - fixes, todos
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 949d22c794f4e04ede69f238601ef5f690071c95..e8b6c3004a7cd299b8647faec2fbb02e2831ac46 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -50,8 +50,6 @@ our (@dget) = qw(dget);
 our (@dput) = qw(dput);
 our (@debsign) = qw(debsign);
 our (@gpg) = qw(gpg);
-fixme should be in manual
-fixme should pass this to debsign
 our (@sbuild) = qw(sbuild -A);
 our (@dpkgbuildpackage) = qw(dpkg-buildpackage -i\.git/ -I.git);
 our (@dpkgsource) = qw(dpkg-source -i\.git/ -I.git);
@@ -994,13 +992,21 @@ END
            $keyid = access_cfg('keyid','RETURN-UNDEF');
        }
        unlink $tfn->('.tmp.asc') or $!==&ENOENT or die $!;
-       my @sign_cmd = (@gpg, qw(--clearsign --armor));
+       my @sign_cmd = (@gpg, qw(--detach-sign --armor));
        push @sign_cmd, qw(-u),$keyid if defined $keyid;
        push @sign_cmd, $tfn->('.tmp');
        runcmd_ordryrun @sign_cmd;
-       if (!$dry
-       runcmd_ordryrun @
+       if (!$dryrun) {
+           $tagobjfn = $tfn->('.signed.tmp');
+           runcmd shell_cmd "exec >$tagobjfn", qw(cat --),
+               $tfn->('.tmp'), $tfn->('.tmp.asc');
+       }
     }
+    my $tag_obj_hash = cmdoutput @git, qw(hash-object -w -t tag), $tagobjfn;
+    runcmd_ordryrun @git, qw(verify-tag), $tag_obj_hash;
+    runcmd_ordryrun @git, qw(update-ref), "refs/tags/$tag", $tag_obj_hash;
+    runcmd_ordryrun @git, qw(tag -v --), $tag;
+
     if (!check_for_git()) {
        create_remote_git_repo();
     }
@@ -1013,16 +1019,6 @@ END
     }
 
     if ($sign) {
-       if (!$as_remote) {
-           my @tag_cmd = (@git, qw(tag -a -m),
-                          );
-           push @tag_cmd, $tag;
-           runcmd_ordryrun @tag_cmd;
-       } else {
-       }
-
-       push @tag_cmd, qw(-u),$keyid if defined $keyid;
-
        my @debsign_cmd = @debsign;
        push @debsign_cmd, "-k$keyid" if defined $keyid;
        push @debsign_cmd, $changesfile;