Dev note - gittykat
Gittykat is the first software that I have built keeping some vision in my mind. I think almost every developer knows about git. Git is the most trustworthy tool of a developer. Why I am talking about git? Because gittykat is closely related to git. I built it on top of git. The goal of writing this article is to tell why I created it in the first place or as a justification of why it's built like that.
We can come to gittykat now. Git is a feature rich and very useful tool. But at some time I felt that it will be good if I have some tool to arrange the git log data into some simple visualisations like a chart/graph in the terminal. Following are the features I needed;
- A contribution graph like the squared dots that we see in github/codeberg that used to indicate the activity. They are showing a users' overall activity. But what I needed was to do it for a single repository that will allow us to find when there is high development activity and during which period there is a drop, etc.
- The second one is to find the most active contributors of the repository.
- And the third one is a language chart which shows the programming languages used in the project. Even though there are some tools specifically for analyzing the languages, I built one my own from scratch before even starting gittykat.
Yeah, these were my requirements. The data I needed was already in the git and git log can be used to access it. And for the language analysis part, I have already built it earlier (it was named codestats at that time) and I just need to merge it with the new tool. So I started to build it. At that time my plan was to not use any third party crates and just use the git tools' builtin functions to retrieve the data and show it in the command line. And I succeeded in it (and also failed in analyzing very large git repositories).
The next step was adding a GUI(Yes, from this point onwards I started to add third party crates/libraries). Since I currently use rust for most of my projects I searched for a GUI framework in rust and finally landed on the iced framework and started learning it(It was a bit difficult at first because there is'nt complete documentation. So I relied on information from multiple sources, examples and others' code). Actually both learning and building went parrallel. The next step was to scale it for larger repositories. For that I need to use external crates and stop relying on the git binary. Two options were git2 and gix. Since gix was newer and completely built from scratch in rust I went with that one(Yeah I like to explore latest ones). At that time I made some decisions on how the app should be.
- Since we can do most things using the git cli I should only implement what's not in the git cli.
- It should'nt be another git client(There are already many, so why should I do something that is already available, so I decided to stick to my 3 primary requirements).
- The app should only read the files, it shouldn't do a single modification to the repository.
- I shouldn't replicate the data in any form.
Further development was based on these. The software is published under the MIT license. I don't know if anyone actually uses it. But if anyone needs it then it is there.