From: Ian Jackson Date: Sat, 15 Jul 2017 21:58:53 +0000 (+0100) Subject: Merge tag 'archive/debian/3.11_deb9u1' into stable X-Git-Tag: archive/debian/3.12~16 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=643fe03fd85c430ca77c9a3a59a4d9e6f99e9f7c;hp=3ab98ee1228e40e8de5aba0e6a0f813625572078 Merge tag 'archive/debian/3.11_deb9u1' into stable Signed-off-by: Ian Jackson --- diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index ba1c2880..dcecbd1a 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -50,7 +50,7 @@ BEGIN { git_get_ref git_for_each_ref git_for_each_tag_referring is_fast_fwd $package_re $component_re $deliberately_re - $distro_re $versiontag_re + $distro_re $versiontag_re $series_filename_re $branchprefix initdebug enabledebug enabledebuglevel printdebug debugcmd @@ -69,6 +69,7 @@ our $deliberately_re = "(?:TEST-)?$package_re"; our $distro_re = $component_re; our $versiontag_re = qr{[-+.\%_0-9a-zA-Z/]+}; our $branchprefix = 'dgit'; +our $series_filename_re = qr{(?:^|\.)series(?!\n)$}s; # policy hook exit status bits # see dgit-repos-server head comment for documentation diff --git a/debian/changelog b/debian/changelog index 5ca1f5c8..1d912c02 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +dgit (3.12~) unstable; urgency=medium + + Important bugfixes to dgit: + * Pass --no-renames to git diff-tree -z, avoiding potential trouble. + * Defend against commit subject lines which would generate patches which + look like series files, etc. Involves adding .patch to all generated + patch filenames. + + -- + dgit (3.11~deb9u1) stretch; urgency=high * Rebuild and upload to stretch. diff --git a/dgit b/dgit index ccf50094..51975965 100755 --- a/dgit +++ b/dgit @@ -4891,7 +4891,7 @@ sub quiltify_trees_differ ($$;$$$) { # a list of unrepresentable changes (removals of upstream files # (as messages) local $/=undef; - my @cmd = (@git, qw(diff-tree -z)); + my @cmd = (@git, qw(diff-tree -z --no-renames)); push @cmd, qw(--name-only) unless $unrepres; push @cmd, qw(-r) if $finegrained || $unrepres; push @cmd, $x, $y; @@ -5274,6 +5274,7 @@ sub quiltify ($$$$) { die "contains unexpected slashes\n" if m{//} || m{/$}; die "contains leading punctuation\n" if m{^\W} || m{/\W}; die "contains bad character(s)\n" if m{[^-a-z0-9_.+=~/]}i; + die "is series file\n" if m{$series_filename_re}o; die "too long" if length > 200; }; return $_ unless $@; @@ -5312,6 +5313,7 @@ sub quiltify ($$$$) { $patchname =~ y/-a-z0-9_.+=~//cd; $patchname =~ s/^\W/x-$&/; $patchname = substr($patchname,0,40); + $patchname .= ".patch"; } if (!defined $patchdir) { $patchdir = ''; diff --git a/tests/tests/quilt b/tests/tests/quilt index 1a921b37..f26f7445 100755 --- a/tests/tests/quilt +++ b/tests/tests/quilt @@ -41,8 +41,8 @@ iteration diff <