chiark / gitweb /
quiltify_dpkg_commit: Improve
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Nov 2014 20:21:42 +0000 (20:21 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Nov 2014 20:37:02 +0000 (20:37 +0000)
* Coalesce $msg and $title
* New optional $xinfo argument
* Squah trailing whitespace (eg blank lines)

dgit

diff --git a/dgit b/dgit
index fcaf386f6584bfe1ab44cf40fd1ef0b285b9f540..af9576670a3fa219e8d991e6b16872510c3fd2f6 100755 (executable)
--- 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;
 }