Identifying code churn with AskGit SQL ↦
In which I detail A SQL query that helps you identify files in a codebase that have “churned” in the past year. In other words, list the files that have been changed by the most number of commits in the last year.
SELECT file,
COUNT(*)
FROM stats
JOIN commits
ON stats.commit_id = commits.id
WHERE commits.author_when > DATE('now', '-12 month')
AND commits.parent_count < 2 -- ignore merge commits
GROUP BY file
ORDER BY COUNT(*) DESC
LIMIT 50
Discussion
Sign in or Join to comment or subscribe