diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-08-19 19:18:42 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-08-19 19:18:43 +0100 |
commit | 6152f859fc4fa61b485362a6ff5613f436883db8 (patch) | |
tree | 441e06d81fad7bfd073bdc1a5a1a31d80bbe443e /git-debrebase | |
parent | 813a7ced61b4c18222f43b31c10ad7b4c8e16bf1 (diff) |
git-debrebase: convert-from-*: Snag on unused patches
Patches in d/patches which are not in series will be deleted, and not
represented in the output.
So call them a snag.
Closes:#904997.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'git-debrebase')
-rwxr-xr-x | git-debrebase | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/git-debrebase b/git-debrebase index 5a9a9cb..66167b2 100755 --- a/git-debrebase +++ b/git-debrebase @@ -2390,6 +2390,24 @@ sub cmd_make_patches () { } } +sub check_series_has_all_patches ($) { + my ($head) = @_; + my $seriesfn = 'debian/patches/series'; + my ($dummy, $series) = git_cat_file "$head:$seriesfn", + [qw(blob missing)]; + $series //= ''; + my %series; + foreach my $f (grep /\S/, grep {!m/^\s\#/} split /\n/, $series) { + fail "patch $f repeated in $seriesfn !" if $series{$f}++; + } + foreach my $patchfile (get_tree "$head:debian/patches", 1,1) { + my ($f,$i) = @$patchfile; + next if $series{$f}; + next if $f eq 'series'; + snag 'unused-patches', "Unused patch file $f will be discarded"; + } +} + sub cmd_convert_from_gbp () { badusage "want only 1 optional argument, the upstream git commitish" unless @ARGV<=1; @@ -2437,6 +2455,8 @@ END "upstream ($upstream) contains debian/ directory"; } + check_series_has_all_patches $old_head; + my $previous_dgit_view = eval { my @clogcmd = qw(dpkg-parsechangelog --format rfc822 -n2); my ($lvsn, $suite); @@ -2587,6 +2607,8 @@ END } } + check_series_has_all_patches $head; + snags_maybe_bail_early(); my $version = upstreamversion $clogp->{Version}; |