diff options
authorIan Jackson <>2019-09-05 16:34:33 +0100
committerIan Jackson <>2019-09-05 18:15:20 +0100
commit272a3704ff3cc3d3fbb2df40a953068160b9f44b (patch)
parentdb8abe2a9751ce42afecb482fa0203ea6e538bbb (diff)
dgit: Fail early when the archive/ tag already exists.
Suggest using a new version number. We need a new --force option to override this check. Closes: #935802 Signed-off-by: Ian Jackson <>
2 files changed, 22 insertions, 0 deletions
diff --git a/dgit b/dgit
index 6f240ab..56b2ee9 100755
--- a/dgit
+++ b/dgit
@@ -102,6 +102,7 @@ our %forceopts = map { $_=>0 }
qw(unrepresentable unsupported-source-format
dsc-changes-mismatch changes-origs-exactly
uploading-binaries uploading-source-only
+ reusing-version
@@ -4601,6 +4602,20 @@ END
confess unless !!$made_split_brain == do_split_brain();
+ my $tagname = debiantag_new $cversion, access_nomdistro();
+ if (!(forceing[qw(reusing-version)]) && git_get_ref "refs/tags/$tagname") {
+ supplementary_message '';
+ print STDERR f_ <<END, $cversion;
+Version %s has already been tagged (pushed?)
+If this was a failed (or incomplete or rejected) upload by you, just
+add a new changelog stanza for a new version number and try again.
+ fail f_ <<END, $tagname;
+Tag %s already exists.
+ }
changedir $playground;
progress f_ "checking that %s corresponds to HEAD", $dscfn;
runcmd qw(dpkg-source -x --),
diff --git a/dgit.1 b/dgit.1
index 8969e2f..e619188 100644
--- a/dgit.1
+++ b/dgit.1
@@ -1293,6 +1293,13 @@ The result is a fresh import,
discarding the git history
that the person who pushed that .dsc was working with.
+.B \-\-force-reusing-version
+Carry on even though this involves reusing a version number
+of a previous push or upload.
+It is normally best to give different versions different numbers.
+Some servers (including, usually, the Debian server)
+will reject attempts to reuse or replace already-pushed versions.
.B \-\-force-uploading-binaries
Carry on and
upload binaries