panproto-git
Bidirectional git to panproto-vcs translation bridge.
Overview
Enables git push cospan main by translating between git repositories and panproto-vcs stores. On import, git trees are parsed through panproto-project to produce structural schemas. On export, schemas are emitted back to source text via panproto-parse emitters.
Import (git to panproto)
- Walk git commit DAG topologically (parents before children)
- For each commit: read all files from the git tree
- Parse each file through its language parser (via
panproto-project) - Assemble project-level schema (coproduct)
- Store schema and create panproto-vcs commit (preserving author, timestamp, message)
Export (panproto to git)
- Load project schema from panproto-vcs commit
- Reconstruct per-file source from interstitial text and leaf literal fragments
- Build nested git tree objects preserving directory hierarchy
- Create git commit with mapped parent pointers
Functoriality
Import preserves DAG structure: parent pointers in panproto-vcs match the git DAG. Composition of imports matches import of composition: import(a ; b) = import(a) ; import(b).
Usage
use import_git_repo;
use MemStore;
let git_repo = open?;
let mut store = new;
let result = import_git_repo?;
println!;
License
MIT