diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-10-01 13:51:05 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-10-01 13:57:27 +0100 |
commit | 66b0259a66150cf67d5219400f8f89849c7d3c06 (patch) | |
tree | 3375f42d68248894f435a3728eb5027c99820acb /dgit | |
parent | 27eaad917a904c00ce81d0b7e2e37d61bf177c8d (diff) |
dgit: Refactor and simplify `quilt fixup cannot be linear' generation
Fold $reportnot into its one call site, and make the print a simple
substitution rather than a complex concatenation.
No functional change.
This will make the translation markup auditable.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -5519,19 +5519,14 @@ sub quiltify ($$$$) { $x =~ s/(.*?[0-9a-z]{8})[0-9a-z]*$/$1/; return $x; }; - my $reportnot = sub { - my ($notp) = @_; - my $s = $abbrev->($notp); - my $c = $notp->{Child}; - $s .= "..".$abbrev->($c) if $c; - $s .= ": ".$notp->{Whynot}; - return $s; - }; if ($quilt_mode eq 'linear') { print STDERR "\n$us: error: quilt fixup cannot be linear. Stopped at:\n"; my $all_gdr = !!@nots; foreach my $notp (@nots) { - print STDERR "$us: ", $reportnot->($notp), "\n"; + my $c = $notp->{Child}; + my $cprange = $abbrev->($notp); + $cprange .= "..".$abbrev->($c) if $c; + print STDERR "$us: $cprange: $notp->{Whynot}\n"; $all_gdr &&= $notp->{Child} && (git_cat_file $notp->{Child}{Commit}, 'commit') =~ m{^\[git-debrebase(?! split[: ]).*\]$}m; |