ProgramGen / tasks /data /reverse /abdelstark__guts.8876fcf /environment /docs /003-git-protocol-implementation.md
ProgramGen / tasks /data /reverse /abdelstark__guts.8876fcf /environment /docs /003-git-protocol-implementation.md
|
Download tasks/data/reverse/abdelstark__guts.8876fcf/environment/docs/003-git-protocol-implementation.md from Lego-X/ProgramGen: direct link, hf CLI and curl.
- Browser
- Download file 2.49 kB
-
https://huggingface.co/datasets/Lego-X/ProgramGen/resolve/main/tasks/data/reverse/abdelstark__guts.8876fcf/environment/docs/003-git-protocol-implementation.md
- Command line
-
hf download hf://datasets/Lego-X/ProgramGen/tasks/data/reverse/abdelstark__guts.8876fcf/environment/docs/003-git-protocol-implementation.md
-
curl -L -o 003-git-protocol-implementation.md https://huggingface.co/datasets/Lego-X/ProgramGen/resolve/main/tasks/data/reverse/abdelstark__guts.8876fcf/environment/docs/003-git-protocol-implementation.md
2.49 kB
Status
Accepted
Date
2025-12-20
Context
Guts must support standard Git operations (clone, push, pull, fetch) to be compatible with existing developer workflows. Git supports multiple transport protocols:
- Local protocol: Direct filesystem access
- HTTP(S) Smart protocol: RESTful HTTP with pack files
- SSH protocol: Secure shell with pack streaming
- Git protocol: TCP-based (legacy, no authentication)
We need to choose and implement a transport protocol that works with decentralized nodes.
Decision
We will implement the Git Smart HTTP protocol in the guts-git crate:
Endpoints
Key Components
- Pktline format: Git's packet-line framing protocol
- Pack files: Compressed object streams
- Reference negotiation: Capability and wants/haves exchange
- Delta compression: Optional object deltas for efficiency
Consequences
Positive
- Git client compatibility: Works with
git clone,git push,git pull - HTTP-based: Easy to proxy, cache, and secure with TLS
- Firewall-friendly: Uses standard HTTP/HTTPS ports
- Stateless: Each request is independent (good for load balancing)
- Well-documented: Extensive Git protocol documentation
Negative
- Complexity: Pack file format is intricate
- HTTP overhead: More bytes than raw git protocol
- No streaming for HTTP/1.1: Large pushes buffer in memory
Neutral
- Requires implementing low-level binary protocols
- Must handle capability negotiation correctly
Pktline Format
Pack File Structure
Alternatives Considered
SSH Protocol
Use SSH for all Git operations.
Rejected because:
- Requires SSH key management per node
- Complex to integrate with decentralized identity
- Harder to proxy through web infrastructure
Git Protocol (TCP 9418)
Use native Git protocol.
Rejected because:
- No authentication mechanism
- Non-standard port blocked by firewalls
- Deprecated in favor of Smart HTTP
Use gitoxide Library
Leverage the gitoxide Rust library for protocol handling.
Partially adopted:
- We reference gitoxide patterns
- May integrate gitoxide in future for specific features