tig — tiny git

tig は tiny git の略。no_std Rust による git client で、ブラウザ (WASM)、組み込み (Cortex-M / RISC-V)、ホストの全てで同一の core が動く。外部 crate 依存なし。

Playground

Playground はこのライブラリの web frontend そのもので、wasm 約 105 KB がブラウザ内で動く。git bundle ファイルを開いて refs / 履歴 / commit を閲覧できるほか、smart HTTP の URL から直接 clone して bundle をダウンロードでき、開いている bundle を smart HTTP の URL へ push できる。

ブラウザからの clone / push は対象サーバが CORS を許可している場合に限る (同一オリジンまたは proxy 経由を推奨)。bundle の閲覧はネットワーク不要で、データはブラウザの外に出ない。

できること

$ tig clone http://host/repo.git --depth 1   # smart HTTP から bundle へ clone
$ git bundle create repo.bundle --all        # またはオフライン配布 (通常の git)
$ tig refs repo.bundle
$ tig log repo.bundle --ref refs/heads/main -n 10
$ tig cat-file repo.bundle <oid>

構成

crate内容
tig-coreno_std (+ alloc) の本体。SHA-1 / zlib inflate / object / pack / bundle / history walk / protocol v2 をすべて自前実装
tig-cliCLI (std)。clone / push / checkout と bundle の閲覧
tig-webブラウザ frontend。wasm-bindgen 不使用 (C ABI + 手書き JS glue)

検証

実物の git との差分テストを主軸とする。git が生成した repository / bundle に対して refs・履歴順序・全 object 内容を突き合わせ、clone は git http-backend との end-to-end テストで git 自身が bundle を verify / clone できることまで確認している。詳細は docs/design.md を参照。