Commit 8e634629 authored by Robert Ricci's avatar Robert Ricci
Browse files

Fix summary for merge commits

Problem before was that I was using 'git log' of the commit and
its parent, which doesn't work as I intended when there's more than
one parent. Instead, use 'git show -s', which is helpfully not
documented in the manpage for git-show, but instead the manpage for
git-shortlog
parent efd4fbe2
......@@ -1233,19 +1233,18 @@ sub get_summary($) {
my ($rev) = @_;
# I would imagine there's a less hacky way to get the summary of one
# commit? 'git show' insists on printing the diff, though
my $revs = "'$rev~'..'$rev'";
my $oneliner;
if ($summary_style eq "hashes") {
$oneliner = `$GIT log --oneline $revs`;
$oneliner = `$GIT show -s --oneline $rev`;
} elsif ($summary_style eq "bare") {
$oneliner = `$GIT log --format='format:%s' $revs`;
$oneliner = `$GIT show -s --format='format:%s' $rev`;
} elsif ($summary_style eq "list") {
$oneliner = `$GIT log --format='format: - %s' $revs`;
$oneliner = `$GIT show -s --format='format: - %s' $rev`;
} elsif ($summary_style eq "name") {
$oneliner = `$GIT log --format='format:%cN: %s' $revs`;
$oneliner = `$GIT show -s --format='format:%cN: %s' $rev`;
} else {
warn "gitmail: Bad summary style '$summary_style'\n";
$oneliner = `$GIT log --oneline $revs`;
$oneliner = `$GIT log --oneline $rev`;
}
chomp $oneliner;
return substr($oneliner,0,72);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment