X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=8404a19c2509021f1b8242bac094dc86d0d6e523;hp=fe1bff5f00035a56df33160485b64c85c347fcff;hb=b7120584994325d4f6d2963ed336110355349fc6;hpb=574c18723a468471bef2a12b651176dd22b911ba diff --git a/dgit b/dgit index fe1bff5f..8404a19c 100755 --- a/dgit +++ b/dgit @@ -64,6 +64,7 @@ our $quilt_mode; our $quilt_modes_re = 'linear|smash|auto|nofix|nocheck|gbp|unapplied'; our $we_are_responder; our $initiator_tempdir; +our $patches_applied_dirtily = 00; our %format_ok = map { $_=>1 } ("1.0","3.0 (native)","3.0 (quilt)"); @@ -101,6 +102,7 @@ our %opts_opt_map = ('dget' => \@dget, # accept for compatibility 'dpkg-source' => \@dpkgsource, 'dpkg-buildpackage' => \@dpkgbuildpackage, 'dpkg-genchanges' => \@dpkggenchanges, + 'gbp' => \@gbp, 'ch' => \@changesopts, 'mergechanges' => \@mergechanges); @@ -1446,7 +1448,7 @@ END my $cversion = getfield $clogp, 'Version'; progress "synthesised git commit from .dsc $cversion"; if ($lastpush_hash) { - runcmd @git, qw(reset --hard), $lastpush_hash; + runcmd @git, qw(reset -q --hard), $lastpush_hash; runcmd qw(sh -ec), 'dpkg-parsechangelog >>../changelogold.tmp'; my $oldclogp = parsecontrol('../changelogold.tmp','previous changelog'); my $oversion = getfield $oldclogp, 'Version'; @@ -2559,7 +2561,7 @@ sub quiltify_tree_sentinelfiles ($) { sub quiltify_splitbrain_needed () { if (!$split_brain) { - progress "creating dgit view"; + progress "dgit view: changes are required..."; runcmd @git, qw(checkout -q -b dgit-view); $split_brain = 1; } @@ -2593,7 +2595,7 @@ sub quiltify_splitbrain ($$$$$$) { if ($quilt_mode =~ m/gbp|unapplied/ && ($diffbits->{O2A} & 01)) { # some patches quiltify_splitbrain_needed(); - progress "creating patches-applied version using gbp pq"; + progress "dgit view: creating patches-applied version using gbp pq"; runcmd shell_cmd 'exec >/dev/null', @gbp, qw(pq import); # gbp pq import creates a fresh branch; push back to dgit-view runcmd @git, qw(update-ref refs/heads/dgit-view HEAD); @@ -2602,7 +2604,7 @@ sub quiltify_splitbrain ($$$$$$) { if (($diffbits->{H2O} & 02) && # user has modified .gitignore !($diffbits->{O2A} & 02)) { # patches do not change .gitignore quiltify_splitbrain_needed(); - progress "creating patch to represent .gitignore changes"; + progress "dgit view: creating patch to represent .gitignore changes"; ensuredir "debian/patches"; my $gipatch = "debian/patches/auto-gitignore"; open GIPATCH, ">>", "$gipatch" or die "$gipatch: $!"; @@ -2642,7 +2644,7 @@ END runcmd @git, qw(update-ref -m), $cachekey, "refs/$splitbraincache", $dgitview; - progress "created dgit view (commit id $dgitview)"; + progress "dgit view: created (commit id $dgitview)"; changedir '.git/dgit/unpack/work'; } @@ -2948,7 +2950,7 @@ sub quilt_fixup_singlepatch ($$$) { sub quilt_fixup_multipatch ($$$) { my ($clogp, $headref, $upstreamversion) = @_; - progress "starting quiltify (multiple patches, $quilt_mode mode)"; + progress "examining quilt state (multiple patches, $quilt_mode mode)"; # Our objective is: # - honour any existing .pc in case it has any strangeness @@ -3053,13 +3055,15 @@ END } my $debtar= srcfn $fakeversion,'.debian.tar.gz'; - runcmd qw(env GZIP=-1 tar -zcf), "./$debtar", qw(-C ../../..), @files; + runcmd qw(env GZIP=-1n tar -zcf), "./$debtar", qw(-C ../../..), @files; $dscaddfile->($debtar); close $fakedsc or die $!; my $splitbrain_cachekey; if (quiltmode_splitbrain()) { + progress + "dgit: split brain (separate dgit view) may needed (--quilt=$quilt_mode)."; # we look in the reflog of dgit-intern/quilt-cache # we look for an entry whose message is the key for the cache lookup my @cachekey = (qw(dgit), $our_version); @@ -3101,13 +3105,12 @@ END my $cachehit = $1; quilt_fixup_mkwork($headref); if ($cachehit ne $headref) { - progress "quilt fixup ($quilt_mode mode) found cached tree"; + progress "dgit view: found cached (commit id $cachehit)"; runcmd @git, qw(checkout -q -b dgit-view), $cachehit; $split_brain = 1; return; } - progress "quilt fixup ($quilt_mode mode)". - " found cached indication that no changes needed"; + progress "dgit view: found cached, no changes required"; return; } die $! if GC->error; @@ -3202,6 +3205,7 @@ END return; } + progress "starting quiltify (multiple patches, $quilt_mode mode)"; quiltify($clogp,$headref,$oldtiptree,\@failsuggestion); if (!open P, '>>', ".pc/applied-patches") { @@ -3236,6 +3240,29 @@ sub quilt_fixup_editor () { exit 0; } +sub maybe_apply_patches_dirtily () { + return unless $quilt_mode =~ m/gbp|unapplied/; + print STDERR <