id: BB-RESEARCH-ZQOAYUPA type: research title: Luigit implementation languages and libraries
Luigit implementation languages and libraries
Scope
Compare implementation languages and embeddable libraries for Git objects, Git notes, signatures, syntax highlighting, textual diff, and optional semantic diff. The binding constraints are one application executable, no runtime helpers, no outbound network requirement, server-rendered core browsing, hostile public input, and both SHA-1 and SHA-256 repositories.
Facts
The object-format requirement selects the foundation
Current gix exposes independent sha1 and sha256 features across its hash, object, pack, notes, and archive stack.
Both may be compiled into one Rust application.
Its current package is pre-1.0, recommends explicit feature selection, and has a broad internal crate graph.
Dual-hash behavior is therefore available but requires a fixture-level compatibility gate.
Stable go-git v5 selects SHA-1 or SHA-256 at compile time through mutually exclusive build variants.
One ordinary v5 executable cannot inspect both formats.
The v6 line intended to remove this restriction remains prerelease.
JGit explicitly lists SHA-256 object IDs among unsupported features. Its SHA-256 support issue remains open. Libgit2 1.9 keeps SHA-256 support experimental and disabled by default.
Canonical Git supports both formats but is excluded as a spawned runtime helper.
Under the current requirements, Rust with gix is the only surveyed foundation that claims both object formats inside one application executable without experimental or prerelease Git support.
Sources: gix features, gix-hash, go-git SHA-1 build, go-git SHA-256 build, JGit README, JGit SHA-256 issue, libgit2 build options.
Git objects and history
gix reads loose and packed objects, refs, commits, trees, blobs, annotated tags, commit graphs, revision walks, merge bases, tree changes, blame, and archives.
Repository opening supports reduced-trust configuration and bounded object caches.
Its lower-level crates permit a narrower build than the default gix feature bundle.
gix-diff performs tree changes and uses imara-diff for blob comparison.
imara-diff supplies linear-space Myers and histogram algorithms, ordered hunks, indentation-aware postprocessing, and performance heuristics derived from Git and GNU diff.
It does not promise byte-identical Git hunk selection.
similar offers deadline-aware textual algorithms but documents that highly dissimilar inputs can run excessively long without a deadline.
The smallest credible split is gix for Git facts and object access, then imara-diff for the application-owned textual model.
Rename detection remains a separately bounded Git fact because exhaustive candidate comparison can become quadratic.
Sources: gix::Repository, gix-diff, imara-diff, similar, Git diffcore.
Git notes
The current gix-note crate understands progressive hexadecimal fanout and supports both configured note lookup and note-tree editing.
The high-level API can discover selected notes refs and return all notes attached to one target, preserving the source namespace.
It does not expose a public iterator over every note mapping. A repository-wide notes explorer must traverse the selected notes commit tree, validate note paths against the active object-ID length, and load the referenced blobs. Notes history is ordinary commit history on each notes ref and can use the same revision and signature machinery.
Read-only mounts remain the authority because gix also exposes mutation APIs and has no immutable repository handle.
Luigit needs only the small missing read-only enumeration path, not a notes abstraction or mutation layer.
Sources: gix notes API, gix-note, Git notes.
Signature extraction and verification are separate
Git stores commit signatures in multiline headers and appends annotated-tag signatures to the signed tag payload. Supported armor families are OpenPGP, SSH, and X.509. Verification must use exact stored object bytes with only the signature field or suffix excluded.
gix-object detects all three formats and returns the exact signed bytes for commits and annotated tags.
Its high-level signing and verification facilities execute external programs and are therefore ineligible.
The parser and extraction types remain usable without those facilities.
Cryptographic validity, signer identity, key binding, trust, expiry, and revocation are different results. No surveyed Rust library combines these policies across all three formats. Luigit must not collapse a mathematically valid signature into a verified identity.
Sources: Git signature formats, gix-object signature extraction, gix-object commit parser.
OpenPGP candidates
sequoia-openpgp verifies detached signatures under an explicit policy and exposes certificate, binding, validity, and revocation information.
It deliberately leaves identity trust to the application.
Its LGPL license and default native crypto backend complicate static redistribution, though alternate backends exist.
rPGP is pure Rust, MIT or Apache-2.0 licensed, supports detached signatures and current OpenPGP formats, and avoids native crypto linkage.
Its documentation explicitly limits the library to wire format, composite objects, and cryptographic operations; higher-level OpenPGP semantics remain application work.
Sequoia has the stronger verification-policy model.
rPGP has the cleaner one-executable and license fit.
Neither removes the need for an authoritative key-to-identity binding.
Sources: sequoia-openpgp detached verification, sequoia-openpgp verification policy, rPGP, OpenPGP RFC 9580.
SSH signatures
The Rust ssh-key crate parses OpenSSH sshsig envelopes and verifies signatures in-process.
The envelope proves possession of its embedded key but does not authorize that key for a person, repository, or Git identity.
Git's allowed-signers and revocation-file semantics remain application policy. Possible Soft Serve account-key data can become an authority only after separate metadata and trust research.
Sources: ssh-key::SshSig, OpenSSH SSHSIG protocol, Git signature configuration.
X.509 and S/MIME signatures
The Rust openssl crate exposes detached CMS verification through OpenSSL and can validate signing certificates against an application-supplied X.509 store.
Local certificate revocation lists may participate in that store; no outbound revocation lookup is implied.
Git identity binding and acceptable certificate purposes remain application policy.
Pure-Rust CMS crates can verify low-level signatures but do not currently provide a complete certification-path, purpose, and revocation solution. OpenSSL is the mature candidate despite adding native build and static-linking work.
Sources: openssl::cms::CmsContentInfo, CMS RFC 5652, X.509 path validation RFC 5280, cryptographic-message-syntax.
Syntax highlighting
syntect renders Sublime Text grammars server-side and preserves source slices while adding presentation markup.
two-face packages the maintained grammar set curated by bat into the executable.
The combination gives broad language coverage without browser JavaScript or runtime grammar files.
The Oniguruma backend supports the full grammar set and can be statically linked into one executable, but requires C compilation.
The pure-Rust fancy-regex backend excludes incompatible grammars, including important JavaScript and PowerShell variants.
Bundled grammars and themes retain their upstream licenses and require generated acknowledgements.
tree-sitter-highlight offers structural locals, injections, and cooperative cancellation.
It requires one parser and query set per language, each separately selected, built, licensed, and maintained.
Without an accepted semantic-diff stack to share those parsers, it is more machinery than the highlighting requirement needs.
Chroma is the equivalent strong Go choice, but choosing it would not repair stable go-git's dual-hash limitation. Shiki and Pierre remain browser enhancements rather than the no-JavaScript baseline.
Sources: syntect, two-face, tree-sitter-highlight, Chroma, Shiki bundles, @pierre/diffs.
Semantic diff has no accepted library
Difftastic is the strongest complete product reference: Tree-sitter parsing, source positions, byte and graph limits, parse-error handling, and textual fallback. Its Cargo package exposes a binary, not a stable library. Invoking it would violate the runtime-helper constraint.
syndiff is an embeddable Difftastic-inspired Rust library with source byte ranges and an explicit graph-vertex limit.
Its worst-case time and space remain quadratic in syntax-tree size, its release history is small, and its package metadata exposes no source repository.
It supplies neither parser selection nor textual fallback.
cinereus is a generic Rust GumTree-style matcher with insert, delete, update, move, and node-mapping output.
It provides no parser, source-span contract, cancellation, resource limits, or fallback.
GumTree remains the mature generic matcher but requires the JVM and separate parser integrations.
Mergiraf solves three-way merge, not two-way diff.
Ast-grep solves structural search and rewriting, not cross-revision matching.
No candidate currently meets the requirement for a vetted, maintained, general-purpose semantic-diff library with parsing, source mapping, bounded work, fallback, and one-executable packaging.
Sources: Difftastic source, Difftastic limits, syndiff, cinereus, GumTree, Mergiraf architecture, ast-grep.
Packaging and security consequences
Rust can produce one deployable executable while statically incorporating Oniguruma, OpenSSL, and selected parser code. That result still has a native build supply chain and per-library license obligations. One executable is not equivalent to pure Rust.
gix, highlighting, textual diff, and every signature verifier process hostile repository bytes.
Library limits are partial.
The application still needs byte, line, node, graph, output, concurrency, elapsed-work, cache, and container limits, plus read-only repository mounts.
No Git foundation surveyed exposes a repository-wide immutable capability. Filesystem permissions are therefore the trust boundary, not API discipline.
Conclusions
Rust is the implementation-language choice unless the dual-hash requirement changes or another Git foundation matures. This conclusion follows from a binding capability gap, not generic language preference.
Use this provisional library stack:
gixwith explicit SHA-1, SHA-256, revision, and notes features for Git facts and objects.imara-difffor the canonical textual hunk model; validate output quality and Git compatibility with fixtures.gix-objectonly for exact signature extraction; never enable or call external-program verification.sequoia-openpgpas the technically stronger OpenPGP verifier, subject to license and static-build acceptance; retainrPGPas the permissive pure-Rust counter-candidate.ssh-keyfor SSH signature cryptography, with trust binding supplied separately.opensslCMS verification for X.509 and S/MIME, with only deployment-supplied trust material.syntectplustwo-facesyntaxes for mandatory server-side highlighting, with Nugu-derived class styling and escaped plain-text fallback.
Do not select a semantic-diff dependency yet. The feature is optional by specification, while every current candidate violates maintenance, boundedness, packaging, or stable-library requirements. Textual diff remains authoritative.
Do not select Go v5, JGit, or libgit2 while simultaneous SHA-1 and SHA-256 support remains mandatory. Re-evaluate Go when go-git v6 becomes stable and demonstrates notes, exact signature extraction, and dual-format compatibility.
Unresolved questions
- Does
gixpass the complete SHA-1 and SHA-256 fixture suite for refs, packs, notes, signatures, diffs, archives, blame, and abbreviated IDs? - Which minimal
gixfeature set supports required browsing without enabling command execution, worktree mutation, credentials, or network transport? - Can the notes explorer enumerate valid fanout layouts through generic tree traversal without duplicating unstable
gix-noteinternals? - Does
imara-diffproduce acceptable hunks for Git fixtures, large files, repeated lines, binary detection, and rename scoring under fixed budgets? - Is LGPL static redistribution acceptable for Sequoia, or does
rPGPplus explicit certificate-validity policy provide the safer owned boundary? - Which OpenPGP algorithms, expiry rules, revocation rules, and key-binding evidence define
validversusunverifiable? - Which SSH principals, validity intervals, certificates, and revocation data are authoritative, and can Soft Serve supply any binding safely?
- Which X.509 roots, certificate purposes, signing-time rules, and local revocation data are deployed without outbound lookup?
- Can Oniguruma and OpenSSL be reproducibly linked into the target executable with complete license notices and acceptable image size?
- Which exact source-language set must
two-facecover, and do grammar licenses permit redistribution? - Does
syndiffgain a stable source identity, maintenance record, cancellation, and parser/fallback integration sufficient for later reconsideration? - What measured dependency count, cold start, resident memory, ordinary-page latency, and adversarial peak distinguish the Rust stack from a future go-git v6 counter-spike?