the linked repository is amazing, I don't think I ever saw such nice code and such neat organization: https://github.com/jcoglan/jit (everything uses standard ruby libraries or default gems like minitest)
I'm trying it out and doesn't work very well on macOS (git add has issue with the lockfile, but all tests pass).
I might use it as it's a very easily customizable implementation of git.