summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2014-11-16 20:21:42 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2014-11-16 20:37:02 +0000
commit70a10f7722f0bd52c782416df01bbacf42435843 (patch)
tree8402857bca223bd14ac1b68de35e13c9a3e6f3cf
parent4423ff8ec350aa17c19f63dd6d7f3efa42ddd856 (diff)
quiltify_dpkg_commit: Improve
* Coalesce $msg and $title * New optional $xinfo argument * Squah trailing whitespace (eg blank lines)
-rwxr-xr-xdgit13
1 files changed, 7 insertions, 6 deletions
diff --git a/dgit b/dgit
index fcaf386..af95766 100755
--- a/dgit
+++ b/dgit
@@ -2039,19 +2039,20 @@ our $dscfn;
our $fakeeditorenv = 'DGIT_FAKE_EDITOR_QUILT';
-sub quiltify_dpkg_commit ($$$$) {
- my ($patchname,$title,$author,$msg) = @_;
+sub quiltify_dpkg_commit ($$$;$) {
+ my ($patchname,$author,$msg, $xinfo) = @_;
+ $xinfo //= '';
mkpath '.git/dgit';
my $descfn = ".git/dgit/quilt-description.tmp";
open O, '>', $descfn or die "$descfn: $!";
+ $msg =~ s/\s+$//g;
$msg =~ s/\n/\n /g;
$msg =~ s/^\s+$/ ./mg;
print O <<END or die $!;
-Description: $title
- $msg
+Description: $msg
Author: $author
-
+$xinfo
---
END
@@ -2074,7 +2075,7 @@ sub quiltify ($$) {
quiltify_dpkg_commit "auto-$version-$headref-$time",
(getfield $clogp, 'Maintainer'),
- "Automatically generated patch ($clogp->{Version})",
+ "Automatically generated patch ($clogp->{Version})\n".
"Last (up to) $ncommits git changes, FYI:\n\n". $msg;
}