gg: git git
A tool to git all your gits and answer the age-old question: "Where my gits at?"
1 What?
gg searches your hard drive for git repositories and outputs some data about their locations and state (roots, heads, remotes, etc.).
directory tree index
DOT (for Graphviz)
serialized (for later re-consumption)
Putting that data into a git repository itself and then repeating the same process on all your machines, will give you a catalogue of all your repos and show their relationships.
2 Why?
2.1 Problem!
You may have several machines in use at any given time, with subsets of all repos sparsely scattered across.
Same repo’s replica directories may end-up named differently.
You may end-up missing a local copy of an Internet-hosted replica.
You may have orphaned local repos (with no remotes)
You can end-up with any combination of the above scenarios!
2.2 Solution?
So, how to be sure everything is in sync?
Find all the repos and confirm what is a fork of what (sharing an ancestor);
Compare their status to understand what is out of date;
Decide what should be pruned, moved, updated or whatever;
GOTO 1
gg is mainly motivated by 1, but also aims to be useful for 2.
See the example meta-repo in gg’s source repo.
3 Compatibility
Due to a dependency on the Unix find utility, only Unix-like operating systems are currently supported and the only ones I’ve tested gg on are:
Void Linux
Debian 10
Ubuntu 18.04
This dependency isn’t strictly necessary, it’s just much faster than Racket’s find-files. I’ll eventually get around to adding a fallback on find-files when system find isn’t available.