Patrick DeVivo askgit.com

AskGit - query your git repo with SQL  ↦

Built in Go, askgit is an open source CLI and coming soon web interface (linked above). With this tool in your toolbox, you can mine your repo for info like commit count by author on each day of the week:

SELECT
    count(*) AS commits,
    count(CASE WHEN strftime('%w',author_when)='0' THEN 1 END) AS sunday,
    count(CASE WHEN strftime('%w',author_when)='1' THEN 1 END) AS monday,
    count(CASE WHEN strftime('%w',author_when)='2' THEN 1 END) AS tuesday,
    count(CASE WHEN strftime('%w',author_when)='3' THEN 1 END) AS wednesday,
    count(CASE WHEN strftime('%w',author_when)='4' THEN 1 END) AS thursday,
    count(CASE WHEN strftime('%w',author_when)='5' THEN 1 END) AS friday,
    count(CASE WHEN strftime('%w',author_when)='6' THEN 1 END) AS saturday,
    author_email
FROM commits GROUP BY author_email ORDER BY commits

Discussion

Sign in or Join to comment or subscribe

2020-08-29T23:14:14Z ago

This got me very interested in this. I wrote up a tutoral using askgit https://willschenk.com/articles/2020/using_askgit/ and then another one for populating a sqlite database straight from the git log, which gives you a bit more insight into specific code changes here: https://willschenk.com/articles/2020/gitlog_in_sqlite/

It’s an approach I wouldn’t have thought of without seeing your post in my feed, and then I kept running with it, so great work!

Jerod Santo

Jerod Santo

Omaha, Nebraska

Jerod co-hosts The Changelog, crashes JS Party, and takes out the trash (his old code) once in awhile.

2020-09-01T14:11:54Z ago

Very cool @wschenk, thanks for letting us know! Btw, whenever you write cool stuff in the future make sure to submit it so we can link you up as well ✊

(I just interviewed Jon Evans for The Changelog last week. You might enjoy that one. #HFC)

Player art
  0:00 / 0:00