madgit
2025-09-30
I decided to give a lightning talk during Cebula Camp 2025. The title I submitted was: mad git - custom commands for fun and profit. These are my notes describing more or less what this is about. For people coming here right after the talk - hi! Sorry the talk was scuffed, public speaking is crazy stressful. I'm glad you've decided to check out my little internet corner. I hope you like it here.
Let me first introduce myself in a single sentence and then I'm gonna move on to the problem statement. This is not going to surprise you: I'm a programmer, dealing mostly with backend webdev and cybersecurity.
Sometimes I want to read (IYKYK) some code. A lot of code. I go to GitHub and see a user or organization and rarely ever do I end up interested in only one repository. I know we all love git, I'm sure we all love GitHub even more. Maybe instead of clicking through pages of repos I could just clone them all and browse the code directly? But.. what if I want to grab some repos from GitLab (or Forgejo) too? Oh, and I also want to keep my copies up to date!
At this point most people would just G00gle the answer (and figure out there is an official gh cli tool, wtf?) or generate a bash one-liner with GeePiTy and move on with their lives. But you know, I have that weird muscle memory, so I always end up opening the network tab in dev tools first. Little `curl | jq | git` in a for loop and we're good.
This is exactly what I did and for a while I was happy. In a few lines of bash I had a script to clone a list of git links. Updating was super easy too, by the way. I was actually using it more than expected. I'm sure many of you had to write a similar script: walk directories, git pull in all of them. Very easy, very useful, feels good.
This is not all I wanted to do with these repositories. It is however the first basic building block that I would call over and over again... If I'm gonna call it more than once, then I might as well... (Maybe you already see where this is going.) Might as well rewrite it in Rust. It's nothing fancy... But I still put it on crates.io and AUR for convenience. I called the tool madgit - it solves exactly the two of my problems that I stated in the intro. It also allows me to call any arbitrary command in each git repo from a selected directory. There's many directons this could further go... No promises tho! Check out the project README if you're curious.
That's cool - I solved my little problem and published a tool to address it. We all have little scripts and personal tools like that, they are often underrated productivity boosters. Sometimes they seem so insignificant that we don't bother sharing. It seems like it's just not worth the time to clean it up, document and push out. If you're one of those people - publish with no warranty, but just do it.
This got me started on a journey to discover more custom commands made by other people. I know there are also other git wrappers, UIs, TUIs and whatever. I don't want to make a complete list, I just want to share some cool stuff I found. There are two ways that I know of to modify git subcommands without writing a wrapper: (1) alias in the config (here is a gist tutorial for this) and (2) having a git-[subcommand] executable in your `$PATH`. I compiled a list of some custom commands below, all of them are available in AUR. There is a pretty good description of how this works here: https://nathancraddock.com/blog/custom-git-commands/
There is a lot of tools for managing branches and encrypting files, I skipped those. I also skipped demos and examples, sorry for that, but at least the resources are there.
STATS
git-cal - github like contributions calendar on terminal
git-heatgrid - visualize git commits as a calendar heatmap
git-hours - count the time spent on code via git
git-punchcard - show punchcard graphs with git commit activity.
git-quick-stats - simple and efficient way to access various statistics in git repository
git-standup - recall what you did on the last working day
git-summary - script to print a summary of git author contributions
CHANGES
git-chglog - git changelog generator
git-delta - syntax-highlighting pager for git and diff output
git-file-history - easily view the history of a file in a git repository
git-playback - a git command to play back or step through the history of a git-controlled file.
git-when-merged - determine when a particular commit was merged into a git branch
git-who - git blame for file trees
REBASE
git-fiddle - edit commit messages, authors, and timestamps during git-rebase
git-filter-repo - quickly rewrite git repository history (filter-branch replacement)
git-imerge - incremental merge for git
git-machete - git repository organizer & rebase/merge workflow automation tool
git-revise - a git subcommand to efficiently update, split, and rearrange commits
IDENTITY
git-identity - manage your identity in git
git-switcher - git profile switcher switch between your git profiles easily
git-user - git plugin that allows you to save multiple user profiles and set them as project defaults
CLEANUP
git-debubble - clean up merge bubbles in a git repository
git-delete-merged-branches - command-line tool to delete merged git branches.
git-fresh - keep your repo fresh with one command.
git-gone - prune stale local git branches
git-superprune - a git command to prune remote branches that have already been merged
git-trim - trims your git remote tracking branches
git-warp-time - reset file timestamps to repo state
TOOLBOXES
git-commands - fuzzy search git commands with fzf
git-extensions - simple handy extensions for git
git-extras - repo summary, commit counting, repl, changelog population and more
git-toolbelt - a suite of useful git commands that aid with scripting or every day command line usage
git-town - generic, high-level git workflow support
git-x - cli extensions for git that simplify common workflows
git-xargs - making updates across multiple github repositories with a single command
Checking out those git custom commands feels like figuring out nvim plugins again. Maybe some of this is helpful to you. At the end of the day... It's not about the repos we cloned, it's about the journey... It's about the "shitty scripts we threw together and then immediately thrashed" along the way.
Happy hacking everyone!