Skip to content

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 12 Jun 08:04
· 5095 commits to main since this release

v0.4.0 — what changed since v0.3.99

The headline of this release is a complete, embedder-facing Git network transport stack in grit_lib: grit can now fetch and push over git://, ssh, http(s), and local/file:// remotes entirely in-process — no git subprocess on the wire — so tools like jj and GitButler can in theory drop a dependency on an external binary.

Network transports (grit_lib)

A new transport / fetch / push / credentials surface, lifted from grit's CLI internals into reusable, embedder-shaped APIs behind a Transport trait:

  • All four transports, both directions — fetch and push over git://, ssh, http(s), and file://.
  • Git protocol v2 for fetch (over streaming transports and stateless smart-HTTP), with transparent downgrade to v0/v1; v0/v1 for push.
  • Pluggable HTTP client (HttpClient trait; default ureq impl behind the http-ureq feature) so embedders aren't forced onto a particular HTTP/TLS stack.
  • Credentials — a CredentialProvider trait plus a Git-compatible default that runs configured credential.helper programs, filled on a 401 and retried as Basic, with typed non-interactive failure (never a TTY prompt/hang).
  • Capabilities: wildcard + exact refspecs, tag policies, --prune, shallow/depth (deepen/shallow-since/deepen-not/--unshallow), force-with-lease (CAS + expect-absent), push-options, http.proxy/cookieFile/extraHeader, and negotiation-driven delta/thin packs (so a push never packs the whole object graph).
  • SHA-256 threaded through the transport and pack paths.

Backed by ~22 integration suites against real fixtures (system git daemon, fake-ssh, an in-tree HTTP server), cross-checked against system git + git fsck, including adversarial protocol-v2/HTTP suites (wire-evidence + mutation testing) and a negotiated-pack-size guard.

New examples

gritx-fetch and gritx-push (in grit-examples) discover a repository's default remote, infer the transport and authentication from its URL (credential helpers for HTTP, SSH keys/agent for SSH, none for git:///local), and run the operation in-process.

Also in this release

  • Full SHA-256 support across all operations (read + write).
  • Licensing: grit-cli is now GPL-2.0-only and grit-lib is MIT.
  • Performance: cached MIDX reads and delta bases, gitattributes/config-cascade caching with stat-stamp revalidation, faster ls-files and tree-diff.
  • A grit-bench tool for benchmarking grit vs git at scale, and a mailmap.

Crates

Published to crates.io at 0.4.0: grit-lib, grit-protocol, grit-simple, grit-cli.