summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2c46759)
raw | patch | inline | side by side (parent: 2c46759)
author | Paolo Bonzini <paolo.bonzini@lu.unisi.ch> | |
Wed, 28 Feb 2007 20:02:02 +0000 (21:02 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 28 Feb 2007 20:38:08 +0000 (12:38 -0800) |
Don't fail if the summary line in an arch commit is empty. In this case,
try to use the first line in the commit message followed by an ellipsis.
In addition, if the summary is multi-line, it is joined on a single line.
Signed-off-by: Junio C Hamano <junkio@cox.net>
try to use the first line in the commit message followed by an ellipsis.
In addition, if the summary is multi-line, it is joined on a single line.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-archimport.perl | patch | blob | history |
diff --git a/git-archimport.perl b/git-archimport.perl
index 66aaeae1021eb3c791815f927e95a87e7afa557c..0fcb156d14298e23658b6f495d7ed201b260834e 100755 (executable)
--- a/git-archimport.perl
+++ b/git-archimport.perl
my $pid = open2(*READER, *WRITER,'git-commit-tree',$tree,@par)
or die $!;
- print WRITER $ps->{summary},"\n";
+ print WRITER $ps->{summary},"\n\n";
print WRITER $ps->{message},"\n";
# make it easy to backtrack and figure out which Arch revision this was:
$ps->{tag} = $1;
$key = undef;
} elsif (/^Summary:\s*(.*)$/ ) {
- # summary can be multiline as long as it has a leading space
+ # summary can be multiline as long as it has a leading space.
+ # we squeeze it onto a single line, though.
$ps->{summary} = [ $1 ];
$key = 'summary';
} elsif (/^Creator: (.*)\s*<([^\>]+)>/) {
}
}
- # post-processing:
- $ps->{summary} = join("\n",@{$ps->{summary}})."\n";
+ # drop leading empty lines from the log message
+ while (@$log && $log->[0] eq '') {
+ shift @$log;
+ }
+ if (exists $ps->{summary} && @{$ps->{summary}}) {
+ $ps->{summary} = join(' ', @{$ps->{summary}});
+ }
+ elsif (@$log == 0) {
+ $ps->{summary} = 'empty commit message';
+ } else {
+ $ps->{summary} = $log->[0] . '...';
+ }
$ps->{message} = join("\n",@$log);
# skip Arch control files, unescape pika-escaped files