summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog40
-rw-r--r--debian/tests/control2
-rwxr-xr-xdgit263
-rw-r--r--dgit-maint-debrebase.7.pod4
-rw-r--r--dgit-maint-merge.7.pod43
-rw-r--r--dgit-maint-native.7.pod5
-rw-r--r--dgit-nmu-simple.7.pod4
-rw-r--r--dgit-sponsorship.7.pod15
-rw-r--r--dgit.179
-rw-r--r--dgit.729
-rw-r--r--tests/lib2
-rw-r--r--tests/lib-baredebian3
-rw-r--r--tests/lib-core1
-rw-r--r--tests/lib-orig-include-exclude2
-rwxr-xr-xtests/setup/examplegit2
-rwxr-xr-xtests/tests/badcommit-rewrite2
-rwxr-xr-xtests/tests/clone-nogit3
-rwxr-xr-xtests/tests/debpolicy-dbretry4
-rwxr-xr-xtests/tests/debpolicy-newreject2
-rwxr-xr-xtests/tests/distropatches-reject4
-rwxr-xr-xtests/tests/dpkgsourceignores-correct2
-rwxr-xr-xtests/tests/drs-push-masterupdate4
-rwxr-xr-xtests/tests/gbp-orig2
-rwxr-xr-xtests/tests/gitworktree4
-rwxr-xr-xtests/tests/mirror2
-rwxr-xr-xtests/tests/mirror-debnewgit2
-rwxr-xr-xtests/tests/mirror-private3
-rwxr-xr-xtests/tests/mismatches-contents2
-rwxr-xr-xtests/tests/mismatches-dscchanges4
-rwxr-xr-xtests/tests/overwrite-chkclog8
-rwxr-xr-xtests/tests/overwrite-junk2
-rwxr-xr-xtests/tests/overwrite-splitbrains4
-rwxr-xr-xtests/tests/overwrite-version4
-rwxr-xr-xtests/tests/pbuilder2
-rwxr-xr-xtests/tests/push-buildproductsdir2
-rwxr-xr-xtests/tests/push-newpackage6
-rwxr-xr-xtests/tests/push-newrepeat4
-rwxr-xr-xtests/tests/push-nextdgit2
-rwxr-xr-xtests/tests/push-source3
-rwxr-xr-xtests/tests/quilt2
-rwxr-xr-xtests/tests/quilt-gbp4
-rwxr-xr-xtests/tests/quilt-singlepatch4
-rwxr-xr-xtests/tests/quilt-splitbrains4
-rwxr-xr-xtests/tests/sourceonlypolicy2
-rwxr-xr-xtests/tests/tag-updates3
-rwxr-xr-xtests/tests/trustingpolicy-replay14
-rwxr-xr-xtests/tests/unrepresentable135
-rwxr-xr-xtests/tests/unrepresentable-single-dpkg4
-rwxr-xr-xtests/tests/unrepresentable-single-git4
-rwxr-xr-xtests/tests/version-opt3
50 files changed, 498 insertions, 252 deletions
diff --git a/debian/changelog b/debian/changelog
index 46ef14f..424ef55 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,40 @@
-dgit (9.16~) unstable; urgency=medium
+dgit (10.0) unstable; urgency=medium
+
+ Major command line change - dgit push vs push-built:
+ * Introduce "dgit push-built", meaning what "dgit push" does now.
+ * Make "dgit push" a configurable alias, which by default warns about
+ future incompatibility and then runs "dgit push-built". See dgit(1).
+ * Docs: generally recommend "push-source" rather than "push".
+ [Report from Osamu Aoki] Closes:#992606.
+
+ New feature, and change to recommended usage:
+ * Provide --quilt=single, and no longer recommend single-debian-patch
+ anywhere (since it can go badly wrong). Closes:#1018984.
+
+ Handling of unusual kinds of change to upstream files, during quilt fixup:
+ * Don't use dpkg-source --commit, but git diff.
+ * Handle exectutability changes. Closes:#995056. [Report from Peter Green]
+ * Reject all changes to symlinks (including symlink creation).
+ * With dpkg single-debian-patch, pass --include-removal to dpkg-source -b.
+ * Now we can make any diff that dpkg-source can cope with. Closes:#1018143.
+
+ Changes related to --dry-run and --damp-run:
+ * dgit(1): Demote, and add caveats describing their behaviours.
+ Closes:#973896. [Report from Wookey]
+ * dry run: Fix a handful of bugs (and improve a message).
+
+ Other:
+ * dgit: Pass require_valid_signature to Dpkg::Source::Package
+ in the correct manner. Closes: #964286. [Guillem Jover]
+
+ Internal:
+ * Refactorings and commentary, to support the other changes.
+ * Consequential updates to tests.
+ * More comprehensive testing of unusual upstream changes.
+
+ -- Ian Jackson <ijackson@chiark.greenend.org.uk> Sun, 04 Sep 2022 13:43:34 +0100
+
+dgit (9.16) unstable; urgency=medium
Compatibility with git-buildpackage gbp pq 0.9.26 (Closes:#1005873):
* dgit: Move .pc aside while running gbp pq import
@@ -9,7 +45,7 @@ dgit (9.16~) unstable; urgency=medium
* playtrees (for dgit and git-debrebase): Provide a gbp.conf.
* tests: gdr: Provide a way to pass --diagnose.
- --
+ -- Ian Jackson <ijackson@chiark.greenend.org.uk> Sat, 28 May 2022 22:49:53 +0100
dgit (9.15) unstable; urgency=medium
diff --git a/debian/tests/control b/debian/tests/control
index 46ee740..0bd86ae 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -96,7 +96,7 @@ Tests: trustingpolicy-replay
Tests-Directory: tests/tests
Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, liburi-perl, dput-ng
-Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-long build-modes-source checkout clone-clogsigpipe debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp debpolicy-taintrm defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-push-masterupdate drs-push-rejects dsd-divert fetch-localgitonly fetch-somegit-notlast forcesplit-linear forcesplit-overwrite gbp-orig gitconfig gitworktree import-dsc import-linkorigs import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version pbuilder protocol-compat push-buildproductsdir push-newpackage push-newrepeat push-nextdgit push-source push-source-with-changes quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains quilt-useremail rpush rpush-quilt sourceonlypolicy tag-updates unrepresentable version-opt
+Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-long build-modes-source checkout clone-clogsigpipe debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp debpolicy-taintrm defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-push-masterupdate drs-push-rejects dsd-divert fetch-localgitonly fetch-somegit-notlast forcesplit-linear forcesplit-overwrite gbp-orig gitconfig gitworktree import-dsc import-linkorigs import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version pbuilder protocol-compat push-buildproductsdir push-newpackage push-newrepeat push-nextdgit push-source push-source-with-changes quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains quilt-useremail rpush rpush-quilt sourceonlypolicy tag-updates unrepresentable unrepresentable-single-dpkg unrepresentable-single-git version-opt
Tests-Directory: tests/tests
Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, liburi-perl
diff --git a/dgit b/dgit
index d39dc4b..a14dd18 100755
--- a/dgit
+++ b/dgit
@@ -88,7 +88,7 @@ our $quilt_upstream_commitish;
our $quilt_upstream_commitish_used;
our $quilt_upstream_commitish_message;
our $quilt_options_re = 'gbp|dpm|baredebian(?:\+tarball|\+git)?';
-our $quilt_modes_re = "linear|smash|auto|nofix|nocheck|unapplied|$quilt_options_re";
+our $quilt_modes_re = "linear|smash|auto|single|nofix|nocheck|unapplied|$quilt_options_re";
our $splitview_mode;
our $splitview_modes_re = qr{auto|always|never};
our $dodep14tag;
@@ -189,20 +189,20 @@ our $do_split_brain;
# (currently, split brain only implemented iff
# madformat_wantfixup && quiltmode_splitting)
#
-# source format sane `3.0 (quilt)'
-# madformat_wantfixup()
-#
-# quilt mode normal quiltmode
-# (eg linear) _splitbrain
-#
-# ------------ ------------------------------------------------
-#
-# no split no q cache no q cache forbidden,
-# brain PM on master q fixup on master prevented
-# !do_split_brain() PM on master
-#
-# split brain no q cache q fixup cached, to dgit view
-# PM in dgit view PM in dgit view
+# source format | sane `3.0 (quilt)'
+# | madformat_wantfixup()
+# |
+# quilt mode | normal quiltmode
+# | (eg linear) _splitbrain
+# |
+# -------------------+-------------------------------------------------
+# |
+# no split | no q cache no q cache forbidden,
+# brain | PM on master q fixup on master prevented
+# !do_split_brain() | PM on master
+# |
+# split brain | no q cache q fixup cached, to dgit view
+# | PM in dgit view PM in dgit view
#
# PM = pseudomerge to make ff, due to overwrite (or split view)
# "no q cache" = do not record in cache on build, do not check cache
@@ -744,6 +744,7 @@ our %defcfg = ('dgit.default.distro' => 'debian',
'dgit.dsc-url-proto-ok.git' => 'true',
'dgit.vcs-git.suites', => 'sid', # ;-separated
'dgit.default.dsc-url-proto-ok' => 'false',
+ 'dgit.default.push-subcmd' => 'warn,built',
# 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"
@@ -2555,7 +2556,9 @@ sub generate_commits_from_dsc () {
printdebug "considering saving $f: ";
- if (rename_link_xf 1, $f, $upper_f) {
+ if (!act_local()) {
+ printdebug "no - dry run.\n";
+ } elsif (rename_link_xf 1, $f, $upper_f) {
printdebug "linked.\n";
} elsif ((printdebug "($@) "),
$! != EEXIST) {
@@ -2980,10 +2983,10 @@ END
my $want = $wantr{$rrefname};
next if $got eq $want;
if (!defined $objgot{$want}) {
- fail __ <<END unless act_local();
+ fail f_ <<END, $rrefname unless act_local();
--dry-run specified but we actually wanted the results of git fetch,
so this is not going to work. Try running dgit fetch first,
-or using --damp-run instead of --dry-run.
+or using --damp-run instead of --dry-run. (Wanted: %s.)
END
print STDERR f_ <<END, $lrefname, $want;
warning: git ls-remote suggests we want %s
@@ -5081,11 +5084,31 @@ sub prep_push () {
}
}
-sub cmd_push {
+sub cmd_push_built {
prep_push();
dopush();
}
+sub cmd_push {
+ my $spec = cfg 'dgit.default.push-subcmd';
+
+ if ($spec eq 'source') {
+ cmd_push_source();
+ } elsif ($spec eq 'built') {
+ cmd_push_built();
+ } elsif ($spec eq 'warn,built') {
+ print STDERR __ <<'END';
+warning: "dgit push" currently means "dgit push-built" (by default)
+warning: but is going to change to "dgit push-source". See dgit!(1).
+END
+ cmd_push_built();
+ } elsif ($spec eq 'reject') {
+ fail f_ 'dgit push, but dgit.default.push-subcmd set to %s', $spec;
+ } else {
+ fail f_ 'bad value for dgit.default.push-subcmd: %s', $spec;
+ }
+}
+
#---------- remote commands' implementation ----------
sub pre_remote_push_build_host {
@@ -5122,7 +5145,7 @@ sub pre_remote_push_build_host {
}
sub cmd_remote_push_build_host {
responder_send_command("dgit-remote-push-ready $protovsn");
- &cmd_push;
+ &cmd_push_built;
}
sub pre_remote_push_responder { pre_remote_push_build_host(); }
@@ -5382,13 +5405,14 @@ our $dscfn;
our $fakeeditorenv = 'DGIT_FAKE_EDITOR_QUILT';
-sub quiltify_dpkg_commit ($$$;$) {
- my ($patchname,$author,$msg, $xinfo) = @_;
+sub quiltify_make_dpkg_patch ($$$$$;$) {
+ my ($oldtreeish,$newtreeish, $patchname,$author,$msg, $xinfo) = @_;
$xinfo //= '';
mkpath '.git/dgit'; # we are in playtree
- my $descfn = ".git/dgit/quilt-description.tmp";
- open O, '>', $descfn or confess "$descfn: $!";
+ my $patchfn = "debian/patches/$patchname";
+ ensuredir dirname $patchfn;
+ open O, '>', $patchfn or confess "$patchfn: $!";
$msg =~ s/\n+/\n\n/;
print O <<END or confess "$!";
From: $author
@@ -5398,12 +5422,19 @@ ${xinfo}Subject: $msg
END
close O or confess "$!";
- {
- local $ENV{'EDITOR'} = cmdoutput qw(realpath --), $0;
- local $ENV{'VISUAL'} = $ENV{'EDITOR'};
- local $ENV{$fakeeditorenv} = cmdoutput qw(realpath --), $descfn;
- runcmd @dpkgsource, qw(--commit --include-removal .), $patchname;
- }
+ my @diffcmd = (@git, qw(diff --no-ext-diff), $oldtreeish, $newtreeish,
+ '--', ':!/debian', ':!/.pc');
+ runcmd qw(sh -ec), 'exec >>"$1"; shift; exec "$@"', 'x', $patchfn,
+ @diffcmd;
+
+ open S, ">> debian/patches/series" or confess "$!";
+ print S "$patchname\n" or confess "$!";
+ close S or confess "$!";
+}
+
+sub normalise_mode_strip_exec ($) {
+ my ($m) = @_;
+ return $m eq '100755' ? '100644' : $m;
}
sub quiltify_trees_differ ($$;$$$) {
@@ -5415,8 +5446,8 @@ sub quiltify_trees_differ ($$;$$$) {
# if $ignorenamesr is defined, $ingorenamesr->{$fn}
# is set for each modified .gitignore filename $fn
# if $unrepres is defined, array ref to which is appeneded
- # a list of unrepresentable changes (removals of upstream files
- # (as messages)
+ # a list of unrepresentable changes (changes that dpkg-source
+ # cannot apply even just during unpack).
local $/=undef;
my @cmd = (@git, qw(diff-tree -z --no-renames));
push @cmd, qw(--name-only) unless $unrepres;
@@ -5437,13 +5468,15 @@ sub quiltify_trees_differ ($$;$$$) {
if ($unrepres) {
eval {
- die __ "not a plain file or symlink\n"
+ die __ "not a plain file\n"
unless $newmode =~ m/^(?:10|12)\d{4}$/ ||
$oldmode =~ m/^(?:10|12)\d{4}$/;
if ($oldmode =~ m/[^0]/ &&
$newmode =~ m/[^0]/) {
# both old and new files exist
- die __ "mode or type changed\n" if $oldmode ne $newmode;
+ die __ "mode or type changed in unsupported way\n" if
+ normalise_mode_strip_exec($oldmode) ne
+ normalise_mode_strip_exec($newmode);
die __ "modified symlink\n" unless $newmode =~ m/^10/;
} elsif ($oldmode =~ m/[^0]/) {
# deletion
@@ -5451,10 +5484,9 @@ sub quiltify_trees_differ ($$;$$$) {
unless $oldmode =~ m/^10/;
} else {
# creation
- die __ "creation with non-default mode\n"
+ die __ "creation with non-default mode, or symlink\n"
unless $newmode =~ m/^100644$/ or
- $newmode =~ m/^100755$/ or
- $newmode =~ m/^120000$/;
+ $newmode =~ m/^100755$/;
}
};
if ($@) {
@@ -5471,6 +5503,24 @@ sub quiltify_trees_differ ($$;$$$) {
return $r;
}
+sub quiltify_check_unrepresentable ($) {
+ my ($unrepres) = @_;
+ return unless @$unrepres;
+ if ($quilt_mode =~ m/baredebian/) {
+ # With baredebian, even if the upstream commitish has this
+ # problem, we don't want to print this message, as nothing
+ # is going to try to make a patch out of it anyway.
+ return;
+ }
+ print STDERR f_ "dgit: cannot represent change: %s: %s\n",
+ $_->[1], $_->[0]
+ foreach @$unrepres;
+
+ forceable_fail [qw(unrepresentable)], __ <<END;
+HEAD has changes to .orig[s] which are not representable by `3.0 (quilt)'
+END
+}
+
sub quiltify_tree_sentinelfiles ($) {
# lists the `sentinel' files present in the tree
my ($x) = @_;
@@ -5764,7 +5814,9 @@ sub quiltify ($$$$) {
my $ncommits = 3;
my $msg = cmdoutput @git, qw(log), "-n$ncommits";
- quiltify_dpkg_commit "auto-$version-$target-$time",
+ quiltify_make_dpkg_patch
+ $oldtiptree, $target,
+ "auto-$version-$target-$time",
(getfield $clogp, 'Maintainer'),
(f_ "Automatically generated patch (%s)\n".
"Last (up to) %s git changes, FYI:\n\n",
@@ -5868,22 +5920,14 @@ sub quiltify ($$$$) {
$index++) { }
$!==ENOENT or confess "$patchname$index $!";
- runcmd @git, qw(checkout -q), $cc;
-
- # We use the tip's changelog so that dpkg-source doesn't
- # produce complaining messages from dpkg-parsechangelog. None
- # of the information dpkg-source gets from the changelog is
- # actually relevant - it gets put into the original message
- # which dpkg-source provides our stunt editor, and then
- # overwritten.
- runcmd @git, qw(checkout -q), $target, qw(debian/changelog);
-
- quiltify_dpkg_commit "$patchname$index", $author, $msg,
+ quiltify_make_dpkg_patch
+ $p->{Commit} ,$cc,
+ "$patchname$index", $author, $msg,
"Date: $commitdate\n".
"X-Dgit-Generated: $clogp->{Version} $cc\n";
- runcmd @git, qw(checkout -q), $cc, qw(debian/changelog);
}
+ runcmd @git, qw(checkout -q), $target;
}
sub build_maybe_quilt_fixup () {
@@ -5930,7 +5974,14 @@ sub build_maybe_quilt_fixup () {
"quilt mode %s does not make sense (or is not supported) with single-debian-patch",
$quilt_mode
if quiltmode_splitting();
- quilt_fixup_singlepatch($clogp, $headref, $upstreamversion);
+
+ # We always use dpkg-source --commit in this case, because
+ # otherwise we can generate source packages that trigger horrible
+ # bugs in dpkg-source.
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1018984
+ quilt_fixup_dpkgsource_singlepatch($clogp, $headref, $upstreamversion);
+ } elsif ($quilt_mode =~ m/single/) {
+ quilt_fixup_git_singlepatch($clogp, $headref, $upstreamversion);
} else {
quilt_fixup_multipatch($clogp, $headref, $upstreamversion,
$splitbrain_cachekey);
@@ -6007,7 +6058,7 @@ END
ENDU
}
-sub quilt_fixup_singlepatch ($$$) {
+sub quilt_fixup_dpkgsource_singlepatch ($$$) {
my ($clogp, $headref, $upstreamversion) = @_;
progress __ "starting quiltify (single-debian-patch)";
@@ -6017,12 +6068,21 @@ sub quilt_fixup_singlepatch ($$$) {
# get it to generate debian/patches/debian-changes, it is
# necessary to build the source package.
+ # We "trust" dpkg-source to get this right, and in particular, to
+ # complain about things it can't represent. However, this is not
+ # always the case. See the test cases in tests/tests/unrepresentable
+ # which have as outcome "LATE-EP:...". When this happens, quilt fixup
+ # succeeds and dgit push fails. This is one of the reasons we
+ # deprecate this in the docs. In principle, we could do better by
+ # rejecting these situations earlier, but we would need another
+ # lot of recapitulation of dpkg-source behaviours.
+
unpack_playtree_linkorigs($upstreamversion, sub { });
unpack_playtree_need_cd_work($headref);
rmtree("debian/patches");
- runcmd @dpkgsource, qw(-b .);
+ runcmd @dpkgsource, qw(--include-removal -b .);
changedir "..";
runcmd @dpkgsource, qw(-x), (srcfn $version, ".dsc");
rename srcfn("$upstreamversion", "/debian/patches"),
@@ -6034,6 +6094,40 @@ sub quilt_fixup_singlepatch ($$$) {
commit_quilty_patch();
}
+sub quilt_fixup_git_singlepatch ($$$) {
+ my ($clogp, $headref, $upstreamversion) = @_;
+
+ progress f_ "regenerating patch using git diff (--quilt=%s)",
+ $quilt_mode;
+
+ my $unapplied=quilt_fakedsc2unapplied($headref, $upstreamversion);
+ changedir '..';
+
+ my @unrepres;
+ my $o2h = quiltify_trees_differ($unapplied,$headref, 1, undef,\@unrepres);
+ unpack_playtree_need_cd_work($headref);
+
+ quiltify_check_unrepresentable \@unrepres;
+
+ rmtree("debian/patches");
+
+ if ($o2h) {
+ quiltify_make_dpkg_patch
+ $unapplied, $headref,
+ 'dgit-changes', '', <<'END', '';
+Debian changes
+
+The Debian delta in this package is represented by this one combined patch.
+The git history (e.g. from dgit clone) is the primary source representation.
+
+We don't use debian/source/options single-debian-patch because it has bugs.
+Therefore, NMUs etc. may nevertheless have made additional patches.
+END
+ }
+
+ commit_quilty_patch();
+}
+
sub quilt_need_fake_dsc ($) {
# cwd should be playground
my ($upstreamversion) = @_;
@@ -6201,44 +6295,22 @@ sub quilt_fixup_multipatch ($$$) {
# - determine the git commit corresponding to the tip of
# the patch stack (if there is one)
# - if there is such a git commit, convert each subsequent
- # git commit into a quilt patch with dpkg-source --commit
+ # git commit into a quilt patch, simulating dpkg-source --commit
# - otherwise convert all the differences in the tree into
# a single git commit
#
# To do this we:
- # Our git tree doesn't necessarily contain .pc. (Some versions of
- # dgit would include the .pc in the git tree.) If there isn't
- # one, we need to generate one by unpacking the patches that we
- # have.
- #
- # We first look for a .pc in the git tree. If there is one, we
- # will use it. (This is not the normal case.)
- #
- # Otherwise need to regenerate .pc so that dpkg-source --commit
- # can work. We do this as follows:
+ # So we need to find out what the tree for the tip of the patch
+ # stack is.
# 1. Collect all relevant .orig from parent directory
# 2. Generate a debian.tar.gz out of
# debian/{patches,rules,source/format,source/options}
# 3. Generate a fake .dsc containing just these fields:
# Format Source Version Files
# 4. Extract the fake .dsc
- # Now the fake .dsc has a .pc directory.
- # (In fact we do this in every case, because in future we will
- # want to search for a good base commit for generating patches.)
#
- # Then we can actually do the dpkg-source --commit
- # 1. Make a new working tree with the same object
- # store as our main tree and check out the main
- # tree's HEAD.
- # 2. Copy .pc from the fake's extraction, if necessary
- # 3. Run dpkg-source --commit
- # 4. If the result has changes to debian/, then
- # - git add them them
- # - git add .pc if we had a .pc in-tree
- # - git commit
- # 5. If we had a .pc in-tree, delete it, and git commit
- # 6. Back in the main tree, fast forward to the new HEAD
+ # Then we can actually do the fake dpkg-source --commit.
# Another situation we may have to cope with is gbp-style
# patches-unapplied trees.
@@ -6321,7 +6393,7 @@ END
my $mustdeletepc=0;
if (stat_exists ".pc") {
-d _ or die;
- progress __ "Tree already contains .pc - will use it then delete it.";
+ progress __ "Tree already contains .pc - will delete it.";
$mustdeletepc=1;
} else {
rename '../fake/.pc','.pc' or confess "$!";
@@ -6455,17 +6527,7 @@ END
$us, $dl[0], $dl[1], $dl[3], $dl[4],
$us, $uhead_whatshort, $dl[2], $uhead_whatshort, $dl[5];
- if (@unrepres && $quilt_mode !~ m/baredebian/) {
- # With baredebian, even if the upstream commitish has this
- # problem, we don't want to print this message, as nothing
- # is going to try to make a patch out of it anyway.
- print STDERR f_ "dgit: cannot represent change: %s: %s\n",
- $_->[1], $_->[0]
- foreach @unrepres;
- forceable_fail [qw(unrepresentable)], __ <<END;
-HEAD has changes to .orig[s] which are not representable by `3.0 (quilt)'
-END
- }
+ quiltify_check_unrepresentable(\@unrepres);
my @failsuggestion;
if ($onlydebian) {
@@ -7041,7 +7103,7 @@ sub build_source {
}
# confess unless !!$made_split_brain == do_split_brain();
- my @cmd = (@dpkgsource, qw(-b --));
+ my @cmd = (@dpkgsource, qw(-b --include-removal --));
my $leafdir;
if (building_source_in_playtree()) {
$leafdir = 'work';
@@ -7057,6 +7119,7 @@ sub build_source {
unpack_playtree_need_cd_work($headref);
changedir '..';
}
+ runcmd @cmd, $leafdir;
} else {
$leafdir = basename $maindir;
@@ -7078,13 +7141,18 @@ sub build_source {
}
changedir '..';
+ runcmd_ordryrun_local @cmd, $leafdir;
}
- runcmd_ordryrun_local @cmd, $leafdir;
changedir $leafdir;
- runcmd_ordryrun_local qw(sh -ec),
- 'exec >../$1; shift; exec "$@"','x', $sourcechanges,
- @dpkggenchanges, qw(-S), changesopts();
+ my @gencmd = (qw(sh -ec),
+ 'exec >../$1; shift; exec "$@"','x', $sourcechanges,
+ @dpkggenchanges, qw(-S), changesopts());
+ if (building_source_in_playtree()) {
+ runcmd @gencmd;
+ } else {
+ runcmd_ordryrun_local @gencmd;
+ }
changedir '..';
printdebug "moving $dscfn, $sourcechanges, etc. to ".bpd_abs()."\n";
@@ -7093,6 +7161,7 @@ sub build_source {
my $mv = sub {
my ($why, $l) = @_;
printdebug " renaming ($why) $l\n";
+ return unless act_local();
rename_link_xf 0, "$l", bpd_abs()."/$l"
or fail f_ "put in place new built file (%s): %s", $l, $@;
};
@@ -7283,7 +7352,7 @@ sub cmd_import_dsc {
# we don't normally need this so import it here
use Dpkg::Source::Package;
my $dp = new Dpkg::Source::Package filename => $dscfn,
- require_valid_signature => $needsig;
+ options => { require_valid_signature => $needsig };
{
local $SIG{__WARN__} = sub {
print STDERR $_[0];
diff --git a/dgit-maint-debrebase.7.pod b/dgit-maint-debrebase.7.pod
index b3700a4..6e19026 100644
--- a/dgit-maint-debrebase.7.pod
+++ b/dgit-maint-debrebase.7.pod
@@ -453,7 +453,7 @@ commits just as you would during B<git rebase -i>.
After completing the git rebase, your branch will not be a
fast-forward of the git HEAD you had before the rebase. This means
that we cannot push the branch anywhere. If you are ready to upload,
-B<dgit push> or B<dgit push-source> will take care of fixing this up
+B<dgit push-source> (or B<dgit push-built>) will take care of fixing this up
for you.
If you are not yet ready to upload, and want to push your branch to a
@@ -477,7 +477,7 @@ You can use dpkg-buildpackage(1) for test builds. When you are ready
to build for an upload, use B<dgit sbuild>, B<dgit pbuilder> or B<dgit
cowbuilder>.
-Upload with B<dgit push> or B<dgit push-source>. Remember to pass
+Upload with B<dgit push-source> or B<dgit push-built>. Remember to pass
I<--new> if the package is new in the target suite.
In some cases where you used B<git debrebase convert-from-gbp> since
diff --git a/dgit-maint-merge.7.pod b/dgit-maint-merge.7.pod
index ddf37aa..db352f3 100644
--- a/dgit-maint-merge.7.pod
+++ b/dgit-maint-merge.7.pod
@@ -277,17 +277,37 @@ avoids introducing a new origin commit into your git history. (This
origin commit would represent the most recent non-dgit upload of the
package, but this should already be represented in your git history.)
-=head1 SOURCE PACKAGE CONFIGURATION
+=head1 SOURCE PACKAGE AND GIT WORKING TREE CONFIGURATION
+
+=head2 dgit configuration
+
+We must tell dgit not to try to maintain
+a linear queue of patches to the upstream source:
+
+=over 4
+
+ git config dgit.default.quilt-mode single
+
+=back
+
+This affects only this one git tree;
+your other git trees for this package (and co-maintainers)
+will need it too.
+Don't set it more globally,
+because the maintainers of any other packages
+you work on, or send patches for,
+may be offended by its effects.
+
+unpleasant NMUs
=head2 debian/source/options
-We set some source package options such that dgit can transparently
-handle the "dropping" and "refreshing" of changes to the upstream
+We set a source package option to help dpkg handle
+changes to the upstream
source:
=over 4
- single-debian-patch
auto-commit
=back
@@ -295,7 +315,7 @@ source:
You don't need to create this file if you are using the version 1.0
source package format.
-=head2 Sample text for debian/source/patch-header
+=head2 Sample text for debian/README.source
It is a good idea to explain how a user can obtain a breakdown of the
changes to the upstream source:
@@ -327,25 +347,16 @@ A single combined diff, containing all the changes, follows.
=back
-If you are using the version 1.0 source package format, this text
-should be added to README.source instead. The version 1.0 source
-package format ignores debian/source/patch-header.
-
-If you're using the version 3.0 (quilt) source package format, you
-could add this text to README.source instead of
-debian/source/patch-header, but this might distract from more
-important information present in README.source.
-
=head1 BUILDING AND UPLOADING
Use B<dgit build>, B<dgit sbuild>, B<dgit pbuilder>, B<dgit
-cowbuilder>, B<dgit push-source>, and B<dgit push> as detailed in
+cowbuilder>, B<dgit push-source>, and B<dgit push-built> as detailed in
dgit(1). If any command fails, dgit will provide a carefully-worded
error message explaining what you should do. If it's not clear, file
a bug against dgit. Remember to pass I<--new> for the first upload.
If you want to upload with git-debpush(1), for the first upload you
-should pass the B<--quilt=smash> quilt mode option (see
+should pass the B<--quilt=single> quilt mode option (see
git-debpush(1)).
As another alternative to B<dgit build> and friends, you can use a
diff --git a/dgit-maint-native.7.pod b/dgit-maint-native.7.pod
index 792be10..4e8b795 100644
--- a/dgit-maint-native.7.pod
+++ b/dgit-maint-native.7.pod
@@ -58,8 +58,7 @@ Simply prepare your git tree in the usual way, and then:
=over 4
- % dgit -wgf sbuild -A -c sid
- % dgit -wgf --overwrite push
+ % dgit -wgf --overwrite push-source
=back
@@ -94,7 +93,7 @@ your git history.
=over 4
- % dgit -wgf push
+ % dgit -wgf push-source
=back
diff --git a/dgit-nmu-simple.7.pod b/dgit-nmu-simple.7.pod
index 0d2525f..734fb6b 100644
--- a/dgit-nmu-simple.7.pod
+++ b/dgit-nmu-simple.7.pod
@@ -45,8 +45,8 @@ consult the appropriate C<dgit-maint-*(7)> workflow tutorial,
[ run your tests ]
% dch -r && git add debian/changelog && git commit -m"Finalise NMU"
% dgit -wgf sbuild -A -c jessie
- [ final tests on generated .debs ]
- % dgit -wgf [--delayed=5] push jessie
+ [ any final tests on generated .debs ]
+ % dgit -wgf [--delayed=5] push-source jessie
[ enter your gnupg passphrase as prompted ]
[ see that push and upload are successful ]
[ prepare and email NMU diff (git-diff, git-format-patch) ]
diff --git a/dgit-sponsorship.7.pod b/dgit-sponsorship.7.pod
index 2e6f82d..91e70c7 100644
--- a/dgit-sponsorship.7.pod
+++ b/dgit-sponsorship.7.pod
@@ -30,7 +30,7 @@ This section is addressed to the sponsee:
=head2 General
You should prepare the package as if you were going
-to upload it with C<dgit push-source> or C<dgit push> yourself.
+to upload it with C<dgit push-source> or C<dgit push-built> yourself.
For a straightforward NMU, consult L<dgit-nmu-simple(7)>.
@@ -78,7 +78,7 @@ command(s) to generate them.
=item *
-A sample dgit push command, containing
+A sample dgit push-source command, containing
any dgit --quilt=, --gbp or --dpm option needed
=item *
@@ -160,7 +160,7 @@ Some workflows involve git branches which are not natively
dgit-compatible.
Normally dgit will convert them as needed, during push.
-Supply a sample "dgit push" command
+Supply a sample "dgit push-source" command
including any
C<--gbp> (aka C<--quilt=gbp>),
C<--dpm> (aka C<--quilt=dpm>),
@@ -170,7 +170,7 @@ e.g.
=over 4
- % dgit --gbp push
+ % dgit --gbp push-source
=back
@@ -236,7 +236,7 @@ C<dgit -wgf [--quilt=...] sbuild -A -C>
or similar, to to the build, and then
C<dgit -wgf [--quilt=...] push-source>
or
-C<dgit -wgf [--quilt=...] push>
+C<dgit -wgf [--quilt=...] push-built>
to do the upload.
Check whether the sponsee made a debian/I<version> tag.
@@ -306,8 +306,9 @@ formatted as a dgit branch.
When you have finished your review and your tests,
you can do the
-dgit sbuild and
-dgit push directly from the "sponsee" branch.
+dgit push-source
+(or dgit sbuild and dgit push-built)
+directly from the "sponsee" branch.
You will need to pass
C<--overwrite>
diff --git a/dgit.1 b/dgit.1
index bec8f97..7bd8b05 100644
--- a/dgit.1
+++ b/dgit.1
@@ -234,7 +234,7 @@ git-buildpackage style branch, not a patches-applied branch.
Tagging, signing and actually uploading should be left to dgit push.
.TP
-\fBdgit push\fR [\fIsuite\fP]
+\fBdgit push-built\fR [\fIsuite\fP]
Does an `upload', pushing the current HEAD to the archive (as a source
package) and to dgit-repos (as git commits). The package must already
have been built ready for upload, with the .dsc and .changes
@@ -302,6 +302,34 @@ You will need similar enough versions of dgit on the build-host and
the invocation host. The build-host needs gnupg installed, with your
public key in its keyring (but not your private key, obviously).
.TP
+\fBdgit push\fR \fI...\fP
+Configurable alias for
+.BR "dgit push-built" ,
+which will change to mean
+.BR "dgit push" ,
+and therefore currently generates a warning.
+
+The behaviour is controlled by the
+.B dgit.default.push-subcmd
+git config option:
+.TS
+l l l .
+\fBsource\fR runs \fBdgit push-source\fR future default
+\fBbuilt\fR and runs \fBdgit push-built\fR
+\fBbuilt,warn\fR warns, and runs \fBdgit push-built\fR current default
+\fBreject\fR fails
+.TE
+
+That setting can safely be passed to older dgit (via
+.BR -c);
+the value
+.B built
+will be supported indefinitely.
+This should be used in scripts that need to work with both
+old versions of dgit (that don't have \fBpush-built\fR)
+and
+new versions (where \fBpush-source\fR is the default).
+.TP
.B dgit setup-new-tree
Configure the current working tree the way that dgit clone would have
set it up. Like running
@@ -491,17 +519,6 @@ See ACCESS CONFIGURATION, below.
This function is primarily provided for the benefit of git-debrebase.
.SH OPTIONS
.TP
-.BR \-\-dry-run " | " \-n
-Go through the motions, fetching all information needed, but do not
-actually update the output(s). For push, dgit does
-the required checks and leaves the new .dsc in a temporary file,
-but does not sign, tag, push or upload.
-.TP
-.BR \-\-damp-run " | " \-L
-Go through many more of the motions: do everything that doesn't
-involve either signing things, or making changes on the public
-servers.
-.TP
.BI \-k keyid
Use
.I keyid
@@ -857,6 +874,21 @@ if you do not change the upstream version
nor make changes in debian/patches,
it will remain true.)
.TP
+.BR --quilt=single
+When fixing up source format `3.0 (quilt)' metadata,
+delete all the existing patches, and then
+generate a single patch for all the changes made in git.
+This is not a good idea for an NMU in Debian.
+
+Use this instead of the
+.B single-debian-patch
+dpkg-source format option.
+That dpkg-source option cannot handle certain changes to the tree
+that dpkg-source otherwise permits,
+and in some cases it can generate strange source packages
+that dpkg-source appears to accept
+but which become corrupted when people later try to modify them.
+.TP
.BR --quilt=nofix
Check whether source format `3.0 (quilt)' metadata would need fixing
up, but, if it does, fail. You must then fix the metadata yourself
@@ -1281,6 +1313,25 @@ removed and recreated before dgit starts, rather than removed
after dgit finishes. The directory specified must be an absolute
pathname.
.TP
+.BR \-\-dry-run " | " \-n
+Go through the motions, fetching all information needed, but do not
+actually update the output(s). For push, dgit does
+the required checks and leaves the new .dsc in a temporary file,
+but does not sign, tag, push or upload.
+
+This is not a very good simulation.
+It can easily go wrong for ways that a for-real push wouldn't.
+.TP
+.BR \-\-damp-run " | " \-L
+Go through many more of the motions: do everything that doesn't
+involve either signing things, or making changes on the public
+servers.
+
+Using this will make unsigned tags,
+and possibly other local changes,
+that will get in the way of a for-real push.
+So be prepared to burn the version number you're using.
+.TP
.BI \-\-force- something
Instructs dgit to try to proceed despite detecting
what it thinks is going to be a fatal problem.
@@ -1525,6 +1576,10 @@ or when pushing and
.TP
.BI dgit.default.dsc-url-proto-ok
.TP
+.BI dgit.default.push-subcmd " " source | built | warn,built
+Controls the behaviour of
+.BR "dgit push" .
+.TP
.BR dgit.vcs-git.suites " \fIsuite\fR[" ; ...]
.SH ENVIRONMENT VARIABLES
.TP
diff --git a/dgit.7 b/dgit.7
index d1e5c7e..bf805a5 100644
--- a/dgit.7
+++ b/dgit.7
@@ -47,7 +47,7 @@ However, it is perfectly fine to have other branches in dgit-repos;
normally the dgit-repos repo for the package will be accessible via
the remote name `origin'.
-dgit push will also make signed tags called
+dgit push-* will also make signed tags called
.BI archive/debian/ version
(with version encoded a la DEP-14)
and push them to dgit-repos. These are used at the
@@ -55,7 +55,7 @@ server to authenticate pushes.
Uploads made by dgit contain an additional field
.B Dgit
-in the source package .dsc. (This is added by dgit push.)
+in the source package .dsc. (This is added by dgit push-*.)
This specifies: a commit (an ancestor of the dgit/suite
branch) whose tree is identical to the unpacked source upload;
the distro to which the upload was made;
@@ -89,7 +89,7 @@ but may be ahead of it if uploads have been done without dgit.
The archive tracking view is always fast forwarding within
each suite.
-dgit push can operate on any commit which is a descendant of
+dgit push-* can operate on any commit which is a descendant of
the suite tracking branch.
dgit does not make a systematic record of
@@ -100,7 +100,7 @@ The
orig tarballs are downloaded (by dgit clone) into the parent
directory, as with a traditional (non-gitish) dpkg-source workflow.
You need to retain these tarballs in the parent directory for dgit
-build and dgit push.
+build and dgit push-*.
(They are not needed for purely-git-based workflows.)
dgit repositories could be cloned with standard (git) methods.
@@ -373,13 +373,13 @@ Your appropriate response depends on the cause and the context.
If you have been freely merging your git branch
and do not need need a pretty linear patch queue,
you can use
-.B --quilt=smash
-(or use the
-.B 1.0
+.BR --quilt=single
or
+.BR --quilt=smash .
+(Don't use
+the
.B single-debian-patch
-source formats; see
-.BR dpkg-source(1) .)
+dpkg source format option; it has strange properties.)
If you want a pretty linear series,
and this message is unexpected,
it can mean that you have unwittingly committed changes
@@ -403,7 +403,7 @@ into a dgit branch.
When a splitting quilt mode is selected
dgit build commands and
-dgit push
+dgit push-*
will, on each invocation,
convert the user's HEAD into the dgit view,
so that it can be built and/or uploaded.
@@ -419,11 +419,11 @@ regardless of the quilt mode,
any dgit-generated pseudomerges
and any quilt fixup commits
will appear only in the dgit view.
-dgit push
+dgit push-*
will push the dgit view to the dgit
git server.
The dgit view is always a descendant of the maintainer view.
-dgit push will also make a maintainer view tag
+dgit push-* will also make a maintainer view tag
according to DEP-14
and push that to the dgit git server.
@@ -449,8 +449,9 @@ in the source tarball, but some people prefer not to have it present
in the git view of their project.
dgit requires that the source package unpacks to exactly the same
-files as are in the git commit on which dgit push operates. So if you
-just try to dgit push directly from one of these extra-clean git
+files as are in the git commit on which dgit push-* operates.
+So if you
+just try to dgit push-* directly from one of these extra-clean git
branches, it will fail.
As the maintainer you therefore have the following options:
diff --git a/tests/lib b/tests/lib
index c8ea771..c636f09 100644
--- a/tests/lib
+++ b/tests/lib
@@ -913,7 +913,7 @@ t-commit-build-push-expect-log () {
t-commit "$msg"
t-dgit build
LC_MESSAGES=C \
- t-dgit push --new 2>&1 |tee $tmp/push.log
+ t-dgit push-built --new 2>&1 |tee $tmp/push.log
t-grep-mpat "$mpat" $tmp/push.log
}
diff --git a/tests/lib-baredebian b/tests/lib-baredebian
index 557c051..51beb1f 100644
--- a/tests/lib-baredebian
+++ b/tests/lib-baredebian
@@ -68,7 +68,8 @@ baredebian-test-core-push () {
# (rather than dgit build), but so that we can check that our
# output is the same as users are used to.
- t-dgit -wn --quilt=$quiltmode --dgit-view-save=split.p --new push
+ t-dgit -wn --quilt=$quiltmode --dgit-view-save=split.p --new \
+ push-built
}
baredebian-test-core-postpush () {
diff --git a/tests/lib-core b/tests/lib-core
index 7fdddb4..d4d0bd5 100644
--- a/tests/lib-core
+++ b/tests/lib-core
@@ -33,6 +33,7 @@ t-set-using-tmp () {
git config --global user.email 'dgit-test@debian.example.net'
git config --global user.name "$DEBFULLNAME"
git config --global protocol.ext.allow always
+ git config --global dgit.default.push-subcmd reject
}
t-filter-out-git-hyphen-dir () {
diff --git a/tests/lib-orig-include-exclude b/tests/lib-orig-include-exclude
index 104cf0b..4372f36 100644
--- a/tests/lib-orig-include-exclude
+++ b/tests/lib-orig-include-exclude
@@ -29,7 +29,7 @@ test-push-1 () {
test-push-2 () {
$test_push_2_hook
- t-dgit $ch "$@" push
+ t-dgit $ch "$@" push-built
}
test-push-1 1.0-2 --ch:-sa
diff --git a/tests/setup/examplegit b/tests/setup/examplegit
index d25ee95..2d4ce4f 100755
--- a/tests/setup/examplegit
+++ b/tests/setup/examplegit
@@ -16,7 +16,7 @@ push-to () {
t-refs-same-start
t-ref-head
t-dgit build
- t-dgit push --new $2
+ t-dgit push-built --new $2
t-pushed-good $1 $2
t-archive-process-incoming $2
}
diff --git a/tests/tests/badcommit-rewrite b/tests/tests/badcommit-rewrite
index 3e2f37e..f116723 100755
--- a/tests/tests/badcommit-rewrite
+++ b/tests/tests/badcommit-rewrite
@@ -20,7 +20,7 @@ t-make-badcommit
git reset --hard $badcommit
t-dgit -wgf build
-t-dgit push --overwrite=1.2 stable
+t-dgit push-built --overwrite=1.2 stable
t-archive-process-incoming stable
rstable=refs/remotes/dgit/dgit/stable
diff --git a/tests/tests/clone-nogit b/tests/tests/clone-nogit
index f36a7b6..9dceafc 100755
--- a/tests/tests/clone-nogit
+++ b/tests/tests/clone-nogit
@@ -19,8 +19,7 @@ debcommit -a
t-refs-same-start
t-ref-head
-t-dgit --dpkg-buildpackage:-d build
-t-dgit push
+t-dgit push-source
t-pushed-good dgit/sid
diff --git a/tests/tests/debpolicy-dbretry b/tests/tests/debpolicy-dbretry
index a9f2334..421dee2 100755
--- a/tests/tests/debpolicy-dbretry
+++ b/tests/tests/debpolicy-dbretry
@@ -20,7 +20,7 @@ git reset --hard HEAD~
t-commit 'Make something to autotaint'
t-dgit build
-t-dgit push --new
+t-dgit push-built --new
autotaint=`t-git-get-ref "refs/tags/$tagpfx/$v"`
@@ -55,7 +55,7 @@ DGIT_RPD_TEST_DBLOOP_HOOK='
'\'' and die "$? $!";
}
' \
-t-dgit push --deliberately-not-fast-forward
+t-dgit push-built --deliberately-not-fast-forward
exec 3>&-
wait $sqlite3_pid
diff --git a/tests/tests/debpolicy-newreject b/tests/tests/debpolicy-newreject
index af02ac1..e02abd4 100755
--- a/tests/tests/debpolicy-newreject
+++ b/tests/tests/debpolicy-newreject
@@ -12,6 +12,8 @@ revision=1
git tag start
t-dgit setup-mergechangelogs
+git config dgit.default.push-subcmd built
+
echo FORBIDDEN >debian/some-file
git add debian/some-file
t-commit 'Commit a forbidden thing'
diff --git a/tests/tests/distropatches-reject b/tests/tests/distropatches-reject
index 75f43db..00e5edc 100755
--- a/tests/tests/distropatches-reject
+++ b/tests/tests/distropatches-reject
@@ -64,9 +64,9 @@ build
DEB_VENDOR=test-dummy-aside \
expect-fail-distro-series DEB_VENDOR \
-t-dgit push
+t-dgit push-built
-t-dgit push
+t-dgit push-built
cd ..
perl -i~ -pe 's/^Dgit:.*\n//' incoming/${p}_${v}.dsc
diff --git a/tests/tests/dpkgsourceignores-correct b/tests/tests/dpkgsourceignores-correct
index 33de95e..f71c3a4 100755
--- a/tests/tests/dpkgsourceignores-correct
+++ b/tests/tests/dpkgsourceignores-correct
@@ -48,6 +48,6 @@ git add .
git commit -m 'want these'
t-dgit --quilt=smash -wgf build-source
-t-dgit -wgf push
+t-dgit -wgf push-built
t-ok
diff --git a/tests/tests/drs-push-masterupdate b/tests/tests/drs-push-masterupdate
index 8457b59..7135467 100755
--- a/tests/tests/drs-push-masterupdate
+++ b/tests/tests/drs-push-masterupdate
@@ -13,7 +13,7 @@ git tag common-ancestor
revision=1
t-dgit build
-t-dgit push --new
+t-dgit push-built --new
push_and_check () {
git push $dgitrepo $1
@@ -24,7 +24,7 @@ push_and_check () {
git checkout master
t-commit 'Empty update'
t-dgit build
- t-dgit push --new
+ t-dgit push-built --new
t-pushed-good master
}
diff --git a/tests/tests/gbp-orig b/tests/tests/gbp-orig
index 2ac0073..15516c5 100755
--- a/tests/tests/gbp-orig
+++ b/tests/tests/gbp-orig
@@ -26,7 +26,7 @@ t-dgit -wgf --dgit-view-save=split.b gbp-build --git-ignore-branch
t-dgit -wgf --quilt=gbp clean # gbp leaves dirty trees :-/
-t-dgit -wgf --dgit-view-save=split.p --quilt=gbp push --new
+t-dgit -wgf --dgit-view-save=split.p --quilt=gbp push-built --new
t-gbp-pushed-good
diff --git a/tests/tests/gitworktree b/tests/tests/gitworktree
index e675a0a..e0f0e0d 100755
--- a/tests/tests/gitworktree
+++ b/tests/tests/gitworktree
@@ -22,8 +22,6 @@ git add modification
git commit -m 'want this'
t-dgit -wgf quilt-fixup
-t-dgit -wgf --quilt=nofix build
-
-t-dgit -wgf push
+t-dgit -wgf --quilt=nofix push-source
t-ok
diff --git a/tests/tests/mirror b/tests/tests/mirror
index 4aa756b..cedaf56 100755
--- a/tests/tests/mirror
+++ b/tests/tests/mirror
@@ -17,7 +17,7 @@ t-mirror-setup
cd $p
revision=1
t-dgit build
-t-dgit push --new
+t-dgit push-built --new
t-check-mirrored
diff --git a/tests/tests/mirror-debnewgit b/tests/tests/mirror-debnewgit
index 59b96ef..3015d0e 100755
--- a/tests/tests/mirror-debnewgit
+++ b/tests/tests/mirror-debnewgit
@@ -20,7 +20,7 @@ t-cloned-fetched-good
t-commit 'test commit' 3-2
t-dgit build
-t-dgit push
+t-dgit push-built
t-check-mirrored
t-ok
diff --git a/tests/tests/mirror-private b/tests/tests/mirror-private
index 1e885ae..eaf3dad 100755
--- a/tests/tests/mirror-private
+++ b/tests/tests/mirror-private
@@ -17,8 +17,7 @@ revision=1
t-reporefs master
-t-dgit build
-t-dgit push --new
+t-dgit push-source --new
t-check-not-mirrored
t-files-notexist $reposmirror/$p.*
diff --git a/tests/tests/mismatches-contents b/tests/tests/mismatches-contents
index e424016..20bf980 100755
--- a/tests/tests/mismatches-contents
+++ b/tests/tests/mismatches-contents
@@ -19,6 +19,6 @@ git commit -m "Commit $v"
t-dgit build-source
t-expect-fail 'debian/TRASH' \
-t-dgit push --new
+t-dgit push-built --new
t-ok
diff --git a/tests/tests/mismatches-dscchanges b/tests/tests/mismatches-dscchanges
index 85c7086..e73385e 100755
--- a/tests/tests/mismatches-dscchanges
+++ b/tests/tests/mismatches-dscchanges
@@ -19,7 +19,7 @@ check () {
../*.$fext
t-expect-fail "$emsgpat" \
- t-dgit -wgf push --new
+ t-dgit -wgf push-built --new
}
check dsc E:'dpkg-source.*error.*checksum'
@@ -29,6 +29,6 @@ check changes E:'dgit.*hash or size.*varies'
t-dgit -wgf build-source
-t-dgit -wgf push --new
+t-dgit -wgf push-built --new
t-ok
diff --git a/tests/tests/overwrite-chkclog b/tests/tests/overwrite-chkclog
index fee2181..35147bc 100755
--- a/tests/tests/overwrite-chkclog
+++ b/tests/tests/overwrite-chkclog
@@ -13,7 +13,7 @@ t-commit 'No changes, just send to stable' '' stable
t-dgit -wgf build
t-expect-fail 'Perhaps debian/changelog does not mention' \
-t-dgit push --overwrite stable
+t-dgit push-built --overwrite stable
t-dgit setup-mergechangelogs
@@ -30,7 +30,7 @@ git commit -m 'UNRELEASED changelog'
t-dgit -wgf build
t-expect-fail E:'Distribution.*is UNRELEASED' \
-t-dgit push --overwrite stable
+t-dgit push-built --overwrite stable
git revert --no-edit 'HEAD^{/UNRELEASED changelog}'
@@ -41,10 +41,10 @@ git add debian/changelog
git commit -m 'Break changelog'
t-expect-fail 'Perhaps debian/changelog does not mention' \
-t-dgit push --overwrite stable
+t-dgit push-built --overwrite stable
git revert --no-edit 'HEAD^{/Break changelog}'
-t-dgit push --overwrite stable
+t-dgit push-built --overwrite stable
t-ok
diff --git a/tests/tests/overwrite-junk b/tests/tests/overwrite-junk
index e11d1f8..978da28 100755
--- a/tests/tests/overwrite-junk
+++ b/tests/tests/overwrite-junk
@@ -17,6 +17,6 @@ t-dgit -wgf build
cd $tmp/git/$p.git; git tag -f $tagpfx/1.2 $tagpfx/1.1
)
-t-dgit push --overwrite=1.2 stable
+t-dgit push-built --overwrite=1.2 stable
t-ok
diff --git a/tests/tests/overwrite-splitbrains b/tests/tests/overwrite-splitbrains
index 815c207..6e72c3d 100755
--- a/tests/tests/overwrite-splitbrains
+++ b/tests/tests/overwrite-splitbrains
@@ -14,12 +14,12 @@ t-refs-same-start
t-ref-head
t-expect-fail 'maybe --overwrite is needed' \
-t-dgit --quilt=gbp --dgit-view-save=split.p push
+t-dgit --quilt=gbp --dgit-view-save=split.p push-built
t-refs-same-start
t-ref-head
-t-dgit --quilt=gbp --dgit-view-save=split.p --overwrite push
+t-dgit --quilt=gbp --dgit-view-save=split.p --overwrite push-built
t-gbp-pushed-good
diff --git a/tests/tests/overwrite-version b/tests/tests/overwrite-version
index 34301ac..9925098 100755
--- a/tests/tests/overwrite-version
+++ b/tests/tests/overwrite-version
@@ -13,8 +13,8 @@ t-commit 'No changes, just send to stable' '' stable
t-dgit -wgf build
t-expect-fail 'HEAD is not a descendant' \
-t-dgit push stable
+t-dgit push-built stable
-t-dgit push --overwrite=1.2 stable
+t-dgit push-built --overwrite=1.2 stable
t-ok
diff --git a/tests/tests/pbuilder b/tests/tests/pbuilder
index 56eed0b..418c4a4 100755
--- a/tests/tests/pbuilder
+++ b/tests/tests/pbuilder
@@ -25,7 +25,7 @@ t-dgit -v0 --pbuilder="$troot/pretend-pbuilder" pbuilder -b
# RC-buggy in that it doesn't build with -A ..
t-dgit -v0 --pbuilder="$troot/pretend-pbuilder" --pbuilder!:--no-source-only-changes pbuilder
-t-dgit -wgf push --new
+t-dgit -wgf push-built --new
t-pushed-good master stable
t-pushed-good-check-changes
diff --git a/tests/tests/push-buildproductsdir b/tests/tests/push-buildproductsdir
index cc1c5e2..ee4b344 100755
--- a/tests/tests/push-buildproductsdir
+++ b/tests/tests/push-buildproductsdir
@@ -25,7 +25,7 @@ mv $p*_* bpd/
mv bpd/*orig* .
cd $p
-t-dgit --build-products-dir=../bpd push
+t-dgit --build-products-dir=../bpd push-built
t-pushed-good dgit/sid
diff --git a/tests/tests/push-newpackage b/tests/tests/push-newpackage
index 79355e3..ac3aaef 100755
--- a/tests/tests/push-newpackage
+++ b/tests/tests/push-newpackage
@@ -9,21 +9,21 @@ t-refs-same-start
t-ref-head
t-expect-push-fail 'package appears to be new in this suite' \
-t-dgit push
+t-dgit push-built
t-dgit build
git checkout bogus
set +e
-(set -e; DGIT_TEST_DEBUG=' ' t-dgit push --new)
+(set -e; DGIT_TEST_DEBUG=' ' t-dgit push-built --new)
rc=$?
set -e
if [ $rc = 0 ]; then fail "push succeeded when tree mismatch"; fi
git checkout master
-t-dgit push --new
+t-dgit push-built --new
t-pushed-good master
diff --git a/tests/tests/push-newrepeat b/tests/tests/push-newrepeat
index 048dfd2..88f4462 100755
--- a/tests/tests/push-newrepeat
+++ b/tests/tests/push-newrepeat
@@ -14,8 +14,8 @@ t-dgit --quilt=smash build-source
t-expect-fail E:'Push failed, while updating the remote git repository' \
t-dgit -cdgit-distro.test-dummy.git-url=file:///dev/enoent/fail \
- push --new
+ push-built --new
-t-dgit push --new --force-reusing-version
+t-dgit push-built --new --force-reusing-version
t-ok
diff --git a/tests/tests/push-nextdgit b/tests/tests/push-nextdgit
index d0436ab..4494231 100755
--- a/tests/tests/push-nextdgit
+++ b/tests/tests/push-nextdgit
@@ -18,7 +18,7 @@ t-refs-same-start
t-ref-head
t-dgit --dpkg-buildpackage:-d build
-t-dgit push
+t-dgit push-source
t-pushed-good dgit/sid
diff --git a/tests/tests/push-source b/tests/tests/push-source
index 79c4636..888b84a 100755
--- a/tests/tests/push-source
+++ b/tests/tests/push-source
@@ -8,11 +8,12 @@ t-buildproductsdir-config
t-prep-newpackage example 1.0
cd $p
+git config --global dgit.default.push-subcmd source
t-refs-same-start
t-ref-head
-t-dgit push-source --new
+t-dgit push --new
t-pushed-good master
t-push-was-source-only
diff --git a/tests/tests/quilt b/tests/tests/quilt
index f26f744..06b646c 100755
--- a/tests/tests/quilt
+++ b/tests/tests/quilt
@@ -25,7 +25,7 @@ iteration () {
t-refs-same-start
t-dgit --dpkg-buildpackage:-d build
- t-dgit push
+ t-dgit push-built
t-pushed-good dgit/sid
}
diff --git a/tests/tests/quilt-gbp b/tests/tests/quilt-gbp
index 4dc597d..e1e53c8 100755
--- a/tests/tests/quilt-gbp
+++ b/tests/tests/quilt-gbp
@@ -45,7 +45,7 @@ test-push-1 () {
}
test-push-2 () {
- t-dgit --quilt=gbp --dgit-view-save=split.p push
+ t-dgit --quilt=gbp --dgit-view-save=split.p push-built
t-gbp-pushed-good
}
@@ -55,7 +55,7 @@ test-push-1
t-dgit --quilt=gbp --clean=git --dgit-view-save=split.b build-source
t-expect-fail "HEAD specifies a different tree to $p" \
- t-dgit push
+ t-dgit push-built
test-push-2
diff --git a/tests/tests/quilt-singlepatch b/tests/tests/quilt-singlepatch
index 9c03595..68982a2 100755
--- a/tests/tests/quilt-singlepatch
+++ b/tests/tests/quilt-singlepatch
@@ -24,7 +24,7 @@ t-ref-head
t-dgit -wgf build-source
-t-dgit push
+t-dgit push-built
t-pushed-good dgit/sid
diff <<END - debian/patches/series
@@ -40,6 +40,6 @@ git apply --reverse debian/patches/debian-changes
git commit -a -m 'go back to plain upstream'
t-dgit -wgf build-source
-t-dgit --damp-run --force-reusing-version push
+t-dgit --damp-run --force-reusing-version push-built
t-ok
diff --git a/tests/tests/quilt-splitbrains b/tests/tests/quilt-splitbrains
index f8d8091..1940410 100755
--- a/tests/tests/quilt-splitbrains
+++ b/tests/tests/quilt-splitbrains
@@ -26,7 +26,7 @@ want-success () {
t-dgit "$@" --quilt=$qmode --dgit-view-save=split.b build-source
- t-dgit "$@" --quilt=$qmode --dgit-view-save=split.p push
+ t-dgit "$@" --quilt=$qmode --dgit-view-save=split.p push-built
t-$qmode-pushed-good $suite
}
@@ -101,7 +101,7 @@ t-dgit --quilt=unapplied build-source
t-dgit --quilt=nofix build-source
t-refs-same-start
t-ref-head
-t-dgit --quilt=nofix push
+t-dgit --quilt=nofix push-built
t-pushed-good-core
diff --git a/tests/tests/sourceonlypolicy b/tests/tests/sourceonlypolicy
index b0569c3..ec365a6 100755
--- a/tests/tests/sourceonlypolicy
+++ b/tests/tests/sourceonlypolicy
@@ -29,7 +29,7 @@ t-commit 'Now with binaries'
t-dgit -wgf build
t-expect-fail E:'uploading binaries.*source only' \
-dgit-with-policy always push --new
+dgit-with-policy always push-built --new
t-commit 'Source-only not NEW'
diff --git a/tests/tests/tag-updates b/tests/tests/tag-updates
index 824fd1e..7a17a8b 100755
--- a/tests/tests/tag-updates
+++ b/tests/tests/tag-updates
@@ -7,8 +7,7 @@ t-prep-newpackage example 1.0
cd $p
revision=1
-t-dgit build
-t-dgit push --new
+t-dgit push-source --new
tagref=`t-v-tag`
tagname=${tn#refs/tags}
diff --git a/tests/tests/trustingpolicy-replay b/tests/tests/trustingpolicy-replay
index a2d280d..8ebeb2c 100755
--- a/tests/tests/trustingpolicy-replay
+++ b/tests/tests/trustingpolicy-replay
@@ -16,18 +16,15 @@ cd $p
revision=1
git tag start
-t-dgit build
-t-dgit push --new
+t-dgit push-source --new
t-rm-dput-dropping
t-commit 'Prep v1.1 which will be rewound'
-t-dgit build
-t-dgit push
+t-dgit push-source
git checkout $tagpfx/1.0
-t-dgit build
-t-dgit push --deliberately-fresh-repo --force-reusing-version
+t-dgit push-source --deliberately-fresh-repo --force-reusing-version
remote="`git config dgit-distro.test-dummy.git-url`/$p.git"
@@ -53,7 +50,7 @@ prepare-replay () {
t-commit "request with $delib that we will replay"
t-dgit build
t-expect-push-fail 'system: No such file or directory' \
- t-dgit push $delib
+ t-dgit push-source $delib
t-policy dgit-repos-policy-trusting
@@ -79,8 +76,7 @@ attempt-replay 'does not declare previously heads/for-testing'
prepare-replay --deliberately-not-fast-forward
t-commit 'later version to stop not fast forward rewinding'
-t-dgit build
-t-dgit push
+t-dgit push-source
attempt-replay "does not declare previously tags/$tagpfx/$v"
diff --git a/tests/tests/unrepresentable b/tests/tests/unrepresentable
index fb1cf61..8f451aa 100755
--- a/tests/tests/unrepresentable
+++ b/tests/tests/unrepresentable
@@ -10,60 +10,131 @@ ln -s $troot/pkg-srcs/${p}_${v%-*}.orig.tar.* .
cd $p
-start () { git checkout quilt-tip-1.1~0; }
-attempt () { t-dgit -wgf --quilt=smash quilt-fixup; }
-good () {
- attempt
- t-dgit --quilt=nofix -wgf build-source
- t-dgit -wgf --dry-run push --new
+make_singlepatch () {
+ git checkout quilt-tip-1.1
+ echo >debian/source/options single-debian-patch
+ git add debian/source/options
+ git commit -m single-debian-patch debian/source/options
}
-badly-1 () {
- wrongfn=$1
- wrongmsg=$2
- start
-}
+quilt_mode=smash
+case $DGIT_TEST_TESTNAME in
+ *-single-dpkg) make_singlepatch ;;
+ *-single-git) quilt_mode=single ;;
+ *-*) fail 'unknown test name' ;;
+ *) ;;
+esac
-badly-2-raw () {
- git commit -m "Commit wrongness $wrongfn ($wrongmsg)"
+quilt-fixup () {
+ t-dgit -wgf --quilt=$quilt_mode quilt-fixup
+}
+build-source () {
+ t-dgit --quilt=nofix -wgf build-source
+}
+run-push () {
+ t-dgit -wgf --dry-run push-built --new
+}
+badly-raw () {
+ wrongmsg=$1
+ t-expect-fail "$1" \
+ quilt-fixup
+}
+badly-late-raw () {
+ quilt-fixup
+ build-source
t-expect-fail "$1" \
- attempt
+ run-push
}
-badly-2 () {
- badly-2-raw E:"cannot represent change: $wrongmsg .*: $wrongfn"
+good () {
+ quilt-fixup
+ build-source
+ run-push
+}
+
+start () {
+ path=$1
+ git checkout quilt-tip-1.1~0;
}
+finish () {
+ case "$DGIT_TEST_TESTNAME" in
+ *-single-dpkg) expected=${2-$1} ;;
+ *) expected=$1 ;;
+ esac
-badly-1 orig-symlink 'modified symlink'
+ case "$expected" in
+ NOTHING) ;;
+ *) git commit -m "$expected" ;;
+ esac
+
+ case "$expected" in
+ GOOD:*|NOTHING)
+ good
+ ;;
+
+ EP:*)
+ wrongmsg="${expected#*:}"
+ badly-raw E:"cannot represent change: $wrongmsg .*: $path"
+ ;;
+
+ LATE-EP:*)
+ # quilt-fixup and dpkg-source succeeded, but dgit push failed.
+ # This is rather a poor outcome.
+ case "$DGIT_TEST_TESTNAME" in
+ *-single-dpkg) ;;
+ *) fail 'push failure, other than with single-debina-patch' ;;
+ esac
+
+ wrongmsg="${expected#*:}"
+ badly-late-raw "E:$wrongmsg.*: $path"
+ ;;
+
+ E:* | [^A-Z]*)
+ badly-raw "$expected"
+ ;;
+
+ *) fail 'bad pattern' ;;
+
+ esac
+}
+
+start orig-symlink
ln -sf NEWTARGET orig-symlink
git add orig-symlink
-badly-2
+finish EP:'modified symlink' 'new version is symlink'
-badly-1 orig-symlink 'deletion of symlink'
+start orig-symlink
git rm -f orig-symlink
-badly-2
+finish EP:'deletion of symlink' LATE-EP:'Mode change from 20000 to 000000'
-badly-1
+start new
ln -s hi new
git add new
-badly-2-raw 'new version is symlink'
+finish EP:'creation .* symlink' 'new version is symlink'
-start
+start src.c
git rm src.c
- git commit -m deleted
-good
+finish GOOD:deleted
-start
+start orig-exec
git rm orig-exec
+finish GOOD:'deleted exec'
+
+start orig-unwriteable
git rm -f orig-unwriteable
- git commit -m 'deleted funny'
-good
+finish GOOD:'deleted unwritable'
-badly-1 src.c 'mode or type changed'
+start src.c
chmod +x src.c
git add src.c
-badly-2
+finish GOOD:chmod LATE-EP:'Mode change from 644 to 755'
+
+start newx
+ echo hi >newx
+ chmod 755 newx
+ git add newx
+finish GOOD:add-755 LATE-EP:'Mode change from 644 to 755'
-start
-good
+start nothing
+finish NOTHING NOTHING
t-ok
diff --git a/tests/tests/unrepresentable-single-dpkg b/tests/tests/unrepresentable-single-dpkg
new file mode 100755
index 0000000..f1ac270
--- /dev/null
+++ b/tests/tests/unrepresentable-single-dpkg
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -e
+. tests/lib
+t-chain-test unrepresentable
diff --git a/tests/tests/unrepresentable-single-git b/tests/tests/unrepresentable-single-git
new file mode 100755
index 0000000..f1ac270
--- /dev/null
+++ b/tests/tests/unrepresentable-single-git
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -e
+. tests/lib
+t-chain-test unrepresentable
diff --git a/tests/tests/version-opt b/tests/tests/version-opt
index 2933912..fff9a4d 100755
--- a/tests/tests/version-opt
+++ b/tests/tests/version-opt
@@ -13,8 +13,7 @@ revision=1
git tag start
t-dgit setup-mergechangelogs
-t-dgit build-source
-t-dgit push --new --overwrite
+t-dgit push-source --new --overwrite
t-archive-process-incoming sid