Git says Ryuta Kamizono authored 2 commits on that file, but we say 7. Specifically, these 7 commits:
cb0fdaacb277bd0595bfd73178329922aa24477e
785427b88c01654a441b8a7ed602feb35358285b
2b0b5a75c03d597acfe18c2cd7ac6185732797b2 <-- non merge commit
afc79e3cb0906d06b035ef30411c44ddc2132409
65766ebcc85dca0a777bf3a114a906b43f0bdca6 <-- non merge commit
b7e1ea2eeb524224dc06c08fbb779f99d20dde2f
e6486076f066e4ce6b7e7e8270d54f42667a5075
I think Git don't count merge commits. This makes sense, the person that merges a pull request is not necessarily the author of the thing being merged.
We should do the same, and don't count merge commits when computing the main contributor of a file.
Running
#main_contributor
on a SourceFile returns a different result than asking git directly:I was inspecting the result for the file
activejob/lib/active_job.rb
in rails.This is what we get from our API:
This is what we get when we ask Git
Git says
Ryuta Kamizono
authored 2 commits on that file, but we say 7. Specifically, these 7 commits:I think Git don't count merge commits. This makes sense, the person that merges a pull request is not necessarily the author of the thing being merged.
We should do the same, and don't count merge commits when computing the main contributor of a file.