How It Works

How we built git rewind.

Components in the stack

1

File System Access API

You grant access to your git repo through Chrome/Edge's File System Access API. This provides access to your files from the javascript world.

2

Emscripten MEMFS

All the files from your .git directory get synced into an in-memory filesystem. This is needed because the javascript API for filesystem access is async and Emscripten unfortunately can't tunnel filesystem requests from libgit2 directly through to the javascript API.
Therefore we have to copy all the files into the virtual in-memory filesystem so libgit2 can the read them.

3

libgit2 WASM

libgit2 is a C library used by GitHub Desktop and many other git tools. It's compiled to WebAssembly and this way we handle all git internals: packed objects, refs, commit history, etc.

4

Typescript processing

libgit2 with a C wrapper around it returns most interesting information to our typescript/Svelte frontend and there we may filter on author or do some additional processing before rendering it on the page. As the frontend code also runs locally in your browser, none of your repo's contents every leave your machine.

Browser Support

Works on desktop browsers that support the File System Access API:

  • Chrome
  • Edge
  • Opera
  • Unfortunately no Firefox, Safari or any mobile browsers

See caniuse.com for more information.