23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/grog/git_log.rb', line 23
def to_s
@log_lines.map do |line|
values = Hash[*@@placeholders.zip(line.split('|||')).flatten]
sha = GitLog.short_sha1(values['H'])
date = GitLog.nice_date_format(values['ai'])
subject = values['s']
author = values['an']
branches = branches(values['H'])
tags = tags(values['H'])
line =
Term::ANSIColor.yellow + sha + ' '
if @options[:show_datetimes]
line +=
Term::ANSIColor.green + date + ' '
end
line +=
Term::ANSIColor.reset + subject + ' ' +
Term::ANSIColor.green + "(#{author})" + Term::ANSIColor.reset
unless branches.empty?
line += " B(" + Term::ANSIColor.red + branches.join(' ') + Term::ANSIColor.reset + ")"
end
unless tags.empty?
line += " T(" + Term::ANSIColor.cyan + tags.join(' ') + Term::ANSIColor.reset + ")"
end
line + "\n"
end.join
end
|