Queries

Luis Cañas-Díaz edited this page Nov 8, 2013 · 3 revisions
Clone this wiki locally

Number of commits with merges

SELECT COUNT(*) FROM scmlog;

Number of commits without merges (with no action associated)

SELECT COUNT(distinct(scmlog.id)) FROM scmlog, actions
WHERE scmlog.id = actions.commit_id;

Top 100 git authors, all history

SELECT COUNT(distinct(scmlog.id)) as total, people.email, people.name
FROM scmlog, actions, people
WHERE scmlog.id = actions.commit_id
AND scmlog.author_id = people.id
GROUP BY people.email
ORDER BY total DESC
LIMIT 100

Top 100 git authors, 2013

SELECT COUNT(distinct(scmlog.id)) as total, people.email, people.name
FROM scmlog, actions, people
WHERE scmlog.id = actions.commit_id
AND scmlog.author_id = people.id
AND YEAR(scmlog.date) = 2013
GROUP BY people.email
ORDER BY total DESC
LIMIT 100

Top 100 git authors of merges, 2013

SELECT COUNT(distinct(scmlog.id)) as total, people.email, people.name
FROM scmlog, people
WHERE scmlog.id NOT IN (SELECT commit_id FROM actions)
AND scmlog.author_id = people.id
AND YEAR(scmlog.date) = 2013
GROUP BY people.email
ORDER BY total DESC
LIMIT 100