All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 88d58066 authored by Robert Ricci's avatar Robert Ricci

Add support for muliple summary styles

Currently supports 'hashes' (like the style supported before), and
'bare', whch omits the hashes (but does do a little indenting)
parent 16c774a4
......@@ -207,6 +207,13 @@ my $summary_threshold = get_config("summarythreshold",2);
#
my $disable_summary = get_config("nosummary",undef);
#
# Style used for displaying summaries. Supported styles:
# hashes - Include hash and summary
# bare - Include summary only
#
my $summary_style = get_config("summarystyle","hashes");
######################################################################
# Constants
######################################################################
......@@ -1115,7 +1122,16 @@ 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 $oneliner = `$GIT log --oneline '$rev~'..'$rev'`;
my $revs = "'$rev~'..'$rev'";
my $oneliner;
if ($summary_style eq "hashes") {
$oneliner = `$GIT log --oneline $revs`;
} elsif ($summary_style eq "bare") {
$oneliner = `$GIT log --format='format: %s' $revs`;
} else {
warn "gitmail: Bad summary style '$summary_style'\n";
$oneliner = `$GIT log --oneline $revs`;
}
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