Skip to contentSkip to conversation

Make git-archimport log entries more consistent

PATCH New Miles Bader 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make git-archimport log entries more consistent

When appending the "git-archimport-id:" line to the end of log entries, git-archimport would use two blank lines as a separator when there was no body in the arch log (only a Summary: line), and zero blank lines when there was a body (making it hard to see the break between the actual log message and the git-archimport-id: line).

This patch makes git-archimport generate one blank line as a separator in all cases.

---
 git-archimport.perl |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
git-archimport.perl +5 -1
index b210772..9e38ba5 100755
@@ -595,8 +595,12 @@ foreach my $ps (@psets) {
     my $pid = open2(*READER, *WRITER,'git-commit-tree',$tree,@par)
         or die $!;
     print WRITER $ps->{summary},"\n\n";
-    print WRITER $ps->{message},"\n";
 
+    # only print message if it's not empty, to avoid a spurious blank line;
+    # also append an extra newline, so there's a blank line before the
+    # following "git-archimport-id:" line.
+    print WRITER $ps->{message},"\n\n" if ($ps->{message} ne "");
+    
     # make it easy to backtrack and figure out which Arch revision this was:
     print WRITER 'git-archimport-id: ',$ps->{id},"\n";
 
Signature · 1 line
1.5.3.rc3.91.g5c75-dirty