diff --git a/lib/git_stats/git_data/author.rb b/lib/git_stats/git_data/author.rb index 1c0f714b17..79971170e5 100644 --- a/lib/git_stats/git_data/author.rb +++ b/lib/git_stats/git_data/author.rb @@ -6,7 +6,7 @@ module GitData class Author include HashInitializable - attr_reader :repo, :name, :email + attr_reader :repo, :name def commits @commits ||= repo.commits.select { |commit| commit.author == self } @@ -55,11 +55,11 @@ def dirname end def to_s - "#{self.class} #@name <#@email>" + "#{self.class} #@name" end def ==(other) - [self.repo, self.name, self.email] == [other.repo, other.name, other.email] + [self.repo, self.name] == [other.repo, other.name] end end diff --git a/lib/git_stats/git_data/command_parser.rb b/lib/git_stats/git_data/command_parser.rb index 756fd6a0ec..f6830db969 100644 --- a/lib/git_stats/git_data/command_parser.rb +++ b/lib/git_stats/git_data/command_parser.rb @@ -9,8 +9,8 @@ def parse(command, result) def parse_shortlog(result, params) result.lines.map do |line| - commits, name, email = line.scan(/(.*)\t(.*)<(.*)>/).first.map(&:strip) - {commits: commits.to_i, name: name, email: email} + commits, name = line.scan(/(.*)\t(.*)/).first.map(&:strip) + {commits: commits.to_i, name: name} end end @@ -23,8 +23,8 @@ def parse_ls_tree(result, params) def parse_rev_list(result, params) result.lines.map do |line| - sha, stamp, date, author_email = line.split('|').map(&:strip) - {sha: sha, stamp: stamp, date: date, author_email: author_email} + sha, stamp, date, author_name = line.split('|').map(&:strip) + {sha: sha, stamp: stamp, date: date, author_name: author_name} end end diff --git a/lib/git_stats/git_data/repo.rb b/lib/git_stats/git_data/repo.rb index c218aaa7ca..d782d7216b 100644 --- a/lib/git_stats/git_data/repo.rb +++ b/lib/git_stats/git_data/repo.rb @@ -17,19 +17,19 @@ def initialize(params) end def authors - @authors ||= run_and_parse("git shortlog -se #{commit_range}").map do |author| - Author.new(repo: self, name: author[:name], email: author[:email]) + @authors ||= run_and_parse("git shortlog -s #{commit_range}").map do |author| + Author.new(repo: self, name: author[:name]) end.extend(ByFieldFinder) end def commits - @commits ||= run_and_parse("git rev-list --pretty=format:'%h|%at|%ai|%aE' #{commit_range} | grep -v commit").map do |commit_line| + @commits ||= run_and_parse("git rev-list --pretty=format:'%h|%at|%ai|%aN' #{commit_range} | grep -v commit").map do |commit_line| Commit.new( repo: self, sha: commit_line[:sha], stamp: commit_line[:stamp], date: DateTime.parse(commit_line[:date]), - author: authors.by_email(commit_line[:author_email]) + author: authors.by_name(commit_line[:author_name]) ) end.sort_by! { |e| e.date }.extend(ByFieldFinder) end diff --git a/templates/activity/_activity.haml b/templates/activity/_activity.haml index 6b439ef51f..b8c932102c 100644 --- a/templates/activity/_activity.haml +++ b/templates/activity/_activity.haml @@ -19,7 +19,7 @@ .tab-pane.active .page-header.pagination-centered %h1= page.t - %h3= "#{author.respond_to?(:name) ? author.name : ""} #{author.respond_to?(:email) ? "<#{author.email}>" : ""}" + %h3= author.respond_to?(:name) ? author.name : "" - if page == :activity_by_date = high_stock("charts.activity_by_date", charts.activity_by_date(author)) @@ -98,4 +98,4 @@ %tr %th= year - (1..12).each do |month| - %td= months[month] \ No newline at end of file + %td= months[month] diff --git a/templates/authors/_authors.haml b/templates/authors/_authors.haml index bdeac9bcc1..c14c34d7c9 100644 --- a/templates/authors/_authors.haml +++ b/templates/authors/_authors.haml @@ -31,7 +31,7 @@ - sorted_authors.each_with_index do |author, i| %tr %th= i+1 - %th= "#{author.name} <#{author.email}>" + %th= "#{author.name}" %td= author.commits.size %td= author.insertions %td= author.deletions