Analyze Git History with Commit Canvas
Job to be done: Analyze Git repository history to identify narrative 'chapters' and significant periods like 'gaps' or 'sprints'.
🇳🇬 Ways to use this in Nigeria
Ideas to get you started, adapt to your situation.
- Student
Analyze your final year project's Git history to spot development sprints and quiet periods before submitting.
- 9-5 employee
Generate a visual timeline of your team's code contributions to identify project milestones and gaps.
- Entrepreneur
Visualize your startup's product development timeline from Git commits to share with investors.
What you’ll get
You will get a single HTML file that visually represents your Git repository’s history as a story. This file acts as a ‘scrubbable time machine’ for your project, highlighting significant periods like sprints, quiet gaps, and overall project development arcs. This approach works because it translates raw commit data into a narrative, making complex project timelines understandable at a glance.
Tools you need
- Git (free): A system for tracking changes in your code and collaborating with others. You need this to access your project’s history.
- Python (free): A programming language used to run the Commit Canvas script. You need version 3.8 or newer.
- Commit Canvas (free): A script that analyzes your Git history and generates the HTML story file.
Steps
- Install Git: If you don’t have Git installed, download and install it from the official website. Follow the on-screen instructions for your operating system. You should see Git commands working in your terminal after installation.
- Install Python: If you don’t have Python 3.8 or newer installed, download and install it from the official Python website. Make sure to check the option to add Python to your system’s PATH during installation.
You should be able to run
python --versionorpython3 --versionin your terminal and see a version number 3.8 or higher. - Clone the Commit Canvas repository: Open your terminal or command prompt and navigate to where you want to download the Commit Canvas script. Then, run the following command:
You should see a new folder namedgit clone https://github.com/ahmadrrrtx/commit-canvascommit-canvascreated in your current directory. - Navigate into the Commit Canvas directory: Change your current directory to the one you just cloned:
Your terminal prompt should now show you are inside thecd commit-canvascommit-canvasfolder. - Run Commit Canvas: Execute the script, providing the path to the Git repository you want to analyze. You can also specify a theme. Replace
/path/to/your/repowith the actual path to your project’s folder.
The script will process your repository’s history. This might take a few moments depending on the size of your Git history. After it finishes, it will automatically open the generated HTML file in your default web browser. You should see a visual representation of your project’s story../run.sh /path/to/your/repo --theme sunset
Original source
This workflow is based on the work by ahmad_rrrtx, who developed Commit Canvas. The author shared their creation on their blog, explaining how they built an algorithm to analyze Git repository history and turn it into a narrative HTML file, highlighting project milestones and quiet periods.
Notes & variations
- Free tier alternative: The primary tool, Commit Canvas, is free and runs locally. The web version mentioned by the author allows pasting a public GitHub URL and runs entirely in your browser, which is also free.
- Common mistake: Ensure you are providing the correct absolute or relative path to your Git repository when running the script. An incorrect path will cause the script to fail.
- Tip for better results: Experiment with different
--themeoptions (e.g.,sunset,night,day) to find a visual style that best suits your project’s story.