summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2022-09-03 11:46:17 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2022-09-03 20:14:26 +0100
commitceb25938005b5bdf130425110e075a5cd7411410 (patch)
treea3301f25e133e26b44e43b293eed0d4b373c220f /dgit
parent92547aaf083d493074b9c41649dda938efac1320 (diff)
dgit: Provide --quilt=single
This is to replace single-debian-patch. Closes: #1018984 Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit38
1 files changed, 37 insertions, 1 deletions
diff --git a/dgit b/dgit
index f96afdf..8e737d9 100755
--- a/dgit
+++ b/dgit
@@ -88,7 +88,7 @@ our $quilt_upstream_commitish;
our $quilt_upstream_commitish_used;
our $quilt_upstream_commitish_message;
our $quilt_options_re = 'gbp|dpm|baredebian(?:\+tarball|\+git)?';
-our $quilt_modes_re = "linear|smash|auto|nofix|nocheck|unapplied|$quilt_options_re";
+our $quilt_modes_re = "linear|smash|auto|single|nofix|nocheck|unapplied|$quilt_options_re";
our $splitview_mode;
our $splitview_modes_re = qr{auto|always|never};
our $dodep14tag;
@@ -5959,6 +5959,8 @@ sub build_maybe_quilt_fixup () {
# bugs in dpkg-source.
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1018984
quilt_fixup_dpkgsource_singlepatch($clogp, $headref, $upstreamversion);
+ } elsif ($quilt_mode =~ m/single/) {
+ quilt_fixup_git_singlepatch($clogp, $headref, $upstreamversion);
} else {
quilt_fixup_multipatch($clogp, $headref, $upstreamversion,
$splitbrain_cachekey);
@@ -6071,6 +6073,40 @@ sub quilt_fixup_dpkgsource_singlepatch ($$$) {
commit_quilty_patch();
}
+sub quilt_fixup_git_singlepatch ($$$) {
+ my ($clogp, $headref, $upstreamversion) = @_;
+
+ progress f_ "regenerating patch using git diff (--quilt=%s)",
+ $quilt_mode;
+
+ my $unapplied=quilt_fakedsc2unapplied($headref, $upstreamversion);
+ changedir '..';
+
+ my @unrepres;
+ my $o2h = quiltify_trees_differ($unapplied,$headref, 1, undef,\@unrepres);
+ unpack_playtree_need_cd_work($headref);
+
+ quiltify_check_unrepresentable \@unrepres;
+
+ rmtree("debian/patches");
+
+ if ($o2h) {
+ quiltify_make_dpkg_patch
+ $unapplied, $headref,
+ 'dgit-changes', '', <<'END', '';
+Debian changes
+
+The Debian delta in this package is represented by this one combined patch.
+The git history (e.g. from dgit clone) is the primary source representation.
+
+We don't use debian/source/options single-debian-patch because it has bugs.
+Therefore, NMUs etc. may nevertheless have made additional patches.
+END
+ }
+
+ commit_quilty_patch();
+}
+
sub quilt_need_fake_dsc ($) {
# cwd should be playground
my ($upstreamversion) = @_;