Skip to content

Instantly share code, notes, and snippets.

@patrickdevivo
Created September 11, 2021 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrickdevivo/21648e607ef340ee6d94b84310f0d57e to your computer and use it in GitHub Desktop.
Save patrickdevivo/21648e607ef340ee6d94b84310f0d57e to your computer and use it in GitHub Desktop.
-- average time (in days) since a line of code was last modified
-- broken out by author_name
SELECT
author_name,
AVG(julianday(datetime('now')) - julianday(author_when)) AS avg_age
FROM files, blame('', '', path)
JOIN commits ON hash = commit_hash
GROUP BY author_name
ORDER BY avg_age
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment