home shape

Git Commit Analysis with ArangoDB: Insightful Data Exploration

I often find myself searching for certain commits using git log and friends. While I really love the power and flexibility that come with the git and other Unix command-line tools, sometimes it can be more convenient to use a database to filter and aggregate commit data.

I gave it a quick try yesterday and imported the commit history of ArangoDB’s Git repository into ArangoDB and ran some queries on the data.

// retrieving number of commits per month / year
query = 'FOR commit IN commits 
           COLLECT year = DATE_YEAR(commit.date), month = DATE_MONTH(commit.date) 
           WITH COUNT INTO count 
         RETURN { month: CONCAT(year, "/", month), count: count }';
db._query(query).toArray();

While the query results for our repository may not be interesting for everyone, I think it is still worth sharing what I did. Even though I didn’t try it, I think the overall procedure is applicable with any other Git repository.

More queries and how to convert and import Git commits in ArangoDB: Read on in Jan’s Blog

Jan Steemann

Jan Steemann

After more than 30 years of playing around with 8 bit computers, assembler and scripting languages, Jan decided to move on to work in database engineering. Jan is now a senior C/C++ developer with the ArangoDB core team, being there from version 0.1. He is mostly working on performance optimization, storage engines and the querying functionality. He also wrote most of AQL (ArangoDB’s query language).

Leave a Comment





Get the latest tutorials, blog posts and news: