From 3c2fdc3b9e35352aabbc8b09c286aba2fbfab2ac Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 24 Jun 2018 23:37:26 +0100 Subject: changelog: start 5.3~ Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index d6ce19e..763c427 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.3~) unstable; urgency=medium + + * + + -- + dgit (5.2) unstable; urgency=medium dgit bugfixes: -- cgit v1.2.3 From 11c8c965c3419fddf2444a7497b45b65f05d3db5 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 26 Jun 2018 18:25:13 +0100 Subject: ref updates: Introduce update_ref_cmd Currently the comment about `message may be modified' is rather misleading, since there is no code to do that - but it explains the semantics of the new function. We change the appropriate subset of the git update-ref call sites. These are precisely the ones where we previously specified a message with -m, except for the quilt cache (where we use the reflog message as the cache lookup key). The calls are updates of internal refs etc. We end up using qw(git) rather than @git. Otherwise no functional change. Signed-off-by: Ian Jackson --- Debian/Dgit.pm | 9 ++++++++- dgit | 13 ++++++------- git-debrebase | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index 57b79e8..2bac485 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -51,7 +51,7 @@ BEGIN { git_rev_parse git_cat_file git_get_ref git_get_symref git_for_each_ref git_for_each_tag_referring is_fast_fwd - git_check_unmodified + git_check_unmodified git_update_ref_cmd $package_re $component_re $deliberately_re $distro_re $versiontag_re $series_filename_re $extra_orig_namepart_re @@ -492,6 +492,13 @@ sub is_fast_fwd ($$) { } } +sub git_update_ref_cmd { + # returns qw(git update-ref), qw(-m), @_ + # except that message may be modified to honour GIT_REFLOG_ACTION + my $msg = shift @_; + return qw(git update-ref -m), $msg, @_; +} + sub changedir ($) { my ($newdir) = @_; printdebug "CD $newdir\n"; diff --git a/dgit b/dgit index 5c9cdc3..bbfaea1 100755 --- a/dgit +++ b/dgit @@ -2851,15 +2851,14 @@ sub mergeinfo_version ($) { sub fetch_from_archive_record_1 ($) { my ($hash) = @_; - runcmd @git, qw(update-ref -m), "dgit fetch $csuite", - 'DGIT_ARCHIVE', $hash; + runcmd git_update_ref_cmd "dgit fetch $csuite", 'DGIT_ARCHIVE', $hash; cmdoutput @git, qw(log -n2), $hash; # ... gives git a chance to complain if our commit is malformed } sub fetch_from_archive_record_2 ($) { my ($hash) = @_; - my @upd_cmd = (@git, qw(update-ref -m), 'dgit fetch', lrref(), $hash); + my @upd_cmd = (git_update_ref_cmd 'dgit fetch', lrref(), $hash); if (act_local()) { cmdoutput @upd_cmd; } else { @@ -3850,7 +3849,7 @@ sub maybe_split_brain_save ($$$) { # => message fragment "$saved" describing disposition of $dgitview return "commit id $dgitview" unless defined $split_brain_save; my @cmd = (shell_cmd 'cd "$1"; shift', $maindir, - @git, qw(update-ref -m), + git_update_ref_cmd "dgit --dgit-view-save $msg HEAD=$headref", $split_brain_save, $dgitview); runcmd @cmd; @@ -4050,7 +4049,7 @@ sub plain_overwrite_pseudomerge ($$$) { $clogp, $head, $archive_hash, $i_arch_v, "dgit", $m; - runcmd @git, qw(update-ref -m), $m, 'HEAD', $r, $head; + runcmd git_update_ref_cmd $m, 'HEAD', $r, $head; progress "Make pseudo-merge of $i_arch_v->[0] into your HEAD."; return $r; @@ -4496,7 +4495,7 @@ END runcmd_ordryrun @git, qw(-c push.followTags=false push), access_giturl(), @pushrefs; - runcmd_ordryrun @git, qw(update-ref -m), 'dgit push', lrref(), $dgithead; + runcmd_ordryrun git_update_ref_cmd 'dgit push', lrref(), $dgithead; supplementary_message(<<'END'); Push failed, while obtaining signatures on the .changes and .dsc. @@ -6437,7 +6436,7 @@ sub cmd_quilt_fixup { sub import_dsc_result { my ($dstref, $newhash, $what_log, $what_msg) = @_; - my @cmd = (@git, qw(update-ref -m), $what_log, $dstref, $newhash); + my @cmd = (git_update_ref_cmd $what_log, $dstref, $newhash); runcmd @cmd; check_gitattrs($newhash, "source tree"); diff --git a/git-debrebase b/git-debrebase index fd05c6b..fe11251 100755 --- a/git-debrebase +++ b/git-debrebase @@ -118,7 +118,7 @@ sub run_deferred_updates ($) { confess 'dangerous internal error' unless all_snags_summarised(); - my @upd_cmd = (@git, qw(update-ref --stdin -m), "debrebase: $mrest"); + my @upd_cmd = (git_update_ref_cmd "debrebase: $mrest", qw(--stdin)); debugcmd '>|', @upd_cmd; open U, "|-", @upd_cmd or die $!; foreach (@deferred_updates) { -- cgit v1.2.3 From 3413485f2c7fbb36dfc4c6bf42176cd228511985 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 26 Jun 2018 18:30:24 +0100 Subject: ref updates: Honour GIT_REFLOG_ACTION everywhere. Specifically, every time we call git_update_ref_cmd. Closes:#901935. Signed-off-by: Ian Jackson --- Debian/Dgit.pm | 2 ++ debian/changelog | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index 2bac485..0a99faa 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -496,6 +496,8 @@ sub git_update_ref_cmd { # returns qw(git update-ref), qw(-m), @_ # except that message may be modified to honour GIT_REFLOG_ACTION my $msg = shift @_; + my $rla = $ENV{GIT_REFLOG_ACTION}; + $msg = "$rla: $msg" if length $rla; return qw(git update-ref -m), $msg, @_; } diff --git a/debian/changelog b/debian/changelog index 763c427..70d600f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ dgit (5.3~) unstable; urgency=medium - * + Bugfixes: + * Honour GIT_REFLOG_ACTION everywhere. Closes:#901935. -- -- cgit v1.2.3 From 65c0c0413e6fbd324127090ab55d71b2e5718423 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 26 Jun 2018 18:33:45 +0100 Subject: ref updates: Break out git_reflog_action_msg No functional change. Signed-off-by: Ian Jackson --- Debian/Dgit.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index 0a99faa..5106f85 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -51,7 +51,8 @@ BEGIN { git_rev_parse git_cat_file git_get_ref git_get_symref git_for_each_ref git_for_each_tag_referring is_fast_fwd - git_check_unmodified git_update_ref_cmd + git_check_unmodified + git_reflog_action_msg git_update_ref_cmd $package_re $component_re $deliberately_re $distro_re $versiontag_re $series_filename_re $extra_orig_namepart_re @@ -492,12 +493,18 @@ sub is_fast_fwd ($$) { } } +sub git_reflog_action_msg ($) { + my ($msg) = @_; + my $rla = $ENV{GIT_REFLOG_ACTION}; + $msg = "$rla: $msg" if length $rla; + return $msg; +} + sub git_update_ref_cmd { # returns qw(git update-ref), qw(-m), @_ # except that message may be modified to honour GIT_REFLOG_ACTION my $msg = shift @_; - my $rla = $ENV{GIT_REFLOG_ACTION}; - $msg = "$rla: $msg" if length $rla; + $msg = git_reflog_action_msg $msg; return qw(git update-ref -m), $msg, @_; } -- cgit v1.2.3 From 2093c3c0d973b6e9d4b7085ac3084de94550744f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 26 Jun 2018 18:43:49 +0100 Subject: git-debrebase new-upstream: Provide better reflog entries By setting GIT_REFLOG_ACTION. Closes:#901925. Signed-off-by: Ian Jackson --- debian/changelog | 2 ++ git-debrebase | 2 ++ 2 files changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index 70d600f..0dc3014 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ dgit (5.3~) unstable; urgency=medium Bugfixes: * Honour GIT_REFLOG_ACTION everywhere. Closes:#901935. + * git-debrebase new-upstream: Provide better reflog entries + by setting GIT_REFLOG_ACTION. Closes:#901925. -- diff --git a/git-debrebase b/git-debrebase index fe11251..658884d 100755 --- a/git-debrebase +++ b/git-debrebase @@ -1351,6 +1351,8 @@ END 'launder for new upstream'; my @cmd = (@git, qw(rebase --onto), $new_bw, $old_bw, @ARGV); + local $ENV{GIT_REFLOG_ACTION} = git_reflog_action_msg + "debrebase new-upstream $new_version: rebase"; runcmd @cmd; # now it's for the user to sort out } -- cgit v1.2.3 From 047db2064cbc162d8fceff77ec6dd38eab135c6c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 26 Jun 2018 18:44:55 +0100 Subject: test suite: Test GIT_REFLOG_ACTION setting by git-debrebase Signed-off-by: Ian Jackson --- tests/tests/gdr-newupstream | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/tests/gdr-newupstream b/tests/tests/gdr-newupstream index 536f49c..cfa0052 100755 --- a/tests/tests/gdr-newupstream +++ b/tests/tests/gdr-newupstream @@ -37,6 +37,7 @@ git tag v2.1 upstream t-git-debrebase new-upstream $v t-gdr-good laundered +git reflog | egrep 'debrebase new-upstream.*checkout' t-git-debrebase stitch t-gdr-good stitched @@ -54,8 +55,11 @@ anchor=$(perl <../anal.anch -ne ' exit; ') +GIT_REFLOG_ACTION='STUNT-RLA' \ t-git-debrebase --anchor=$anchor -fanchor-treated new-upstream $v upstream t-gdr-good laundered +git reflog | egrep 'STUNT-RLA: debrebase new-upstream' +git reflog | egrep 'STUNT-RLA: debrebase: launder for new upstream' t-git-debrebase stitch t-gdr-good stitched -- cgit v1.2.3 From ef0c4cd40f2c8bd50ea252f7de56dae3b64eeced Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Jun 2018 00:16:29 +0100 Subject: dgit: Do not introduce duplicate origs in .changes files The .dsc and .changes matching code contained roughly $fieldbody =~ / \Q$item\E\n/m but this is wrong when the $fieldbody matches $item in its last line, and there is no trailing newline (as would be usual). This code is obviouslu confused because m affects only ^ $ which don't appear in the regexp. Change these to / \Q$item\E$/m which is what ought to have been, and probably was, intended. In one case we are trying to delete a line. In that case we need to remove the leading newline. The field body always starts with a newline so the use of \n rather than ^ is fine. Closes:#869146. Signed-off-by: Ian Jackson --- debian/changelog | 2 ++ dgit | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0dc3014..4a0883c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ dgit (5.3~) unstable; urgency=medium Bugfixes: + * dgit: Do not introduce duplicate origs in .changes files, + eg if the .changes already has that orig. Closes:#869146. * Honour GIT_REFLOG_ACTION everywhere. Closes:#901935. * git-debrebase new-upstream: Provide better reflog entries by setting GIT_REFLOG_ACTION. Closes:#901925. diff --git a/dgit b/dgit index bbfaea1..d18cc73 100755 --- a/dgit +++ b/dgit @@ -1975,12 +1975,12 @@ END if ($found_same) { # in archive, delete from .changes if it's there $changed{$file} = "removed" if - $changes->{$fname} =~ s/^.* \Q$file\E$(?:)\n//m; - } elsif ($changes->{$fname} =~ m/^.* \Q$file\E$(?:)\n/m) { + $changes->{$fname} =~ s/\n.* \Q$file\E$(?:)$//m; + } elsif ($changes->{$fname} =~ m/^.* \Q$file\E$(?:)$/m) { # not in archive, but it's here in the .changes } else { my $dsc_data = getfield $dsc, $fname; - $dsc_data =~ m/^(.* \Q$file\E$)\n/m or die "$dsc_data $file ?"; + $dsc_data =~ m/^(.* \Q$file\E$)$/m or die "$dsc_data $file ?"; my $extra = $1; $extra =~ s/ \d+ /$&$placementinfo / or die "$fname $extra >$dsc_data< ?" -- cgit v1.2.3 From 94518af3396d2ff724f98e5bb6b6a533e14c78e8 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 26 Jun 2018 21:55:37 +0100 Subject: test suite: Test ill-advised repeat dgit push after git push fails This demonstrates #869146, which is about dgit repeatedly adding the same .orig to the .changes. Signed-off-by: Ian Jackson --- debian/tests/control | 2 +- tests/tests/push-newrepeat | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 tests/tests/push-newrepeat diff --git a/debian/tests/control b/debian/tests/control index 378cf4c..8b9d34e 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -52,7 +52,7 @@ Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin Restrictions: x-dgit-git-only -Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-asplit build-modes-gbp-asplit clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version protocol-compat push-buildproductsdir push-newpackage push-nextdgit push-source push-source-with-changes quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains quilt-useremail rpush tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt +Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-asplit build-modes-gbp-asplit clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version 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 tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin diff --git a/tests/tests/push-newrepeat b/tests/tests/push-newrepeat new file mode 100755 index 0000000..87fcb35 --- /dev/null +++ b/tests/tests/push-newrepeat @@ -0,0 +1,21 @@ +#!/bin/bash +set -e +. tests/lib + +t-tstunt-parsechangelog + +t-prep-newpackage example 1.0 + +cd $p +git checkout quilt-tip +cp $troot/pkg-srcs/${p}_1.0.orig.tar.gz .. + +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 + +t-dgit push --new + +t-ok -- cgit v1.2.3 From a948561e5e1062df67b0c9f4d506c6246f6e49c5 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Jun 2018 01:06:00 +0100 Subject: dgit(1): Mention in --overwrite that it is usually needed for first dgit push This is part of #891031. Signed-off-by: Ian Jackson --- dgit.1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dgit.1 b/dgit.1 index 8ddcbe3..e54ab43 100644 --- a/dgit.1 +++ b/dgit.1 @@ -519,6 +519,12 @@ This option is useful if you are the maintainer, and you have incorporated NMU changes into your own git workflow in a way that doesn't make your branch a fast forward from the NMU. +This option is also usually necessary +the first time a package is pushed with dgit push +to a particular suite. +See +.BR dgit-maint- \fI*\fR (7) . + .I previous-version ought to be the version currently in the archive. If .I previous-version -- cgit v1.2.3 From 6ff90ffc23a2d6a400d3c72d6caedf62da92b037 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Jun 2018 01:25:31 +0100 Subject: test suite: --overwrite test: Be more tolerant of exact message We're about to change this, apropos of #891031. Signed-off-by: Ian Jackson --- tests/tests/overwrite-splitbrains | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests/overwrite-splitbrains b/tests/tests/overwrite-splitbrains index 0ef03f6..06d1a98 100755 --- a/tests/tests/overwrite-splitbrains +++ b/tests/tests/overwrite-splitbrains @@ -14,7 +14,7 @@ t-dgit fetch t-refs-same-start t-ref-head -t-expect-fail 'check failed (maybe --overwrite is needed' \ +t-expect-fail 'maybe --overwrite is needed' \ t-dgit --quilt=gbp --dgit-view-save=split.p push t-refs-same-start -- cgit v1.2.3 From 05babd80e5414230f567ac26bf3d5118aa595320 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Jun 2018 01:26:49 +0100 Subject: dgit: Better message formatting when --overwrite may be needed Closes:891031. Signed-off-by: Ian Jackson --- debian/changelog | 4 ++++ dgit | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4a0883c..724f784 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,10 @@ dgit (5.3~) unstable; urgency=medium * git-debrebase new-upstream: Provide better reflog entries by setting GIT_REFLOG_ACTION. Closes:#901925. + Improvements: + * Better message formatting when --overwrite may be needed, + and a note about first dgit push in dgit(1). Closes:891031. + -- dgit (5.2) unstable; urgency=medium diff --git a/dgit b/dgit index d18cc73..1559a02 100755 --- a/dgit +++ b/dgit @@ -4013,10 +4013,12 @@ sub splitbrain_pseudomerge ($$$$) { infopair_cond_ff($i_dep14, [ $maintview, 'HEAD' ]); 1; }) { + $@ =~ s/^\n//; chomp $@; print STDERR < Date: Wed, 27 Jun 2018 13:29:04 +0100 Subject: dgit(7): Add discussion of quilt fixup error messages And add cross-references to dgit(1) and the actual error. Somewhat apropos of #842614. Signed-off-by: Ian Jackson --- debian/changelog | 3 ++ dgit | 3 +- dgit.1 | 5 ++++ dgit.7 | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 724f784..ccb0d2b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,9 @@ dgit (5.3~) unstable; urgency=medium Improvements: * Better message formatting when --overwrite may be needed, and a note about first dgit push in dgit(1). Closes:891031. + * dgit(7): Add discussion of quilt fixup error messages, + and add cross-references to dgit(1) and the actual error. + Somewhat apropos of #842614. -- diff --git a/dgit b/dgit index 1559a02..bfc168c 100755 --- a/dgit +++ b/dgit @@ -5400,7 +5400,8 @@ sub quiltify ($$$$) { print STDERR "$us: ", $reportnot->($notp), "\n"; } print STDERR "$us: $_\n" foreach @$failsuggestion; - fail "quilt fixup naive history linearisation failed.\n". + fail + "quilt history linearisation failed. Search \`quilt fixup' in dgit(7).\n". "Use dpkg-source --commit by hand; or, --quilt=smash for one ugly patch"; } elsif ($quilt_mode eq 'smash') { } elsif ($quilt_mode eq 'auto') { diff --git a/dgit.1 b/dgit.1 index e54ab43..f15fecf 100644 --- a/dgit.1 +++ b/dgit.1 @@ -334,6 +334,11 @@ so dgit quilt-fixup can be useful in its own right. To always use dgit's own patch generator instead of git-debrebase make-patches, pass --git-debrebase=true to dgit. + +See +.B FORMAT 3.0 (QUILT) +in +.BR dgit(7) . .TP \fBdgit import-dsc\fR [\fIsub-options\fR] \fI../path/to/.dsc\fR [\fB+\fR|\fB..\fR]branch Import a Debian-format source package, diff --git a/dgit.7 b/dgit.7 index 7ad5aba..0d43ee0 100644 --- a/dgit.7 +++ b/dgit.7 @@ -284,6 +284,13 @@ pushing. The only thing you need to know is that dgit build, sbuild, etc., may make new commits on your HEAD. If you're not a quilt user this commit won't contain any changes to files you care about. +Simply commiting to source files +(whether in debian/ or not, but not to patches) +will result in a branch that dgit quilt-fixup can linearise. +Other kinds of changes, +including editing patches or merging, +cannot be handled this way. + You can explicitly request that dgit do just this fixup, by running dgit quilt-fixup. @@ -292,6 +299,83 @@ If you are a quilt user you need to know that dgit's git trees are directory (which is used by quilt to record which patches are applied). If you want to manipulate the patch stack you probably want to be looking at tools like git-dpm. + +.SS quilt fixup error messages +When dgit's quilt fixup fails, it prints messages like this: + +.EX +dgit: base trees orig=5531f03d8456b702eab6 o+d/p=135338e9cc253cc85f84 +dgit: quilt differences: src: == orig ## gitignores: == orig ## +dgit: quilt differences: HEAD ## o+d/p HEAD ## o+d/p +starting quiltify (multiple patches, linear mode) + +dgit: error: quilt fixup cannot be linear. Stopped at: +dgit: 696c9bd5..84ae8f96: changed debian/patches/test-gitignore +.EE + +.TP +.B orig +is an import of the .orig tarballs dgit found, +with the debian/ directory from your HEAD substituted. +This is a git tree object, not a commit: +you can pass its hash to git-diff but not git-log. + +.TP +.B o+d/p +is another tree object, +which is the same as orig +but with the patches from debian/patches applied. + +.TP +.B HEAD +is of course your own git HEAD. + +.TP +.B quilt differences +shows whether each of the these trees differs from the others +(i) in upstream files excluding .gitignore files; +(ii) in upstream .gitignore files. +.B == +indicates equality; +.B ## +indicates inequality. +.LP +dgit quilt-fixup --quilt=linear walks commits +backwards from your HEAD +trying to construct a linear set of additional patches, +starting at the end. +It hopes to eventually find an ancestor +whose tree is identical to o+d/p in all upstream files. + +In the error message, +696c9bd5..84ae8f96 +is the first commit child-parent edge +which cannot be sensibly be +either ignored, or turned into a patch in debian/patches. +In this example, this is because +it itself changes files in debian/patches, +indicating that something unusual is going on +and that continuing is not safe. +But you might also see other kinds of troublesome commit or edge. + +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 +or +.B single-debian-patch +source formats; see +.BR dpkg-source(1) .) +If you want a pretty linear series, +and this message is unexpected, +it can mean that you have unwittingly committed changes +that are not representable by dpkg-source (such as some mode changes). +Or maybe you just forgot a necessary +.B --quilt= +option. .SH SPLIT VIEW QUILT MODE When working with git branches intended for use with the `3.0 (quilt)' source format -- cgit v1.2.3 From b01038ad6e0ae3d7deaeb48337b0e00f48741001 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Jun 2018 14:00:46 +0100 Subject: changelog: finalise 5.3 Signed-off-by: Ian Jackson --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ccb0d2b..e45babe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -dgit (5.3~) unstable; urgency=medium +dgit (5.3) unstable; urgency=medium Bugfixes: * dgit: Do not introduce duplicate origs in .changes files, @@ -14,7 +14,7 @@ dgit (5.3~) unstable; urgency=medium and add cross-references to dgit(1) and the actual error. Somewhat apropos of #842614. - -- + -- Ian Jackson Wed, 27 Jun 2018 14:00:31 +0100 dgit (5.2) unstable; urgency=medium -- cgit v1.2.3 From 958aaecf4ccebf1713d7981cde2aab0807fc1511 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Jun 2018 14:03:26 +0100 Subject: changelog: start 5.4 Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index e45babe..1a45db4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.4~) unstable; urgency=medium + + * + + -- + dgit (5.3) unstable; urgency=medium Bugfixes: -- cgit v1.2.3 From b90682a618eb7aa2405517759c2d978c8b89c4f9 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Jun 2018 14:09:28 +0100 Subject: changelog: Fix bug ref to #865444 in previous changelog entry. Signed-off-by: Ian Jackson --- debian/changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1a45db4..4d05abe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ dgit (5.4~) unstable; urgency=medium - * + Bugfixes: + * Fix bug ref to #865444 in previous changelog entry. -- @@ -18,7 +19,7 @@ dgit (5.3) unstable; urgency=medium and a note about first dgit push in dgit(1). Closes:891031. * dgit(7): Add discussion of quilt fixup error messages, and add cross-references to dgit(1) and the actual error. - Somewhat apropos of #842614. + Somewhat apropos of #865444. -- Ian Jackson Wed, 27 Jun 2018 14:00:31 +0100 -- cgit v1.2.3 From 99b7b3246b32cde43dca421571c06f42e00c1baf Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Jun 2018 18:22:35 +0100 Subject: dgit(1): Better description of --overwrite. In particular, be clear that --overwrite (without previous-version) is quite a weak promise: that the version you are uploading contains everything in your changelog. It won't overwrite willy-nilly. Somewhat apropos of discussion in #902534. Signed-off-by: Ian Jackson --- debian/changelog | 4 ++++ dgit.1 | 22 +++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4d05abe..ad5e0fe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,9 @@ dgit (5.4~) unstable; urgency=medium + Improvements: + * dgit(1): Better description of --overwrite. Somewhat + apropos of discussion in #902534. + Bugfixes: * Fix bug ref to #865444 in previous changelog entry. diff --git a/dgit.1 b/dgit.1 index f15fecf..cbf0cde 100644 --- a/dgit.1 +++ b/dgit.1 @@ -514,11 +514,15 @@ 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 .BR --overwrite [=\fIprevious-version\fR] -Declare that even though your git branch may not be a descendant +Declare that your HEAD really does contain +all the (wanted) changes +from all versions listed in its changelog; +or, all (wanted) changes from +.IR previous-version . +This promise is needed when +your git branch is not a descendant of the version in the archive -according to the revision history, -it really does contain -all the (wanted) changes from that version. +according to the git revision history. This option is useful if you are the maintainer, and you have incorporated NMU changes into your own git workflow in a way that @@ -530,15 +534,19 @@ to a particular suite. See .BR dgit-maint- \fI*\fR (7) . -.I previous-version -ought to be the version currently in the archive. If +If .I previous-version is not specified, dgit will check that the version in the archive is mentioned in your debian/changelog. (This will avoid losing -changes unless someone committed to git a finalised changelog +changes, even with +.BR --overwrite , +unless someone committed to git a finalised changelog entry, and then made later changes to that version.) +If +.IR previous-version +is specified, it ought to be the version currently in the archive. dgit push --overwrite will, if necessary, make a -- cgit v1.2.3 From 3fbce7431379321c745f304c0f0134ae9b066701 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Jun 2018 21:41:38 +0100 Subject: test suite: gdr-viagit, gdr-newupstream: do not auto-import t-setup-gnupg. We provide a new mechanism for individual tests to disable the automatic t-setup-import of gnupg. We need to add this to all the other setup/ that these import, too. gdr-convert-gbp is particularly awkward because it wants gnupg if $ifarchive isn't `:'. There we arrange to suppress its automatic inclusion, but add it again by hand if appropriate. This fixes these two tests in chroots without gnupg. Closes:#902559. Signed-off-by: Ian Jackson --- debian/changelog | 2 ++ tests/lib | 12 ++++++++---- tests/setup/gdr-convert-gbp | 3 +++ tests/setup/gdr-convert-gbp-noarchive | 1 + tests/tests/gdr-newupstream | 1 + tests/tests/gdr-viagit | 1 + 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index ad5e0fe..d166e85 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ dgit (5.4~) unstable; urgency=medium apropos of discussion in #902534. Bugfixes: + * test suite: gdr-viagit, gdr-newupstream: Do not spuriously + fail if gnupg not serendipitously installed. Closes:#902559. * Fix bug ref to #865444 in previous changelog entry. -- diff --git a/tests/lib b/tests/lib index bd06d20..f3fb0da 100644 --- a/tests/lib +++ b/tests/lib @@ -1134,7 +1134,11 @@ t-alt-test () { t-git-config dgit.default.old-dsc-distro test-dummy -case "$0" in -*/gnupg) ;; -*) t-setup-import gnupg ;; -esac +for import in ${autoimport-gnupg}; do + case "$0" in + */$import) ;; + *) + t-setup-import $import + ;; + esac +done diff --git a/tests/setup/gdr-convert-gbp b/tests/setup/gdr-convert-gbp index 0b525c8..e523fd3 100755 --- a/tests/setup/gdr-convert-gbp +++ b/tests/setup/gdr-convert-gbp @@ -1,8 +1,11 @@ #!/bin/bash set -e +autoimport= . tests/lib . $troot/lib-gdr +$ifarchive t-setup-import gnupg + t-dependencies GDR t-tstunt-parsechangelog diff --git a/tests/setup/gdr-convert-gbp-noarchive b/tests/setup/gdr-convert-gbp-noarchive index dfeea3b..1d6758b 100755 --- a/tests/setup/gdr-convert-gbp-noarchive +++ b/tests/setup/gdr-convert-gbp-noarchive @@ -1,4 +1,5 @@ #!/bin/bash +autoimport= set -e . tests/lib . $troot/lib-gdr diff --git a/tests/tests/gdr-newupstream b/tests/tests/gdr-newupstream index cfa0052..ee987f5 100755 --- a/tests/tests/gdr-newupstream +++ b/tests/tests/gdr-newupstream @@ -1,5 +1,6 @@ #!/bin/bash set -e +autoimport= . tests/lib t-dependencies NO-DGIT GDR diff --git a/tests/tests/gdr-viagit b/tests/tests/gdr-viagit index 644d2d4..a83e622 100755 --- a/tests/tests/gdr-viagit +++ b/tests/tests/gdr-viagit @@ -1,5 +1,6 @@ #!/bin/bash set -e +autoimport= . tests/lib t-dependencies NO-DGIT GDR -- cgit v1.2.3 From d4ca9e4a8ac7a09ef53171693e86058f3d913d5f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Jun 2018 23:11:36 +0100 Subject: No-change upload, for testing. Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index e45babe..82c67d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.3+exp1) experimental; urgency=low + + * No-change upload, for testing. + + -- Ian Jackson Wed, 27 Jun 2018 23:11:30 +0100 + dgit (5.3) unstable; urgency=medium Bugfixes: -- cgit v1.2.3 From fd95abf1edeb48dcaab582b0158858f095ef9083 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Jun 2018 23:13:58 +0100 Subject: changelog: finalise 5.4 Signed-off-by: Ian Jackson --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d166e85..80fc035 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -dgit (5.4~) unstable; urgency=medium +dgit (5.4) unstable; urgency=medium Improvements: * dgit(1): Better description of --overwrite. Somewhat @@ -9,7 +9,7 @@ dgit (5.4~) unstable; urgency=medium fail if gnupg not serendipitously installed. Closes:#902559. * Fix bug ref to #865444 in previous changelog entry. - -- + -- Ian Jackson Wed, 27 Jun 2018 23:13:42 +0100 dgit (5.3) unstable; urgency=medium -- cgit v1.2.3 From 3ba94c7664e86e773d2feca4f9fc06b4e1791b19 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 28 Jun 2018 00:08:03 +0100 Subject: changelog: start 5.5 Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 80fc035..0db169d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.5~) unstable; urgency=medium + + * + + -- + dgit (5.4) unstable; urgency=medium Improvements: -- cgit v1.2.3 From b0b5273947e6927b90e64e90c378865d86321753 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 28 Jun 2018 00:45:01 +0100 Subject: No-change upload, for testing. Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 80fc035..0e4194e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.4+exp1) experimental; urgency=medium + + * No-change upload, for testing. + + -- Ian Jackson Thu, 28 Jun 2018 00:44:52 +0100 + dgit (5.4) unstable; urgency=medium Improvements: -- cgit v1.2.3 From ea47496f7dd4feac94f2a3a7f51fe1e07e012ee4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Jun 2018 23:44:15 +0100 Subject: New gnupg agent thing before (5.3) 1044.27user 126.77system 6:26.89elapsed 302%CPU (0avgtext+0avgdata 402420maxresident)k 1778718inputs+5123720outputs (2370major+57693524minor)pagefaults 0swaps after (5.3 + these changes) 1072.81user 131.38system 6:25.02elapsed 312%CPU (0avgtext+0avgdata 402448maxresident)k 1777558inputs+5124952outputs (2370major+59176578minor)pagefaults 0swaps Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ tests/tstunt/gpg | 2 +- tests/tstunt/gpg-withagent | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100755 tests/tstunt/gpg-withagent diff --git a/debian/changelog b/debian/changelog index 0e4194e..fc26e97 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.4+exp2) experimental; urgency=medium + + * test suite: Explicit agent starting/stopping + + -- Ian Jackson Thu, 28 Jun 2018 00:42:00 +0100 + dgit (5.4+exp1) experimental; urgency=medium * No-change upload, for testing. diff --git a/tests/tstunt/gpg b/tests/tstunt/gpg index 679a6b8..74152bd 100755 --- a/tests/tstunt/gpg +++ b/tests/tstunt/gpg @@ -3,4 +3,4 @@ set -e exec \ with-lock-ex -w "$DGIT_TEST_GNUPG_GLOBAL_LOCK" \ - $tmp "$DGIT_TEST_TROOT"/tstunt/gpg-locked "$@" + $tmp "$DGIT_TEST_TROOT"/tstunt/gpg-withagent "$@" diff --git a/tests/tstunt/gpg-withagent b/tests/tstunt/gpg-withagent new file mode 100755 index 0000000..4cb5d4e --- /dev/null +++ b/tests/tstunt/gpg-withagent @@ -0,0 +1,51 @@ +#!/bin/sh +set -ex + +retry_until_ok () { + sleeptime=0 + while ! "$@"; do + case $sleeptime in + ??.*) + echo >&2 "$0: GPG AGENT STARTP $@ TIMED OUT" + exit 127 + ;; + esac + sleep $sleeptime + sleeptime=$(echo "($sleeptime + 0.001) * 2" | bc -l) + done +} + +echo >&2 'GPG-WITHAGENT...' + +agent_is_running () { + gpg-connect-agent --no-autostart &1 \ + | grep dgit-gpg-agent-ok >&2 +} + + +$DGIT_STUNT_AGENT --daemon &2 +retry_until_ok agent_is_running + +echo >&2 'GPG-WITHAGENT... RUNNING' + +set +e +$DGIT_TEST_REAL_GPG \ + --agent-program=$DGIT_STUNT_AGENT "$@" +rc=$? +set -e + +echo >&2 'GPG-WITHAGENT... STOPPING' + +kill_agent_not_running () { + LC_MESSAGES=C gpg-connect-agent --no-autostart &1 \ + | tee -a /dev/stderr \ + | grep 'no gpg-agent running' >&2 +} + +retry_until_ok kill_agent_not_running + +echo >&2 'GPG-WITHAGENT... DONE' + +exit $rc -- cgit v1.2.3 From 152c206f3c7b6ebe85b4941d89d7bb8417d031b8 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 28 Jun 2018 13:19:27 +0100 Subject: debian/control: Add missing comma Closes:#902578. Signed-off-by: Ian Jackson --- debian/changelog | 4 ++-- debian/control | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0db169d..8ee196c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ dgit (5.5~) unstable; urgency=medium - * + * Add missing comma in debian/control. Closes:#902578. - -- + -- Ian Jackson Thu, 28 Jun 2018 13:18:56 +0100 dgit (5.4) unstable; urgency=medium diff --git a/debian/control b/debian/control index 42f68f6..3fca347 100644 --- a/debian/control +++ b/debian/control @@ -27,7 +27,7 @@ Description: git interoperability with the Debian archive dgit clone and dgit fetch construct git commits from uploads. Package: git-debrebase -Depends: perl, git-core, libdpkg-perl, libfile-fnmatch-perl +Depends: perl, git-core, libdpkg-perl, libfile-fnmatch-perl, ${misc:Depends} Recommends: dgit, git-buildpackage Architecture: all -- cgit v1.2.3 From 04e553f13c747046ebae50c1920185f4c3ae8e2b Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 28 Jun 2018 13:20:11 +0100 Subject: dgit(1): Fix a wrong reference to \fp, which should be \fP. Signed-off-by: Ian Jackson --- debian/changelog | 1 + dgit.1 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 8ee196c..06265b7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ dgit (5.5~) unstable; urgency=medium * Add missing comma in debian/control. Closes:#902578. + * dgit(1): Fix a wrong reference to \fp, which should be \fP. -- Ian Jackson Thu, 28 Jun 2018 13:18:56 +0100 diff --git a/dgit.1 b/dgit.1 index cbf0cde..ae08416 100644 --- a/dgit.1 +++ b/dgit.1 @@ -14,7 +14,7 @@ dgit \- git integration with the Debian archive .br .B dgit [\fIdgit\-opts\fP] \fBbuild\fP|\fBsbuild\fP|\fBbuild-source\fP -[\fIbuild\-opts\fp] +[\fIbuild\-opts\fP] .br .B dgit [\fIdgit\-opts\fP] \fBpush\fP|\fBpush-source\fP [\fIdgit\-opts\fP] -- cgit v1.2.3 From a76782b4f0c9009a37e62d664b7d9692bd910783 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 28 Jun 2018 13:25:35 +0100 Subject: changelog: finalise 5.5 Signed-off-by: Ian Jackson --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 06265b7..87f86a6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -dgit (5.5~) unstable; urgency=medium +dgit (5.5) unstable; urgency=medium * Add missing comma in debian/control. Closes:#902578. * dgit(1): Fix a wrong reference to \fp, which should be \fP. - -- Ian Jackson Thu, 28 Jun 2018 13:18:56 +0100 + -- Ian Jackson Thu, 28 Jun 2018 13:25:21 +0100 dgit (5.4) unstable; urgency=medium -- cgit v1.2.3 From f8ba14071c7977a0ea2d8f1882202136b7b88dce Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 28 Jun 2018 13:27:06 +0100 Subject: changelog: start 5.6 Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 87f86a6..3b551ec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.6~) unstable; urgency=medium + + * + + -- + dgit (5.5) unstable; urgency=medium * Add missing comma in debian/control. Closes:#902578. -- cgit v1.2.3 From ef3f25de26fbca9c1018dbf2f7364ddb8ea44392 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 28 Jun 2018 16:31:55 +0100 Subject: changelog: 5.5+exp3 to placate version checking Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0f36987..3903f0c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.5+exp3) experimental; urgency=medium + + * Bump changelog entry date. + + -- Ian Jackson Thu, 28 Jun 2018 16:31:35 +0100 + dgit (5.5+exp2) experimental; urgency=medium * test suite: Explicit agent starting/stopping -- cgit v1.2.3 From 641b95390e9ff7fea44a0c4ec4181b10be0b78c1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 29 Jun 2018 00:49:47 +0100 Subject: test suite: Add bc to appropriate test Depends. Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ debian/tests/control | 22 +++++++++++----------- tests/enumerate-tests | 2 +- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3903f0c..41a6710 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.5+exp4) experimental; urgency=medium + + * test suite: Add bc to appropriate test Depends. + + -- Ian Jackson Fri, 29 Jun 2018 00:46:11 +0100 + dgit (5.5+exp3) experimental; urgency=medium * Bump changelog entry date. diff --git a/debian/tests/control b/debian/tests/control index 8b9d34e..48ed93f 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,24 +1,24 @@ Tests: build-modes-gbp Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, git-buildpackage +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, git-buildpackage Tests: clone-reprepro downstream-gitless Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, reprepro +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, reprepro Tests: dpkgsourceignores-docs Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc Restrictions: x-dgit-intree-only Tests: defdistro-dsd-clone-drs dsd-clone-drs Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc Restrictions: x-dgit-intree-only x-dgit-git-only Tests: gdr-diverge-nmu gdr-diverge-nmu-dgit gdr-edits gdr-import-dgit gdr-makepatches7 gdr-subcommands Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, git-debrebase, git-buildpackage, faketime +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, git-debrebase, git-buildpackage, faketime Tests: gdr-newupstream gdr-viagit Tests-Directory: tests/tests @@ -26,7 +26,7 @@ Depends: chiark-utils-bin, git-debrebase, git-buildpackage, faketime Tests: gitattributes Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bsdgames, man-db, git-man +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, bsdgames, man-db, git-man Tests: hint-testsuite-triggers Tests-Directory: tests/tests @@ -35,24 +35,24 @@ Restrictions: hint-testsuite-triggers Tests: defdistro-mirror mirror mirror-debnewgit mirror-private Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, rsync +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, rsync Tests: build-modes-sbuild quilt-gbp-build-modes-sbuild Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, sbuild +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, sbuild Restrictions: x-dgit-schroot-build Tests: sbuild-gitish Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, sbuild, man-db +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, sbuild, man-db Restrictions: x-dgit-schroot-build Tests: spelling Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc Restrictions: x-dgit-git-only Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-asplit build-modes-gbp-asplit clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version 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 tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc diff --git a/tests/enumerate-tests b/tests/enumerate-tests index 0599b69..0f37c96 100755 --- a/tests/enumerate-tests +++ b/tests/enumerate-tests @@ -42,7 +42,7 @@ finish- () { test-begin-gencontrol () { restrictions='' - dependencies='dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin' + dependencies='dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc' } restriction-gencontrol () { -- cgit v1.2.3 From 7d0d834d7b41b5f3cafffc37b9a9d94966c68e0f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 29 Jun 2018 12:11:56 +0100 Subject: test suite: gpg-agent workaround: Add more debugging output. Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ tests/tstunt/gpg-withagent | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/debian/changelog b/debian/changelog index 41a6710..7850597 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.5+exp5~) experimental; urgency=medium + + * test suite: gpg-agent workaround: Add more debugging output. + + -- + dgit (5.5+exp4) experimental; urgency=medium * test suite: Add bc to appropriate test Depends. diff --git a/tests/tstunt/gpg-withagent b/tests/tstunt/gpg-withagent index 4cb5d4e..d7fe793 100755 --- a/tests/tstunt/gpg-withagent +++ b/tests/tstunt/gpg-withagent @@ -1,9 +1,18 @@ #!/bin/sh set -ex +d () { + date --iso-8601=ns >&2 + ps -ef | grep gpg-agent >&2 +} + +d + retry_until_ok () { sleeptime=0 + d while ! "$@"; do + d case $sleeptime in ??.*) echo >&2 "$0: GPG AGENT STARTP $@ TIMED OUT" @@ -29,12 +38,16 @@ retry_until_ok agent_is_running echo >&2 'GPG-WITHAGENT... RUNNING' +d + set +e $DGIT_TEST_REAL_GPG \ --agent-program=$DGIT_STUNT_AGENT "$@" rc=$? set -e +d + echo >&2 'GPG-WITHAGENT... STOPPING' kill_agent_not_running () { @@ -48,4 +61,6 @@ retry_until_ok kill_agent_not_running echo >&2 'GPG-WITHAGENT... DONE' +d + exit $rc -- cgit v1.2.3 From 395e13bd154a9d00ffb25cff3f45e3afa8222d13 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 29 Jun 2018 12:13:59 +0100 Subject: test suite: gpg-agent workaround: Kill unexpected leftover agents. Signed-off-by: Ian Jackson --- debian/changelog | 1 + tests/tstunt/gpg-withagent | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7850597..bc809a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ dgit (5.5+exp5~) experimental; urgency=medium * test suite: gpg-agent workaround: Add more debugging output. + * test suite: gpg-agent workaround: Kill unexpected leftover agents. -- diff --git a/tests/tstunt/gpg-withagent b/tests/tstunt/gpg-withagent index d7fe793..4318cce 100755 --- a/tests/tstunt/gpg-withagent +++ b/tests/tstunt/gpg-withagent @@ -24,7 +24,16 @@ retry_until_ok () { done } -echo >&2 'GPG-WITHAGENT...' +kill_agent_not_running () { + LC_MESSAGES=C gpg-connect-agent --no-autostart &1 \ + | tee -a /dev/stderr \ + | grep 'no gpg-agent running' >&2 +} + +echo >&2 'GPG-WITHAGENT... PRE-STOPPING' + +retry_until_ok kill_agent_not_running agent_is_running () { gpg-connect-agent --no-autostart &2 'GPG-WITHAGENT... STOPPING' -kill_agent_not_running () { - LC_MESSAGES=C gpg-connect-agent --no-autostart &1 \ - | tee -a /dev/stderr \ - | grep 'no gpg-agent running' >&2 -} - retry_until_ok kill_agent_not_running echo >&2 'GPG-WITHAGENT... DONE' -- cgit v1.2.3 From 96f0ac573b0c0672dbeae9ab3d3ace947c7def28 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 29 Jun 2018 12:22:36 +0100 Subject: changelog: finalise 5.5+exp5 Signed-off-by: Ian Jackson --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index bc809a7..a0fea92 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -dgit (5.5+exp5~) experimental; urgency=medium +dgit (5.5+exp5) experimental; urgency=medium * test suite: gpg-agent workaround: Add more debugging output. * test suite: gpg-agent workaround: Kill unexpected leftover agents. - -- + -- Ian Jackson Fri, 29 Jun 2018 12:22:23 +0100 dgit (5.5+exp4) experimental; urgency=medium -- cgit v1.2.3 From 3ae4d20d8146c3ea111b3f622bf00adbd4e6442f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 29 Jun 2018 13:02:36 +0100 Subject: test suite: gpg-agent workaround: Cope if ps not found. Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ tests/tstunt/gpg-withagent | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a0fea92..8076ac0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.5+exp6) experimental; urgency=medium + + * test suite: gpg-agent workaround: Cope if ps not found. + + -- Ian Jackson Fri, 29 Jun 2018 13:02:30 +0100 + dgit (5.5+exp5) experimental; urgency=medium * test suite: gpg-agent workaround: Add more debugging output. diff --git a/tests/tstunt/gpg-withagent b/tests/tstunt/gpg-withagent index 4318cce..3f56d08 100755 --- a/tests/tstunt/gpg-withagent +++ b/tests/tstunt/gpg-withagent @@ -3,7 +3,7 @@ set -ex d () { date --iso-8601=ns >&2 - ps -ef | grep gpg-agent >&2 + ps -ef | grep gpg-agent ||: >&2 } d -- cgit v1.2.3 From 0a9d7c678c2ef3a3dbe40c012f3a1b86a8ca3c2a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 29 Jun 2018 17:05:06 +0100 Subject: test suite: gpg-agent workaround: Send ps output to stderr (oops) Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ tests/tstunt/gpg-withagent | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 8076ac0..3611845 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.5+exp7) experimental; urgency=medium + + * test suite: gpg-agent workaround: Send ps output to stderr (oops) + + -- Ian Jackson Fri, 29 Jun 2018 17:03:09 +0100 + dgit (5.5+exp6) experimental; urgency=medium * test suite: gpg-agent workaround: Cope if ps not found. diff --git a/tests/tstunt/gpg-withagent b/tests/tstunt/gpg-withagent index 3f56d08..4b2ee1a 100755 --- a/tests/tstunt/gpg-withagent +++ b/tests/tstunt/gpg-withagent @@ -3,7 +3,7 @@ set -ex d () { date --iso-8601=ns >&2 - ps -ef | grep gpg-agent ||: >&2 + ps -ef | grep gpg-agent >&2 ||: } d -- cgit v1.2.3 From 53cdf2a1ad851c4747711877d304c647eaf83f41 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 30 Jun 2018 09:55:26 +0100 Subject: test suite: gnupg workaround: Remove a sprurious $tmp This is not set here, which is just as well because it would have been quite wrong. Signed-off-by: Ian Jackson --- tests/tstunt/gpg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tstunt/gpg b/tests/tstunt/gpg index 74152bd..79d8319 100755 --- a/tests/tstunt/gpg +++ b/tests/tstunt/gpg @@ -3,4 +3,4 @@ set -e exec \ with-lock-ex -w "$DGIT_TEST_GNUPG_GLOBAL_LOCK" \ - $tmp "$DGIT_TEST_TROOT"/tstunt/gpg-withagent "$@" + "$DGIT_TEST_TROOT"/tstunt/gpg-withagent "$@" -- cgit v1.2.3 From 38eae0db7f393311667bec9dfe0aa7a514b893bd Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 30 Jun 2018 10:20:57 +0100 Subject: test suite: Provide DGIT_TEST_BYHAND if appropriate Signed-off-by: Ian Jackson --- tests/lib | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/lib b/tests/lib index f3fb0da..bad47c9 100644 --- a/tests/lib +++ b/tests/lib @@ -41,6 +41,7 @@ export DGIT_TEST_TROOT=$troot tmp=$ADTTMP if [ x"$tmp" = x ]; then + export DGIT_TEST_BYHAND=1 mkdir -p tests/tmp tmpbase=$troot/tmp tmp=tests/tmp/$testname -- cgit v1.2.3 From 690272dfb77eefa9277970dafe4bbb47de3b35e1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 30 Jun 2018 10:21:32 +0100 Subject: test suite: gpg agent workaround: Neaten the logging. Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ tests/setup/gnupg | 6 ++++-- tests/tstunt/gpg | 14 ++++++++++++++ tests/tstunt/gpg-withagent | 2 +- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3611845..3f363e4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.5+exp8) experimental; urgency=medium + + * test suite: gpg agent workaround: Neaten the logging. + + -- Ian Jackson Sat, 30 Jun 2018 10:54:48 +0100 + dgit (5.5+exp7) experimental; urgency=medium * test suite: gpg-agent workaround: Send ps output to stderr (oops) diff --git a/tests/setup/gnupg b/tests/setup/gnupg index c88d40b..7a164ef 100755 --- a/tests/setup/gnupg +++ b/tests/setup/gnupg @@ -7,10 +7,11 @@ cp $troot/gnupg/* $tmp/gnupg chmod go-rw $tmp/gnupg/* export DGIT_TEST_GNUPG_GLOBAL_LOCK=$tmp/gnupg/dgit-test-global-lock +export DGIT_TEST_GNUPG_LOG=$tmp/gnupg-workarounds.log setup=' export GNUPGHOME=$tmp/gnupg - export DGIT_TEST_GNUPG_GLOBAL_LOCK + export DGIT_TEST_GNUPG_GLOBAL_LOCK DGIT_TEST_GNUPG_LOG cat >$tmp/gnupg/gpg-agent.conf <&2 2>>"$DGIT_TEST_GNUPG_LOG" + rc=$? + if [ rc = 0 ]; then exit 0; fi + if [ "x$DGIT_TEST_BYHAND" != x ]; then + echo >&2 "BYHAND, not catting $DGIT_TEST_GNUPG_LOG" + else + echo >&2 "########################################" + echo >&2 "$DGIT_TEST_GNUPG_LOG" + cat >&2 "$DGIT_TEST_GNUPG_LOG" + echo >&2 "end of $DGIT_TEST_GNUPG_LOG" + fi + exit $rc + ' x \ "$DGIT_TEST_TROOT"/tstunt/gpg-withagent "$@" diff --git a/tests/tstunt/gpg-withagent b/tests/tstunt/gpg-withagent index 4b2ee1a..b7b8bfd 100755 --- a/tests/tstunt/gpg-withagent +++ b/tests/tstunt/gpg-withagent @@ -51,7 +51,7 @@ d set +e $DGIT_TEST_REAL_GPG \ - --agent-program=$DGIT_STUNT_AGENT "$@" + --agent-program=$DGIT_STUNT_AGENT "$@" 2>&9 rc=$? set -e -- cgit v1.2.3 From 8916ea3e2ca88820e6ad1d0c8823a37221f8ed88 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 30 Jun 2018 19:03:10 +0100 Subject: test suite: gpg agent workaround: Fix bugs in log neatening. Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ tests/tstunt/gpg | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3f363e4..852adc7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.5+exp9) experimental; urgency=medium + + * test suite: gpg agent workaround: Fix bugs in log neatening. + + -- Ian Jackson Sat, 30 Jun 2018 19:03:00 +0100 + dgit (5.5+exp8) experimental; urgency=medium * test suite: gpg agent workaround: Neaten the logging. diff --git a/tests/tstunt/gpg b/tests/tstunt/gpg index 7e12846..4214b4a 100755 --- a/tests/tstunt/gpg +++ b/tests/tstunt/gpg @@ -6,14 +6,16 @@ with-lock-ex -w "$DGIT_TEST_GNUPG_GLOBAL_LOCK" \ sh -c ' "$@" 9>&2 2>>"$DGIT_TEST_GNUPG_LOG" rc=$? - if [ rc = 0 ]; then exit 0; fi + if [ $rc = 0 ]; then exit 0; fi if [ "x$DGIT_TEST_BYHAND" != x ]; then - echo >&2 "BYHAND, not catting $DGIT_TEST_GNUPG_LOG" + echo >&2 "BYHAND, not dumping $DGIT_TEST_GNUPG_LOG" else echo >&2 "########################################" echo >&2 "$DGIT_TEST_GNUPG_LOG" - cat >&2 "$DGIT_TEST_GNUPG_LOG" + sed '\''s/^/\[gnupg-workarounds] /'\'' >&2 \ + "$DGIT_TEST_GNUPG_LOG" echo >&2 "end of $DGIT_TEST_GNUPG_LOG" + echo >&2 "########################################" fi exit $rc ' x \ -- cgit v1.2.3 From 1066c6442bc1471d440ac86711250d825b5ddc2c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 28 Jun 2018 15:31:56 +0100 Subject: test suite: manpages-format: New test Test that manpages format with only expected roff warnings. Signed-off-by: Ian Jackson --- Makefile | 3 +++ debian/changelog | 2 ++ debian/tests/control | 4 +++ tests/lib-core | 2 ++ tests/tests/manpages-format | 61 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 72 insertions(+) create mode 100755 tests/tests/manpages-format diff --git a/Makefile b/Makefile index de28f4d..605b580 100644 --- a/Makefile +++ b/Makefile @@ -119,6 +119,9 @@ installdirs-infra: $(INSTALL_DIR) $(DESTDIR)$(bindir) $(DESTDIR)$(infraexamplesdir) \ $(addprefix $(DESTDIR)$(perldir)/, $(dir $(INFRA_PERLMODULES))) +list-manpages: + @echo $(MANPAGES) + check installcheck: clean distclean mostlyclean maintainer-clean: diff --git a/debian/changelog b/debian/changelog index 9228720..96a9e62 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ dgit (5.6~) unstable; urgency=medium * Merge the experimental branch containing the fianl version of the test suite gnupg workarounds. + * test suite: Test that manpages format with only expected warnings. + -- dgit (5.5+exp9) experimental; urgency=medium diff --git a/debian/tests/control b/debian/tests/control index 48ed93f..7f5964b 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -33,6 +33,10 @@ Tests-Directory: tests/tests Depends: gnupg, patch, diffutils Restrictions: hint-testsuite-triggers +Tests: manpages-format +Tests-Directory: tests/tests +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, man-db, make, groff, git-debrebase + Tests: defdistro-mirror mirror mirror-debnewgit mirror-private Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, rsync diff --git a/tests/lib-core b/tests/lib-core index c3a04cb..e2b6c06 100644 --- a/tests/lib-core +++ b/tests/lib-core @@ -13,8 +13,10 @@ t-set-intree () { : ${DGIT_SSH_DISPATCH_TEST:=$DGIT_TEST_INTREE/infra/dgit-ssh-dispatch} : ${DGIT_INFRA_PFX:=$DGIT_TEST_INTREE${DGIT_TEST_INTREE:+/infra/}} : ${DGIT_GITDEBREBASE_TEST:=$DGIT_TEST_INTREE/git-debrebase} + : ${DGIT_MANPAGES_SOURCE_DIR:=$DGIT_TEST_INTREE} export DGIT_TEST DGIT_BADCOMMIT_FIXUP export DGIT_REPOS_SERVER_TEST DGIT_SSH_DISPATCH_TEST + export DGIT_MANPAGES_SOURCE_DIR export PERLLIB="$DGIT_TEST_INTREE${PERLLIB:+:}${PERLLIB}" } diff --git a/tests/tests/manpages-format b/tests/tests/manpages-format new file mode 100755 index 0000000..4b9585f --- /dev/null +++ b/tests/tests/manpages-format @@ -0,0 +1,61 @@ +#!/bin/bash +set -e +autoimport= +. tests/lib + +t-dependencies man-db make groff git-debrebase + +cd $root + +printenv |grep MAKE ||: |sort +manpages=$(MAKEFLAGS= MAKELEVEL= make list-manpages) + +export MANWIDTH=80 + +run_man () { + if [ "x${DGIT_MANPAGES_SOURCE_DIR}" = x ]; then + cmd='man "$@" $section $page' + else + make $roff >&2 + cmd='man "$@" -l $roff' + fi + eval "$cmd 2>&1 >/dev/null |tee $errs >&2" +} + +for roff in $manpages; do + >$tmp/$roff.expected +done + +expected () { + cat >$tmp/$1.expected +} + +not_egrep_vxPf () { + # egrep -vxPf does not work, so we reimplement it + perl -ne ' + BEGIN () { + open PATS, shift @ARGV or die $!; + $re = join "|", map { chomp; qr{^(?:$_)$} } ; + } + next if m{$re}; + print STDERR "unexpected: $_"; + $bad = 1; + END { die "unexpected, re= $re\n" if $bad; } + ' "$@" +} + +expected dgit.1 <<'END' +.* # table wider than line width +END + +for roff in $manpages; do + section=${roff##*.} + page=${roff%.*} + + errs=$tmp/$roff.errs + run_man >/dev/null + perl -0777 -i~ -pe 's/\n[ \t]+/ # /' $errs + not_egrep_vxPf $tmp/$roff.expected $errs +done + +t-ok -- cgit v1.2.3 From 9f89aa601dc0ca0ea4387ce3cd9e1304770577e3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 28 Jun 2018 15:46:06 +0100 Subject: test suite: manpages-format: Prep for other formats (nfc) Signed-off-by: Ian Jackson --- tests/tests/manpages-format | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/tests/tests/manpages-format b/tests/tests/manpages-format index 4b9585f..79eda75 100755 --- a/tests/tests/manpages-format +++ b/tests/tests/manpages-format @@ -23,11 +23,13 @@ run_man () { } for roff in $manpages; do - >$tmp/$roff.expected + for fmt in txt; do + >$tmp/$roff.$fmt-expected + done done expected () { - cat >$tmp/$1.expected + cat >$tmp/$2.$1-expected } not_egrep_vxPf () { @@ -44,18 +46,27 @@ not_egrep_vxPf () { ' "$@" } -expected dgit.1 <<'END' +expected txt dgit.1 <<'END' .* # table wider than line width END +prep () { + fmt=$1 + errs=$tmp/$roff.$fmt-errs +} + +check () { + perl -0777 -i~ -pe 's/\n[ \t]+/ # /' $errs + not_egrep_vxPf $tmp/$roff.$fmt-expected $errs +} + for roff in $manpages; do section=${roff##*.} page=${roff%.*} - errs=$tmp/$roff.errs + prep txt run_man >/dev/null - perl -0777 -i~ -pe 's/\n[ \t]+/ # /' $errs - not_egrep_vxPf $tmp/$roff.expected $errs + check done t-ok -- cgit v1.2.3 From 50bfd6bbefcfad5b5bc35a70085bc892a7f9e78d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 28 Jun 2018 15:52:42 +0100 Subject: test suite: manpages-format: Remove some pointless redirects Signed-off-by: Ian Jackson --- tests/tests/manpages-format | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tests/manpages-format b/tests/tests/manpages-format index 79eda75..c905445 100755 --- a/tests/tests/manpages-format +++ b/tests/tests/manpages-format @@ -19,7 +19,7 @@ run_man () { make $roff >&2 cmd='man "$@" -l $roff' fi - eval "$cmd 2>&1 >/dev/null |tee $errs >&2" + eval "$cmd 2>&1 >/dev/null |tee $errs" } for roff in $manpages; do @@ -65,7 +65,7 @@ for roff in $manpages; do page=${roff%.*} prep txt - run_man >/dev/null + run_man check done -- cgit v1.2.3 From 0e41808f2b25117c153c55d3913d85ce21b735fd Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 28 Jun 2018 15:53:28 +0100 Subject: test suite: manpages-format: work properly when no expected warnings Signed-off-by: Ian Jackson --- tests/tests/manpages-format | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/tests/manpages-format b/tests/tests/manpages-format index c905445..79efb87 100755 --- a/tests/tests/manpages-format +++ b/tests/tests/manpages-format @@ -37,12 +37,14 @@ not_egrep_vxPf () { perl -ne ' BEGIN () { open PATS, shift @ARGV or die $!; - $re = join "|", map { chomp; qr{^(?:$_)$} } ; + $re = join "|", map { chomp; qr{^(?:$_)$} } + qr{^(?=a)b}, ; + print STDERR "RE $re\n"; } next if m{$re}; print STDERR "unexpected: $_"; $bad = 1; - END { die "unexpected, re= $re\n" if $bad; } + END { die "unexpected errors\n" if $bad; } ' "$@" } -- cgit v1.2.3 From 6af86bd0c71d0d3dfa84ef03ff121939d804dbde Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 28 Jun 2018 15:53:42 +0100 Subject: test suite: manpages-format: Test -Tps too Signed-off-by: Ian Jackson --- tests/tests/manpages-format | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/tests/manpages-format b/tests/tests/manpages-format index 79efb87..3f3362b 100755 --- a/tests/tests/manpages-format +++ b/tests/tests/manpages-format @@ -23,7 +23,7 @@ run_man () { } for roff in $manpages; do - for fmt in txt; do + for fmt in txt ps; do >$tmp/$roff.$fmt-expected done done @@ -69,6 +69,10 @@ for roff in $manpages; do prep txt run_man check + + prep ps + run_man -Tps + check done t-ok -- cgit v1.2.3 From 055b375542a2f1c00ca46e76ae9a8e6bf6372ebc Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 30 Jun 2018 23:58:56 +0100 Subject: changelog: Document empirical effectiveness of new gnupg workaround Signed-off-by: Ian Jackson --- debian/changelog | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 96a9e62..c2a4123 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,12 @@ dgit (5.6~) unstable; urgency=medium * Merge the experimental branch containing the fianl - version of the test suite gnupg workarounds. + version of the test suite gnupg workarounds. Empirically, + - The tests now pass (most of the time, at least) in + current Debian unstable, whereas 5.5's fail utterly. + - There is still occasional lossage. So when running tests + in a loop (eg to test ever commit), it is still good to set + DGIT_TEST_RETRY_COUNT=3 (say). * test suite: Test that manpages format with only expected warnings. -- cgit v1.2.3 From f256f9e8d8b1aea49014939dc37c0bb48f261d17 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 1 Jul 2018 00:41:46 +0100 Subject: changelog: finalise 5.6 Signed-off-by: Ian Jackson --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c2a4123..49e6295 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -dgit (5.6~) unstable; urgency=medium +dgit (5.6) unstable; urgency=medium * Merge the experimental branch containing the fianl version of the test suite gnupg workarounds. Empirically, @@ -10,7 +10,7 @@ dgit (5.6~) unstable; urgency=medium * test suite: Test that manpages format with only expected warnings. - -- + -- Ian Jackson Sun, 01 Jul 2018 00:41:20 +0100 dgit (5.5+exp9) experimental; urgency=medium -- cgit v1.2.3 From ca4b7ad26599791024a2b7212cdf0d0f77feb344 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 1 Jul 2018 00:43:27 +0100 Subject: changelog: start 5.7 Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 49e6295..5174822 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.7~) unstable; urgency=medium + + * + + -- + dgit (5.6) unstable; urgency=medium * Merge the experimental branch containing the fianl -- cgit v1.2.3 From 96a93d8f6efbf26925d3644f10520e9320066b16 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 1 Jul 2018 12:18:22 +0100 Subject: dgit: Break out package_from_d_control (nfc) Signed-off-by: Ian Jackson --- dgit | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dgit b/dgit index bfc168c..db12d22 100755 --- a/dgit +++ b/dgit @@ -4597,11 +4597,15 @@ sub branchsuite () { } } -sub fetchpullargs () { +sub package_from_d_control () { if (!defined $package) { my $sourcep = parsecontrol('debian/control','debian/control'); $package = getfield $sourcep, 'Source'; } +} + +sub fetchpullargs () { + package_from_d_control(); if (@ARGV==0) { $isuite = branchsuite(); if (!$isuite) { -- cgit v1.2.3 From d561b2284c6e988d70794c9871d44c3bb5f0463f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 1 Jul 2018 12:20:50 +0100 Subject: dgit: update-vcs-git: Honour --package properly. Specifically, use package_from_d_control rather than open-coding a substandard implementation. The consequent abolition of $sourcep does mean that if the user specifies the suite `.', and does not specify -p, we needlessly parse debian/control twice. This doesn't really matter. Signed-off-by: Ian Jackson --- debian/changelog | 3 ++- dgit | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5174822..a45d633 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ dgit (5.7~) unstable; urgency=medium - * + Bugfixes: + * dgit update-vcs-git: Honour --package properly. -- diff --git a/dgit b/dgit index db12d22..404eab9 100755 --- a/dgit +++ b/dgit @@ -4658,11 +4658,10 @@ sub cmd_update_vcs_git () { } } - my $sourcep = parsecontrol 'debian/control', 'debian/control'; - $package = getfield $sourcep, 'Source'; + package_from_d_control(); my $ctrl; if ($specsuite eq '.') { - $ctrl = $sourcep; + $ctrl = parsecontrol 'debian/control', 'debian/control'; } else { $isuite = $specsuite; get_archive_dsc(); -- cgit v1.2.3 From 441a1663d98b29d735e2d9392a5cfc84d7cf00f0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 1 Jul 2018 12:00:07 +0100 Subject: dgit(1): Document as-yet-unwritten `dgit checkout' Signed-off-by: Ian Jackson --- dgit.1 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dgit.1 b/dgit.1 index ae08416..d5ef930 100644 --- a/dgit.1 +++ b/dgit.1 @@ -109,6 +109,22 @@ branch .BI remotes/dgit/dgit/ suite into the current branch. .TP +\fBdgit checkout\fR \fIsuite\fR +Checks out the local branch +.BR dgit/ \fIsuite\fR. + +If the branch does not exist, +dgit checkout creates it, +and sets it up the same way as dgit clone would. +In that case, if +the archive remote tracking branch does not exist, +dgit checkout will do a dgit fetch first. + +NB: dgit checkout will only do a fetch if it has to. +If you already have the suite branch, +and want to merge your branch with updates from the archive, +use dgit pull. +.TP \fBdgit build\fR ... Runs .B dpkg-buildpackage -- cgit v1.2.3 From feaac744962e6aff55cdda2dbdfe4526ea751141 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 4 Jul 2018 01:12:52 +0100 Subject: dgit: fetch: Rename fetch_one from fetch (nfc) Signed-off-by: Ian Jackson --- dgit | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dgit b/dgit index 404eab9..5802a21 100755 --- a/dgit +++ b/dgit @@ -3557,7 +3557,7 @@ sub fork_for_multisuite ($) { my $csubsuite = multisuite_suite_child($tsuite, \@mergeinputs, sub { @end = (); - fetch(); + fetch_one(); finish 0; }); # xxx collecte the ref here @@ -3715,7 +3715,7 @@ sub clone ($) { clone_finish($dstdir); } -sub fetch () { +sub fetch_one () { canonicalise_suite(); if (check_for_git()) { git_fetch_us(); @@ -3740,7 +3740,7 @@ END sub pull () { my $multi_fetched = fork_for_multisuite(sub { }); - fetch() unless $multi_fetched; # parent + fetch_one() unless $multi_fetched; # parent return if $multi_fetched eq '0'; # child runcmd_ordryrun_local @git, qw(merge -m),"Merge from $csuite [dgit]", lrref(); @@ -4626,7 +4626,7 @@ sub cmd_fetch { fetchpullargs(); my $multi_fetched = fork_for_multisuite(sub { }); finish 0 if $multi_fetched; - fetch(); + fetch_one(); } sub cmd_pull { -- cgit v1.2.3 From d86eda75da28ce5765d16bdc47d2cc88bb82a9fe Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 4 Jul 2018 01:16:19 +0100 Subject: dgit: fetch: Slightly refactor pull() When for_for_multisuite returns '0', meaning we are a child and should do one suite, use finish 0 rather than returning, after doing the fetch. This has no functional change because the one call site is at the end of cmd_pull, after which we finish 0 anyway. Signed-off-by: Ian Jackson --- dgit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dgit b/dgit index 5802a21..7242c78 100755 --- a/dgit +++ b/dgit @@ -3741,7 +3741,7 @@ END sub pull () { my $multi_fetched = fork_for_multisuite(sub { }); fetch_one() unless $multi_fetched; # parent - return if $multi_fetched eq '0'; # child + finish 0 if $multi_fetched eq '0'; # child runcmd_ordryrun_local @git, qw(merge -m),"Merge from $csuite [dgit]", lrref(); printdone "fetched to ".lrref()." and merged into HEAD"; -- cgit v1.2.3 From 8a52fe8f9f3fc66be492c54a19e2ba7890aa0557 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 4 Jul 2018 01:18:25 +0100 Subject: dgit: fetch: Reorganise cmd_fetch This slightly odd construction is actually how the return value from fork_for_multisuite should be handled. It now looks much more like the calling pattern in pull(). No functional change: if $multi_fetched is falseish, we call fetch_one, and then, no matter what, we finish 0. Signed-off-by: Ian Jackson --- dgit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dgit b/dgit index 7242c78..5efcc5b 100755 --- a/dgit +++ b/dgit @@ -4625,8 +4625,8 @@ sub cmd_fetch { parseopts(); fetchpullargs(); my $multi_fetched = fork_for_multisuite(sub { }); - finish 0 if $multi_fetched; - fetch_one(); + fetch_one() unless $multi_fetched; # parent + finish 0 if $multi_fetched eq '0'; # child } sub cmd_pull { -- cgit v1.2.3 From 66d6b40a1474ef84fe0e4a68bd7428f5ab1b0e31 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 4 Jul 2018 01:21:43 +0100 Subject: dgit: fetch: Introduce new dofetch() This actually does all that is needed. It replaces two now-identical calling patterns. Signed-off-by: Ian Jackson --- dgit | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dgit b/dgit index 5efcc5b..c7336dd 100755 --- a/dgit +++ b/dgit @@ -3738,10 +3738,14 @@ END printdone "fetched into ".lrref(); } -sub pull () { +sub dofetch () { my $multi_fetched = fork_for_multisuite(sub { }); fetch_one() unless $multi_fetched; # parent finish 0 if $multi_fetched eq '0'; # child +} + +sub pull () { + dofetch(); runcmd_ordryrun_local @git, qw(merge -m),"Merge from $csuite [dgit]", lrref(); printdone "fetched to ".lrref()." and merged into HEAD"; @@ -4624,9 +4628,7 @@ sub fetchpullargs () { sub cmd_fetch { parseopts(); fetchpullargs(); - my $multi_fetched = fork_for_multisuite(sub { }); - fetch_one() unless $multi_fetched; # parent - finish 0 if $multi_fetched eq '0'; # child + dofetch(); } sub cmd_pull { -- cgit v1.2.3 From d9d77b27a18c939cb1ca280b2f18e15389ec88ff Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 1 Jul 2018 12:41:40 +0100 Subject: dgit: checkout: New command. Closes:#878443. Signed-off-by: Ian Jackson --- debian/changelog | 3 +++ dgit | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/debian/changelog b/debian/changelog index a45d633..62fb2bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,8 @@ dgit (5.7~) unstable; urgency=medium + New feature: + * dgit checkout: new subcommand. Closes:#878443. + Bugfixes: * dgit update-vcs-git: Honour --package properly. diff --git a/dgit b/dgit index c7336dd..ca57375 100755 --- a/dgit +++ b/dgit @@ -4643,6 +4643,40 @@ END pull(); } +sub cmd_checkout { + parseopts(); + package_from_d_control(); + @ARGV==1 or badusage "dgit checkout needs a suite argument"; + ($isuite) = @ARGV; + notpushing(); + + foreach my $canon (qw(0 1)) { + if (!$canon) { + $csuite= $isuite; + } else { + undef $csuite; + canonicalise_suite(); + } + if (length git_get_ref lref()) { + # local branch already exists, yay + last; + } + if (!length git_get_ref lrref()) { + if (!$canon) { + # nope + next; + } + dofetch(); + } + # now lrref exists + runcmd (@git, qw(update-ref), lref(), lrref(), ''); + last; + } + local $ENV{GIT_REFLOG_ACTION} = git_reflog_action_msg + "dgit checkout $isuite"; + runcmd (@git, qw(checkout), lref()); +} + sub cmd_update_vcs_git () { my $specsuite; if (@ARGV==0 || $ARGV[0] =~ m/^-/) { -- cgit v1.2.3 From eb41bc5fcd22bfe48820ef82bc2ce0c0f7131bc1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 4 Jul 2018 01:27:42 +0100 Subject: dgit(1): checkout: Document when this acceses the network Signed-off-by: Ian Jackson --- dgit.1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dgit.1 b/dgit.1 index d5ef930..e7ab454 100644 --- a/dgit.1 +++ b/dgit.1 @@ -124,6 +124,11 @@ NB: dgit checkout will only do a fetch if it has to. If you already have the suite branch, and want to merge your branch with updates from the archive, use dgit pull. + +dgit checkout will normally need to aceess the archive server, +to canonicalise the provided suite name. +The exception is if you specify the canonical name, +and the branch (or tracking branch) already exists. .TP \fBdgit build\fR ... Runs -- cgit v1.2.3 From 950f90c24d818782a88c612cb24845b8086a281f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 4 Jul 2018 01:54:13 +0100 Subject: test suite: checkout: new test Signed-off-by: Ian Jackson --- debian/tests/control | 2 +- tests/tests/checkout | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100755 tests/tests/checkout diff --git a/debian/tests/control b/debian/tests/control index 7f5964b..4a2ac5b 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -56,7 +56,7 @@ Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc Restrictions: x-dgit-git-only -Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-asplit build-modes-gbp-asplit clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version 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 tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt +Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-asplit build-modes-gbp-asplit checkout clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version 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 tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc diff --git a/tests/tests/checkout b/tests/tests/checkout new file mode 100755 index 0000000..4b205f3 --- /dev/null +++ b/tests/tests/checkout @@ -0,0 +1,49 @@ +#!/bin/bash +set -e +. tests/lib +t-tstunt-parsechangelog + +t-setup-import examplegit + +p=example + +mkdir $p.2 +cd $p.2 + +git init +t-dgit setup-new-tree +t-dgit checkout -p $p unstable + +t-refs-same-start +t-ref-head +t-ref-same refs/tags/test-dummy/$v + +t-dgit checkout -p $p stable + +t-dgit checkout -d no-such-distro sid +t-ref-head + +t-dgit checkout stable + +git branch -D dgit/sid +t-dgit checkout -d no-such-distro sid +t-ref-head + +git reflog --pretty=tformat:%gs >../reflog.got +cat >../reflog.expect <../refs.got +cat >../refs.expect < Date: Wed, 4 Jul 2018 02:19:05 +0100 Subject: dgit(7): Mention git-debrebase and gbp pq alongside git-dpm in the comment about handling patch stacks. Signed-off-by: Ian Jackson --- debian/changelog | 2 ++ dgit.7 | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 62fb2bc..dcff9e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ dgit (5.7~) unstable; urgency=medium * dgit checkout: new subcommand. Closes:#878443. Bugfixes: + * dgit(7): Mention git-debrebase and gbp pq alongside git-dpm, + in the comment about handling patch stacks. * dgit update-vcs-git: Honour --package properly. -- diff --git a/dgit.7 b/dgit.7 index 0d43ee0..b623d8c 100644 --- a/dgit.7 +++ b/dgit.7 @@ -298,7 +298,8 @@ If you are a quilt user you need to know that dgit's git trees are `patches applied packaging branches' and do not contain the .pc directory (which is used by quilt to record which patches are applied). If you want to manipulate the patch stack you probably want -to be looking at tools like git-dpm. +to be looking at tools like +git-debrebase, gbp pq, or git-dpm. .SS quilt fixup error messages When dgit's quilt fixup fails, it prints messages like this: -- cgit v1.2.3 From 61f92b326da0efea1cf4d3c263ef0e0b7cacfc25 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 5 Jul 2018 00:15:44 +0100 Subject: test suite: Always pass LC_COLLATE=C to sort(1). Specifically, by replacing every invocation of sort with the new function t-sort. The one case where we already took care of this, we change LC_ALL to LC_COLLATE, which should be sufficient. Closes:#903006. Signed-off-by: Ian Jackson --- debian/changelog | 1 + tests/lib | 2 +- tests/lib-core | 4 ++++ tests/lib-gdr | 2 +- tests/lib-import-chk | 8 ++++---- tests/tartree-edit | 2 +- tests/tests/checkout | 2 +- tests/tests/import-native | 2 +- tests/tests/manpages-format | 2 +- 9 files changed, 15 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index dcff9e6..4912f01 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ dgit (5.7~) unstable; urgency=medium * dgit(7): Mention git-debrebase and gbp pq alongside git-dpm, in the comment about handling patch stacks. * dgit update-vcs-git: Honour --package properly. + * test suite: Always pass LC_COLLATE=C to sort(1). Closes:#903006. -- diff --git a/tests/lib b/tests/lib index bad47c9..4ef275c 100644 --- a/tests/lib +++ b/tests/lib @@ -153,7 +153,7 @@ t-reporefs () { exec >"$outputfile" if test -d $whichrepo; then cd $whichrepo - git show-ref |sort + git show-ref |t-sort fi) } diff --git a/tests/lib-core b/tests/lib-core index e2b6c06..724c8ac 100644 --- a/tests/lib-core +++ b/tests/lib-core @@ -40,3 +40,7 @@ t-filter-out-git-hyphen-dir () { path="${path%:}" PATH="$path" } + +t-sort () { + LC_COLLATE=C sort "$@" +} diff --git a/tests/lib-gdr b/tests/lib-gdr index 7b4f085..22ea6d1 100644 --- a/tests/lib-gdr +++ b/tests/lib-gdr @@ -141,7 +141,7 @@ t-gdr-good () { test $cnparents = $enparents local cndparents=` - for f in $parents; do echo $f; done | sort -u | wc -w + for f in $parents; do echo $f; done | t-sort -u | wc -w ` test $cndparents = $cnparents diff --git a/tests/lib-import-chk b/tests/lib-import-chk index 88984c1..d6633f9 100644 --- a/tests/lib-import-chk +++ b/tests/lib-import-chk @@ -1,11 +1,11 @@ t-import-chk-authorship () { perl -ne 'print $1,"\n" if m/^ -- (\S.*\>) /' debian/changelog \ - | sort -u \ + | t-sort -u \ > $tmp/authorship.changelog ${import_chk_changelog_massage:-:} $tmp/authorship.changelog git log --pretty=format:'%an <%ae>%n%cn <%ce>' \ - | sort -u \ + | t-sort -u \ > $tmp/authorship.commits diff $tmp/authorship.{changelog,commits} } @@ -63,7 +63,7 @@ t-import-chk2() { t-ref-same refs/heads/first-2nd-import for orig in ../${p}_${v%-*}.orig*.tar.*; do - tar -atf $orig | LC_ALL=C sort >../files.o + tar -atf $orig | t-sort >../files.o pfx=$(perl <../files.o -ne ' while (<>) { m#^([^/]+/)# or exit 0; @@ -87,7 +87,7 @@ t-import-chk2() { t-ref-same-val "$orig $start" "$imp" done git ls-tree -r --name-only "$t_ref_val:" \ - | sort >../files.g + | t-sort >../files.g diff ../files.{o,g} done cd .. diff --git a/tests/tartree-edit b/tests/tartree-edit index 40bd6e9..78f0e4f 100755 --- a/tests/tartree-edit +++ b/tests/tartree-edit @@ -17,7 +17,7 @@ gitfetchdiff_list () { git for-each-ref --format '%(refname) %(objectname)' \ refs/remotes/"$1" \ | sed 's/^refs\/remotes\/[^\/]*\///' \ - | sort >"$play/$2" + | t-sort >"$play/$2" } gitfetchdiff () { diff --git a/tests/tests/checkout b/tests/tests/checkout index 4b205f3..bc3d6ef 100755 --- a/tests/tests/checkout +++ b/tests/tests/checkout @@ -39,7 +39,7 @@ dgit checkout unstable END diff -u ../reflog.{expect,got} -git for-each-ref --format='%(refname)' refs/heads | sort >../refs.got +git for-each-ref --format='%(refname)' refs/heads | t-sort >../refs.got cat >../refs.expect < Date: Thu, 5 Jul 2018 00:56:04 +0100 Subject: dgit: checkout: Do not leave detached HEAD! Signed-off-by: Ian Jackson --- dgit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dgit b/dgit index ca57375..00da67d 100755 --- a/dgit +++ b/dgit @@ -4674,7 +4674,7 @@ sub cmd_checkout { } local $ENV{GIT_REFLOG_ACTION} = git_reflog_action_msg "dgit checkout $isuite"; - runcmd (@git, qw(checkout), lref()); + runcmd (@git, qw(checkout), lbranch()); } sub cmd_update_vcs_git () { -- cgit v1.2.3 From 244a7da76c07975d807da32de824ab3e3ee55478 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 5 Jul 2018 00:56:36 +0100 Subject: test suite: checkout: Check we end up on the right branch each time Signed-off-by: Ian Jackson --- tests/tests/checkout | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/tests/checkout b/tests/tests/checkout index bc3d6ef..756c49b 100755 --- a/tests/tests/checkout +++ b/tests/tests/checkout @@ -5,6 +5,11 @@ t-tstunt-parsechangelog t-setup-import examplegit +now-on () { + local branch=$(git symbolic-ref HEAD) + test "$branch" = "refs/heads/$1" +} + p=example mkdir $p.2 @@ -14,20 +19,25 @@ git init t-dgit setup-new-tree t-dgit checkout -p $p unstable +now-on dgit/sid t-refs-same-start t-ref-head t-ref-same refs/tags/test-dummy/$v t-dgit checkout -p $p stable +now-on dgit/stable t-dgit checkout -d no-such-distro sid t-ref-head +now-on dgit/sid t-dgit checkout stable +now-on dgit/stable git branch -D dgit/sid t-dgit checkout -d no-such-distro sid t-ref-head +now-on dgit/sid git reflog --pretty=tformat:%gs >../reflog.got cat >../reflog.expect < Date: Thu, 5 Jul 2018 01:06:26 +0100 Subject: test suite: Fix trustingpolicy-replay & dput-ng. Specifically: * Only dput-ng actually complains about the existence of .upload files. dput itself just says there is nothing to do and calls that success. * The call to t-rm-dput-dropping was in the wrong place. t-commit bumps the version to 1.1 but it's 1.0 that needs removing. Closes:#903007. Signed-off-by: Ian Jackson --- debian/changelog | 1 + tests/tests/trustingpolicy-replay | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 4912f01..6c68113 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ dgit (5.7~) unstable; urgency=medium in the comment about handling patch stacks. * dgit update-vcs-git: Honour --package properly. * test suite: Always pass LC_COLLATE=C to sort(1). Closes:#903006. + * test suite: Fix trustingpolicy-replay & dput-ng. Closes:#903007. -- diff --git a/tests/tests/trustingpolicy-replay b/tests/tests/trustingpolicy-replay index ad731f5..e56ec7b 100755 --- a/tests/tests/trustingpolicy-replay +++ b/tests/tests/trustingpolicy-replay @@ -17,11 +17,12 @@ git tag start t-dgit build t-dgit push --new +t-rm-dput-dropping + t-commit 'Prep v1.1 which will be rewound' t-dgit build t-dgit push -t-rm-dput-dropping git checkout $tagpfx/1.0 t-dgit build t-dgit push --deliberately-fresh-repo -- cgit v1.2.3 From 53d416f00482f3e004cb81e51de2ee111fee8d9e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 5 Jul 2018 01:08:03 +0100 Subject: test suite: Test dput-ng compatibility. Add dput-ng as a dependency to trustingpolicy-replay. This is the test which went wrong with dput-ng before. It also has a number of pushes, so it will do. Signed-off-by: Ian Jackson --- debian/changelog | 1 + debian/tests/control | 6 +++++- tests/tests/trustingpolicy-replay | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 6c68113..cf9ff29 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ dgit (5.7~) unstable; urgency=medium * dgit update-vcs-git: Honour --package properly. * test suite: Always pass LC_COLLATE=C to sort(1). Closes:#903006. * test suite: Fix trustingpolicy-replay & dput-ng. Closes:#903007. + * test suite: Test dput-ng compatibility. -- diff --git a/debian/tests/control b/debian/tests/control index 4a2ac5b..b97adce 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -56,7 +56,11 @@ Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc Restrictions: x-dgit-git-only -Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-asplit build-modes-gbp-asplit checkout clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version 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 tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt +Tests: trustingpolicy-replay +Tests-Directory: tests/tests +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, dput-ng + +Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-asplit build-modes-gbp-asplit checkout clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version 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 tag-updates test-list-uptodate unrepresentable version-opt Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc diff --git a/tests/tests/trustingpolicy-replay b/tests/tests/trustingpolicy-replay index e56ec7b..2a1012b 100755 --- a/tests/tests/trustingpolicy-replay +++ b/tests/tests/trustingpolicy-replay @@ -4,6 +4,8 @@ set -e t-tstunt-parsechangelog +t-dependencies dput-ng + t-git-config dgit.default.dep14tag no t-dsd -- cgit v1.2.3 From 2a7411655b752fddfc8955f2967dbdc504d50451 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 1 Jul 2018 11:08:21 +0100 Subject: dgit: Check that entirely-new uploads to Debian are not source-only-uploads. Avoids the user pushing things that will inevitably be REJECTed. We end up introducing some new config and force options to support this. We do not reuse test_source_only_changes, as it doesn't have quite the right shape (in particular, it sometimes blithers on stdout). Also arguably it is better to look, specifically, for .debs, for the purpose of this test. This requires a new archive protocol method. We implement it for ftpmasterapi (where it is actualliy needed) and dummycatapi (where we need it for tests.) Implementing it for madisonish methods would be easy. For aptget, it would probably involve iterating over suites, and not be adviseable. Closes:#801435. Signed-off-by: Ian Jackson --- debian/changelog | 2 ++ dgit | 86 ++++++++++++++++++++++++++++++++++++++++++++++---------- dgit.1 | 13 +++++++++ 3 files changed, 86 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index cf9ff29..ba60bde 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ dgit (5.7~) unstable; urgency=medium New feature: * dgit checkout: new subcommand. Closes:#878443. + * dgit: Check that entirely-new uploads to Debian are not + source-only-uploads, as those are REJECTed. Closes:#801435. Bugfixes: * dgit(7): Mention git-debrebase and gbp pq alongside git-dpm, diff --git a/dgit b/dgit index 00da67d..3a737d0 100755 --- a/dgit +++ b/dgit @@ -90,6 +90,7 @@ our $chase_dsc_distro=1; our %forceopts = map { $_=>0 } qw(unrepresentable unsupported-source-format dsc-changes-mismatch changes-origs-exactly + uploading-binaries uploading-source-only import-gitapply-absurd import-gitapply-no-absurd import-dsc-with-dgit-field); @@ -614,6 +615,7 @@ our %defcfg = ('dgit.default.distro' => 'debian', 'dgit.default.sshpsql-dbname' => 'service=projectb', 'dgit.default.aptget-components' => 'main', 'dgit.default.dgit-tag-format' => 'new,old,maint', + 'dgit.default.source-only-uploads' => 'ok', 'dgit.dsc-url-proto-ok.http' => 'true', 'dgit.dsc-url-proto-ok.https' => 'true', 'dgit.dsc-url-proto-ok.git' => 'true', @@ -628,6 +630,7 @@ our %defcfg = ('dgit.default.distro' => 'debian', 'dgit-distro.debian.git-check' => 'url', 'dgit-distro.debian.git-check-suffix' => '/info/refs', 'dgit-distro.debian.new-private-pushers' => 't', + 'dgit-distro.debian.source-only-uploads' => 'not-wholly-new', 'dgit-distro.debian/push.git-url' => '', 'dgit-distro.debian/push.git-host' => 'push.dgit.debian.org', 'dgit-distro.debian/push.git-user-force' => 'dgit', @@ -1179,6 +1182,12 @@ sub file_in_archive_ftpmasterapi { my $info = api_query($data, "file_in_archive/$pat", 1); } +sub package_not_wholly_new_ftpmasterapi { + my ($proto,$data,$pkg) = @_; + my $info = api_query($data,"madison?package=${pkg}&f=json"); + return !!@$info; +} + #---------- `aptget' archive query method ---------- our $aptget_base; @@ -1342,34 +1351,55 @@ sub archive_query_aptget { } sub file_in_archive_aptget () { return undef; } +sub package_not_wholly_new_aptget () { return undef; } #---------- `dummyapicat' archive query method ---------- sub archive_query_dummycatapi { archive_query_ftpmasterapi @_; } sub canonicalise_suite_dummycatapi { canonicalise_suite_ftpmasterapi @_; } -sub file_in_archive_dummycatapi ($$$) { - my ($proto,$data,$filename) = @_; +sub dummycatapi_run_in_mirror ($@) { + # runs $fn with FIA open onto rune + my ($rune, $argl, $fn) = @_; + my $mirror = access_cfg('mirror'); $mirror =~ s#^file://#/# or die "$mirror ?"; - my @out; - my @cmd = (qw(sh -ec), ' - cd "$1" - find -name "$2" -print0 | - xargs -0r sha256sum - ', qw(x), $mirror, $filename); + my @cmd = (qw(sh -ec), 'cd "$1"; shift'."\n".$rune, + qw(x), $mirror, @$argl); debugcmd "-|", @cmd; open FIA, "-|", @cmd or die $!; - while () { - chomp or die; - printdebug "| $_\n"; - m/^(\w+) (\S+)$/ or die "$_ ?"; - push @out, { sha256sum => $1, filename => $2 }; - } - close FIA or die failedcmd @cmd; + my $r = $fn->(); + close FIA or ($!==0 && $?==141) or die failedcmd @cmd; + return $r; +} + +sub file_in_archive_dummycatapi ($$$) { + my ($proto,$data,$filename) = @_; + my @out; + dummycatapi_run_in_mirror ' + find -name "$1" -print0 | + xargs -0r sha256sum + ', [$filename], sub { + while () { + chomp or die; + printdebug "| $_\n"; + m/^(\w+) (\S+)$/ or die "$_ ?"; + push @out, { sha256sum => $1, filename => $2 }; + } + }; return \@out; } +sub package_not_wholly_new_dummycatapi { + my ($proto,$data,$pkg) = @_; + dummycatapi_run_in_mirror " + find -name ${pkg}_*.dsc + ", [], sub { + local $/ = undef; + !!; + }; +} + #---------- `madison' archive query method ---------- sub archive_query_madison { @@ -1420,6 +1450,7 @@ sub canonicalise_suite_madison { } sub file_in_archive_madison { return undef; } +sub package_not_wholly_new_madison { return undef; } #---------- `sshpsql' archive query method ---------- @@ -1497,6 +1528,7 @@ END } sub file_in_archive_sshpsql ($$$) { return undef; } +sub package_not_wholly_new_sshpsql ($$$) { return undef; } #---------- `dummycat' archive query method ---------- @@ -1541,6 +1573,7 @@ sub archive_query_dummycat ($$) { } sub file_in_archive_dummycat () { return undef; } +sub package_not_wholly_new_dummycat () { return undef; } #---------- tag format handling ---------- @@ -4418,6 +4451,29 @@ END files_compare_inputs($dsc, $changes) unless forceing [qw(dsc-changes-mismatch)]; + # Check whether this is a source only upload + my $hasdebs = $changes->{Files} =~ m{\.deb$}m; + my $sourceonlypolicy = access_cfg 'source-only-uploads'; + if ($sourceonlypolicy eq 'ok') { + } elsif ($sourceonlypolicy eq 'always') { + forceable_fail [qw(uploading-binaries)], + "uploading binaries, although distroy policy is source only" + if $hasdebs; + } elsif ($sourceonlypolicy eq 'never') { + forceable_fail [qw(uploading-source-only)], + "source-only upload, although distroy policy requires .debs" + if !$hasdebs; + } elsif ($sourceonlypolicy eq 'not-wholly-new') { + forceable_fail [qw(uploading-source-only)], + "source-only upload, even though package is entirely NEW\n". + "(this is contrary to policy in ".(access_nomdistro()).")" + if !$hasdebs + && $new_package + && !(archive_query('package_not_wholly_new', $package) // 1); + } else { + badcfg "unknown source-only-uploads policy \`$sourceonlypolicy'"; + } + # Perhaps adjust .dsc to contain right set of origs changes_update_origs_from_dsc($dsc, $changes, $upstreamversion, $changesfile) diff --git a/dgit.1 b/dgit.1 index e7ab454..73efbb0 100644 --- a/dgit.1 +++ b/dgit.1 @@ -1050,6 +1050,17 @@ The result is a fresh import, discarding the git history that the person who pushed that .dsc was working with. .TP +.B --force-uploading-binaries +Carry on and +upload binaries +even though dgit thinks your distro does not permit that. +.TP +.B --force-uploading-source-only +Carry on and do a source-only upload, +without any binaries, +even though dgit thinks your distro does not permit that, +or does not permit that in this situation. +.TP .B --force-unrepresentable Carry on even if dgit thinks that your git tree contains changes @@ -1226,6 +1237,8 @@ or when pushing and .TP .BI dgit-distro. distro .rewrite-map-enable .TP +.BR dgit-distro. \fIdistro\fR .source-only-uploads " " ok | always | never | not-wholly-new +.TP .BI dgit.default.old-dsc-distro .TP .BI dgit.dsc-url-proto-ok. protocol -- cgit v1.2.3 From d7ee18bed9191dc5af495818626f5355d9c1de97 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 5 Jul 2018 01:27:09 +0100 Subject: test suite: sourceonlypolicy: New test Test the fix for #801435. Signed-off-by: Ian Jackson --- debian/tests/control | 2 +- tests/tests/sourceonlypolicy | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100755 tests/tests/sourceonlypolicy diff --git a/debian/tests/control b/debian/tests/control index b97adce..dfd73bb 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -60,7 +60,7 @@ Tests: trustingpolicy-replay Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, dput-ng -Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-asplit build-modes-gbp-asplit checkout clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version 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 tag-updates test-list-uptodate unrepresentable version-opt +Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-asplit build-modes-gbp-asplit checkout clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version 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 sourceonlypolicy tag-updates test-list-uptodate unrepresentable version-opt Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc diff --git a/tests/tests/sourceonlypolicy b/tests/tests/sourceonlypolicy new file mode 100755 index 0000000..b0569c3 --- /dev/null +++ b/tests/tests/sourceonlypolicy @@ -0,0 +1,38 @@ +#!/bin/bash +set -e +. tests/lib + +t-tstunt-parsechangelog + +t-prep-newpackage example 1.0 + +cd $p +revision=1 + +dgit-with-policy () { + local policy=$1; shift + t-dgit -cdgit-distro.test-dummy.source-only-uploads=$policy "$@" +} + +t-expect-fail E:'source-only.*entirely NEW' \ +dgit-with-policy not-wholly-new push-source --new + +t-expect-fail E:'source-only.*requires \.debs' \ +dgit-with-policy never push-source --new + +dgit-with-policy always push-source --new + +t-archive-process-incoming sid + +t-commit 'Now with binaries' + +t-dgit -wgf build + +t-expect-fail E:'uploading binaries.*source only' \ +dgit-with-policy always push --new + +t-commit 'Source-only not NEW' + +dgit-with-policy not-wholly-new push-source --new + +t-ok -- cgit v1.2.3 From 831682b01f6a820eaa5b19b4cb4c3e3a0c05d28f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 5 Jul 2018 15:02:31 +0100 Subject: changelog: finalise 5.7 Signed-off-by: Ian Jackson --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ba60bde..800edc7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -dgit (5.7~) unstable; urgency=medium +dgit (5.7) unstable; urgency=medium New feature: * dgit checkout: new subcommand. Closes:#878443. @@ -13,7 +13,7 @@ dgit (5.7~) unstable; urgency=medium * test suite: Fix trustingpolicy-replay & dput-ng. Closes:#903007. * test suite: Test dput-ng compatibility. - -- + -- Ian Jackson Thu, 05 Jul 2018 15:02:21 +0100 dgit (5.6) unstable; urgency=medium -- cgit v1.2.3 From d51baf0412dd503a3c9ad66bf4a4bf845b6efb35 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 5 Jul 2018 15:04:21 +0100 Subject: changelog: start 5.8 Signed-off-by: Ian Jackson --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 800edc7..251d64f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dgit (5.8~) unstable; urgency=medium + + * + + -- + dgit (5.7) unstable; urgency=medium New feature: -- cgit v1.2.3 From 07497abfd7bc78144279fbb87a6435aad18b9c0a Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 6 Jul 2018 11:59:59 +0100 Subject: dgit(1): Unscramble push and push-source descriptions These got mixed up in a recent commit. Signed-off-by: Sean Whitton --- dgit.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dgit.1 b/dgit.1 index 73efbb0..67aa2fa 100644 --- a/dgit.1 +++ b/dgit.1 @@ -227,9 +227,6 @@ dgit push always uses the package, suite and version specified in the debian/changelog and the .dsc, which must agree. If the command line specifies a suite then that must match too. -With \fB-C\fR, performs a dgit push, additionally ensuring that no -binary packages are uploaded. - When used on a git-debrebase branch, dgit calls git-debrebase to prepare the branch @@ -239,6 +236,9 @@ for source package upload and push. Without \fB-C\fR, builds a source package and dgit pushes it. Saying \fBdgit push-source\fR is like saying "update the source code in the archive to match my git HEAD, and let the autobuilders do the rest." + +With \fB-C\fR, performs a dgit push, additionally ensuring that no +binary packages are uploaded. .TP \fBdgit rpush\fR \fIbuild-host\fR\fB:\fR\fIbuild-dir\fR [\fIpush args...\fR] Pushes the contents of the specified directory on a remote machine. -- cgit v1.2.3 From 7c3755874bd9192ce777c5271b70174083919ecd Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 6 Jul 2018 18:44:18 +0100 Subject: changelog: Document dgit(1) build unscrambling Signed-off-by: Ian Jackson squash! changelog: Document manpage fix --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 251d64f..04357f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ dgit (5.8~) unstable; urgency=medium - * + Bugfixes: + * dgit(1): Unscramble push[-source] descriptions. Closes:#903116. -- -- cgit v1.2.3 From 0899e14ec8d3eb877f4190882c5c3e92d02c460b Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 6 Jul 2018 21:17:18 +0100 Subject: dgit, git-debrebase: Properly make patches with nasty .gitignores. Specifically: * When running git status --porcelain, pass --ignored so it lists ignored files, and handle the ! output that it then produces. * Add missing -f to a few git add invocations. I have done some greps ('git.*add', 'git.*status', 'porcelain', etc.) to try to find other missed cases and none turned up. git diff is OK because normally we pass two treeish arguments, in which case the ignores are ignored by git diff. When we are asking it to look at the working tree, we are expecting it to ignore untracked files (whether ignored or not), and diff tracked ones, which is what it does. Closes:#903130. Signed-off-by: Ian Jackson --- debian/changelog | 2 ++ dgit | 6 +++--- git-debrebase | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 04357f9..375e783 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ dgit (5.8~) unstable; urgency=medium Bugfixes: + * dgit, git-debrebase: Properly make patches even if an awkward + .gitignore ignores the things in debian/patches. Closes:#903130. * dgit(1): Unscramble push[-source] descriptions. Closes:#903116. -- diff --git a/dgit b/dgit index 3a737d0..0d36361 100755 --- a/dgit +++ b/dgit @@ -3812,11 +3812,11 @@ sub quiltify_nofix_bail ($$) { } sub commit_quilty_patch () { - my $output = cmdoutput @git, qw(status --porcelain); + my $output = cmdoutput @git, qw(status --ignored --porcelain); my %adds; foreach my $l (split /\n/, $output) { next unless $l =~ m/\S/; - if ($l =~ m{^(?:\?\?| [MADRC]) (.pc|debian/patches)}) { + if ($l =~ m{^(?:[?!][?!]| [MADRC]) (.pc|debian/patches)}) { $adds{$1}++; } } @@ -5318,7 +5318,7 @@ END print SERIES "\n" or die $! unless $newline eq "\n"; print SERIES "auto-gitignore\n" or die $!; close SERIES or die $!; - runcmd @git, qw(add -- debian/patches/series), $gipatch; + runcmd @git, qw(add -f -- debian/patches/series), $gipatch; commit_admin < Date: Fri, 6 Jul 2018 21:14:05 +0100 Subject: test suite: makepatches7: Add a nasty .gitignore Prior to the fix for #903130 this prevents both dgit and gdr from making patches properly. Signed-off-by: Ian Jackson --- tests/tests/gdr-makepatches7 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/tests/gdr-makepatches7 b/tests/tests/gdr-makepatches7 index 9c39710..02ea7ab 100755 --- a/tests/tests/gdr-makepatches7 +++ b/tests/tests/gdr-makepatches7 @@ -8,6 +8,15 @@ t-setup-import gdr-convert-gbp cd $p +git checkout upstream/2.0 +echo '*patch*' >>.gitignore +git commit -m nasty .gitignore +git tag v2.1 +GZIP=-1 git archive -o ../${p}_2.1.orig.tar.gz --prefix ${p}/ v2.1 + +git checkout master +t-git-debrebase new-upstream 2.1-1 + t-some-changes for-rebase-fixup m t-git-debrebase -- cgit v1.2.3 From 27aec8c7cfd2cfd315e321d9ac335872665bcfc0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 7 Jul 2018 00:13:02 +0100 Subject: git-debrebase: keycommits: Callbacks get separate $mainwhy Separate out the extra contextual info, naming the hash of the commit being complained about, into a separate argument to $x->(). This allows us to pass the message without that as an additional argument to the callbacks. This way we can still pass \&snag as a callback but other callers can do something more sophisticated involving $cl. No functional change for any existing callers. Signed-off-by: Ian Jackson --- git-debrebase | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/git-debrebase b/git-debrebase index 04befff..292471d 100755 --- a/git-debrebase +++ b/git-debrebase @@ -568,11 +568,12 @@ sub keycommits ($;$$$$) { my $cl; $fatal //= sub { fail $_[2]; }; my $x = sub { - my ($cb, $tagsfx, $why) = @_; + my ($cb, $tagsfx, $mainwhy, $xwhy) = @_; + my $why = $mainwhy.$xwhy; my $m = "branch needs laundering (run git-debrebase): $why"; fail $m unless defined $cb; return unless $cb; - $cb->("unclean-$tagsfx", $why, $cl); + $cb->("unclean-$tagsfx", $why, $cl, $mainwhy); }; for (;;) { $cl = classify $head; @@ -593,27 +594,27 @@ sub keycommits ($;$$$$) { last; } elsif ($ty eq 'Upstream') { $x->($unclean, 'ordering', - "packaging change ($breakwater) follows upstream change (eg $head)") + "packaging change ($breakwater) follows upstream change"," (eg $head)") if defined $breakwater; $clogonly = undef; $breakwater = undef; } elsif ($ty eq 'Mixed') { $x->($unclean, 'mixed', - "found mixed upstream/packaging commit ($head)"); + "found mixed upstream/packaging commit"," ($head)"); $clogonly = undef; $breakwater = undef; } elsif ($ty eq 'Pseudomerge' or $ty eq 'AddPatches') { $x->($furniture, (lc $ty), - "found interchange bureaucracy commit ($ty, $head)"); + "found interchange bureaucracy commit ($ty)"," ($head)"); } elsif ($ty eq 'DgitImportUnpatched') { $x->($trouble, 'dgitimport', "found dgit dsc import ($head)"); return (undef,undef); } else { $x->($fatal, 'unprocessable', - "found unprocessable commit, cannot cope: $head; $cl->{Why}" - ); + "found unprocessable commit, cannot cope: $cl->{Why}", + " ($head)"); return (undef,undef); } $head = $cl->{Parents}[0]{CommitId}; -- cgit v1.2.3 From 87da76cc34151e4623797b32d16c351029969bb6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 7 Jul 2018 00:15:46 +0100 Subject: git-debrebase: status: Reorganise commit reporting. Replace the references to @_ with a hash. Using a hash is much less confusing than all this numerical indexing. Also, \@_ is wrong because there is only one @_, so by the time it is dereference, the commit being printed is the anchor. This is why in #903131 we see branch is unlaundered found mixed upstream/packaging commit (7badba627162337c7057002f37e9a1a593d07d08) abcc6260 Update to upstream 2.9.7 which appears to sugggest that the anchor is a mixed commit. Actually the mixed commit is 7badba627162 but the subsequent message is based on @_ which has different information in it by then. And, set $kcmsg from the main message, not including the commit information. We are the more sophisticated caller mentioned in the previous commmit. Closes: #903131. Signed-off-by: Ian Jackson --- debian/changelog | 1 + git-debrebase | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 375e783..6dea169 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ dgit (5.8~) unstable; urgency=medium Bugfixes: * dgit, git-debrebase: Properly make patches even if an awkward .gitignore ignores the things in debian/patches. Closes:#903130. + * git-debrebase status: Fix commit reporting. Closes:903131. * dgit(1): Unscramble push[-source] descriptions. Closes:#903116. -- diff --git a/git-debrebase b/git-debrebase index 292471d..557e789 100755 --- a/git-debrebase +++ b/git-debrebase @@ -1389,15 +1389,20 @@ sub cmd_status () { # todo: gdr status should print upstream component(s) info # todo: gdr should leave/maintain some refs with this kind of info ? - my $oldest = [ 0 ]; + my $oldest = { Badness => 0 }; my $newest; my $note = sub { - my ($badness, $ourmsg, $snagname, $kcmsg, $cl) = @_; - if ($oldest->[0] < $badness) { + my ($badness, $ourmsg, $snagname, $dummy, $cl, $kcmsg) = @_; + if ($oldest->{Badness} < $badness) { $oldest = $newest = undef; } - $oldest = \@_; # we're walking backwards - $newest //= \@_; + $oldest = { + Badness => $badness, + CommitId => $cl->{CommitId}, + OurMsg => $ourmsg, + KcMsg => $kcmsg, + }; + $newest //= $oldest; }; my ($anchor, $bw) = keycommits +(git_rev_parse 'HEAD'), sub { $note->(1, 'branch contains furniture (not laundered)', @_); }, @@ -1414,16 +1419,16 @@ sub cmd_status () { }; print "current branch contents, in git-debrebase terms:\n"; - if (!$oldest->[0]) { + if (!$oldest->{Badness}) { print " branch is laundered\n"; } else { - print " $oldest->[1]\n"; + print " $oldest->{OurMsg}\n"; my $printed = ''; foreach my $info ($oldest, $newest) { - my $cid = $info->[4]{CommitId}; + my $cid = $info->{CommitId}; next if $cid eq $printed; $printed = $cid; - print " $info->[3]\n"; + print " $info->{KcMsg}\n"; $prcommitinfo->($cid); } } -- cgit v1.2.3 From 180a9c094c1b1e51281c70940dc451465ec04806 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 7 Jul 2018 00:41:56 +0100 Subject: git-debrebase new-upstream: Add a -1 revision if the user didn't supply one. Closes:#903127. Signed-off-by: Ian Jackson --- debian/changelog | 2 ++ git-debrebase | 6 +++++- git-debrebase.1.pod | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 6dea169..4acfcb8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ dgit (5.8~) unstable; urgency=medium * dgit, git-debrebase: Properly make patches even if an awkward .gitignore ignores the things in debian/patches. Closes:#903130. * git-debrebase status: Fix commit reporting. Closes:903131. + * git-debrebase new-upstream: Add a -1 revision if the user + didn't supply one. Closes:#903127. * dgit(1): Unscramble push[-source] descriptions. Closes:#903116. -- diff --git a/git-debrebase b/git-debrebase index 557e789..c28a775 100755 --- a/git-debrebase +++ b/git-debrebase @@ -1140,7 +1140,11 @@ sub cmd_new_upstream () { badusage "need NEW-VERSION [UPS-COMMITTISH]" unless @ARGV >= 1; # parse args - low commitment - my $new_version = (new Dpkg::Version scalar(shift @ARGV), check => 1); + my $spec_version = shift @ARGV; + my $new_version = (new Dpkg::Version $spec_version, check => 1); + if ($new_version->is_native()) { + $new_version = (new Dpkg::Version "$spec_version-1", check => 1); + } my $new_upstream_version = $new_version->version(); my $new_upstream = shift @ARGV; diff --git a/git-debrebase.1.pod b/git-debrebase.1.pod index 1c3e681..4d1a673 100644 --- a/git-debrebase.1.pod +++ b/git-debrebase.1.pod @@ -135,6 +135,12 @@ If you git-rebase --abort, the whole new upstream operation is aborted, except for the laundering. + +may be whole new Debian version, including revision, +or just the upstream part, +in which case -1 will be appended +to make the new Debian version. + The are, optionally, in order: =over -- cgit v1.2.3 From 422f18bf5da933f789e8b2b818d558a66f4d5dcf Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 7 Jul 2018 00:31:09 +0100 Subject: test suite: gdr-newupstream: Test adding revision Signed-off-by: Ian Jackson --- tests/tests/gdr-newupstream | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/tests/gdr-newupstream b/tests/tests/gdr-newupstream index ee987f5..39ed24b 100755 --- a/tests/tests/gdr-newupstream +++ b/tests/tests/gdr-newupstream @@ -36,7 +36,8 @@ t-git-debrebase new-upstream $v git tag v2.1 upstream -t-git-debrebase new-upstream $v +t-git-debrebase new-upstream ${v%-*} + t-gdr-good laundered git reflog | egrep 'debrebase new-upstream.*checkout' -- cgit v1.2.3 From efc587b04a40fb84004690694004ec4641bb82dd Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 7 Jul 2018 00:50:17 +0100 Subject: git-debrebase: Improve grammar if one blocking snag. Signed-off-by: Ian Jackson --- debian/changelog | 1 + git-debrebase | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 4acfcb8..f9e2afa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ dgit (5.8~) unstable; urgency=medium * git-debrebase status: Fix commit reporting. Closes:903131. * git-debrebase new-upstream: Add a -1 revision if the user didn't supply one. Closes:#903127. + * git-debrebase: Improve grammar if one blocking snag. * dgit(1): Unscramble push[-source] descriptions. Closes:#903116. -- diff --git a/git-debrebase b/git-debrebase index c28a775..f16a89c 100755 --- a/git-debrebase +++ b/git-debrebase @@ -270,7 +270,7 @@ sub snags_maybe_bail () { $us, $snags_tripped; } else { fail sprintf - "%s: snags: %d blockers (you could -f, or --force)", + "%s: snags: %d blocker(s) (you could -f, or --force)", $us, $snags_tripped; } } -- cgit v1.2.3 From 7166dbc963a9c01ce62a0564bb7b905156adb560 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 8 Jul 2018 11:42:53 +0100 Subject: changelog: finalise 5.8 Signed-off-by: Ian Jackson --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f9e2afa..2cc9508 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -dgit (5.8~) unstable; urgency=medium +dgit (5.8) unstable; urgency=medium Bugfixes: * dgit, git-debrebase: Properly make patches even if an awkward @@ -9,7 +9,7 @@ dgit (5.8~) unstable; urgency=medium * git-debrebase: Improve grammar if one blocking snag. * dgit(1): Unscramble push[-source] descriptions. Closes:#903116. - -- + -- Ian Jackson Sun, 08 Jul 2018 11:42:41 +0100 dgit (5.7) unstable; urgency=medium -- cgit v1.2.3