Gunnar

nordisk/edda

crates/gunnar-sendpack/Cargo.toml

[package]
name = "gunnar-sendpack"
version = "2.0.0"
edition = "2021"
rust-version = "1.85"
license = "MIT OR Apache-2.0"
repository = "https://git.gunnar.rs/nordisk/edda"
description = "git's receive-pack wire format, both ends: the send-pack conversation gitoxide does not have, plus the server-side encoders for the same grammar. Plumbing only, no gunnar types."
keywords = ["git", "push", "send-pack", "receive-pack", "protocol"]
categories = ["development-tools", "network-programming"]

# ── donation shape (D21) ────────────────────────────────────────────────────
#
# Dependency versions are written out here rather than inherited from the
# workspace on purpose: this crate must be liftable out of gunnar's tree with
# `cp -r` and build unchanged. `version.workspace = true` would make the
# manifest meaningless outside this repository, which is exactly the coupling
# D21 exists to prevent. The package metadata is spelled out for the same
# reason.
#
# There is deliberately NO gunnar dependency, and there never may be one.
# `crates/gunnar-sendpack/tests/donation_shape.rs` asserts it.
#
# ── why the I/O is a feature, and it is not tidiness ────────────────────────
#
# The grammar in `advertisement`, `command`, `report` and `capabilities` is
# pure functions over payload bytes, and it is what BOTH ends of this
# conversation share. A git *server* implementing receive-pack needs the same
# four formats as a client implementing send-pack, written the other way round,
# which is why they live here together rather than being twinned once per
# direction (that twinning is what this crate was extracted to end).
#
# A server already owns a pkt-line framer and a socket. If the grammar dragged
# `gix-packetline` in, every server consuming it would pay for a framing layer
# it does not use. So `blocking-io` — the `Transport` trait, the pkt-line
# reader and the `send_pack` driver — is a feature, on by default because a
# client is the majority consumer, and off for a server that only wants the
# formats. With it off this crate resolves to `gix-hash` + `bstr` + `thiserror`
# and nothing else.

[features]
default = ["blocking-io"]
# The client half: pkt-line framing, the `Transport` seam and the `send_pack`
# driver that runs a whole push over one connection.
blocking-io = ["dep:gix-packetline"]

[dependencies]
# Object identity and width. `sha256` is not optional here: an advertisement
# whose oids are 64 hex characters is a sha256 repository, and a build that
# could not name that hash kind would mis-parse the advertisement rather than
# refuse it.
gix-hash = { version = "0.27", features = ["sha1", "sha256"] }
# Reference names are BYTES in git, not UTF-8. `refs/heads/\xff` is a name git
# will create, advertise and serve. Carrying them as `String` means a lossy
# conversion, and a lossy conversion collapses two distinct names onto one —
# see `command::parse_command_line` for the incident that fixed.
bstr = { version = "1", default-features = false, features = ["std"] }
thiserror = "2"
# gix's own pkt-line codec, used for framing rather than a private copy of it.
gix-packetline = { version = "0.23", default-features = false, features = ["blocking-io"], optional = true }

[dev-dependencies]
tempfile = "3"