Skip to content

Commit 57a987d

Browse files
author
Yegor Bugayenko
committed
#7 more git options
1 parent 629e2d2 commit 57a987d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/hoc/git.rb

+10-3
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,20 @@ def hits
3535
version = `git --version`.split(/ /)[2]
3636
fail "git version #{version} is too old, upgrade it to 2.0+" unless
3737
Gem::Version.new(version) >= Gem::Version.new('2.0')
38-
log = `git '--git-dir=#{@dir}/.git' log --pretty=tformat: --numstat`
38+
cmd = [
39+
'git',
40+
"'--git-dir=#{@dir}/.git'",
41+
'log', '--pretty=tformat:', '--numstat',
42+
'--ignore-space-change', '--ignore-all-space',
43+
'--ignore-submodules', '--no-color',
44+
'--find-copies-harder', '-M', '--diff-filter=ACDM'
45+
].join(' ')
3946
[
4047
Hits.new(
4148
Time.now,
42-
log.split(/\n/).delete_if(&:empty?).map do |t|
49+
`#{cmd}`.split(/\n/).delete_if(&:empty?).map do |t|
4350
t.split(/\t/).take(2).map { |s| s.to_i }.inject(:+)
44-
end.inject(:+)
51+
end.inject(:+) || 0
4552
)
4653
]
4754
end

0 commit comments

Comments
 (0)