GitMounter

A few days ago Julia Evans posted this:

has anyone made a read-only FUSE filesystem for a git repository where every commit is a folder and the folder contains all the files in that commit?

the idea is that you could just run cd COMMIT_ID and poke around instead of checking out the commit

and maybe the branches could be symbolic links to the commit folders?

And I did in fact do something very like that, back when I was playing with FUSE! But I never put it up anywhere cause it had an annoying build process, and didn’t seem to add much, and—

Well, in any case, Evans asked to see it, so here it is, cleaned up to be a plain old SwiftPM package. It should work on macOS and on Linux as long as you have FUSE (macFUSE or libfuse-dev), libgit2, pkg-config, and Swift installed; on Linux you’ll have to create the mount directory first. (If you run the command and it fails it’ll tell you what path it tried to use.)

% swift run mount-git /path/to/checkout

By the way, if you don’t know who Julia Evans is, they make blog posts and zines exploring all sorts of software in a way accessible to newbies and veterans alike, all with a lovely sense of discovery and enjoyment. This follow-up post to the original prompt really underscores their approach:

guys this is such a fun idea I cannot believe people are in the replies trying to explain to me why they think it is impractical

the whole point of computers is to do impractical things and see what happens

You should definitely follow them and/or subscribe to their newsfeed. :-)