Grit: Rewriting Git in Rust with agents

TL;DR

Grit is a project that rewrites Git from scratch in Rust, utilizing a swarm of agents to develop a memory-safe, library-based version that passes most of the Git test suite. It aims to improve safety, modularity, and usability in various contexts.

A developer has introduced Grit, a new Rust-based implementation of Git that passes over 99% of the official Git test suite, marking a major milestone in reimagining Git as a safe, modular library using agent-based development.

The project, initiated over several months, aims to create a comprehensive, reentrant, linkable Git core library in Rust. Unlike traditional Git, which is built on a chain of Unix commands, Grit is designed as a memory-safe, library-centric system that can be embedded into various applications and environments.

Grit currently passes most relevant tests but not all, with some skipped due to complexity or irrelevance to core functionality. The developer emphasizes that the project is still experimental, with no production use yet, and warns of potential bugs or data corruption if used improperly. The goal is to develop a tool that surpasses the limitations of existing implementations like libgit2 and Gitoxide, especially in network operations and WASM environments.

Implications for Git Development and Embedding

Grit’s development demonstrates that a safe, modular, Rust-based Git core is feasible, potentially transforming how Git is integrated into applications, cloud services, and embedded systems. Its agent-driven approach offers a new pathway for continuous, automated development, reducing bugs and increasing safety. If further refined, Grit could enable faster, more reliable Git operations in environments where performance and safety are critical, such as web assembly, cloud functions, and custom Git server implementations.

The Geeky Days American Soldier Army Military Laser Cut Longplay Wall Clock 7 Luminous Modes LED Silent Movement Non Ticking Military Base Contemporary Wall Clock for Library Classroom Decor

The Geeky Days American Soldier Army Military Laser Cut Longplay Wall Clock 7 Luminous Modes LED Silent Movement Non Ticking Military Base Contemporary Wall Clock for Library Classroom Decor

Record Inspiration: Inspired by vinyl records, it brings a unique, old fashioned charm to your room,it serves as…

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background on Git Rewriting Efforts and Rust Adoption

Git, created over 20 years ago, is a complex system built on a chain of Unix commands, making it difficult to embed or extend efficiently. Existing reimplementations like libgit2 and Gitoxide have limitations in speed, safety, and completeness, especially for network operations. The idea of rewriting Git in a safer language like Rust has been discussed for years, but practical attempts have been limited. Inspired by recent experiments with agent-based code generation, the developer embarked on creating Grit, aiming to produce a safer, more modular version that can be integrated into modern workflows and environments.

“Grit is not just a port; it’s a new foundation for Git in Rust, designed to be safe, modular, and embeddable, passing most of the core tests.”

— the developer behind Grit

“Reimplementing Git in Rust could significantly improve safety and performance, especially for embedded and web-based applications.”

— a Rust community contributor

Amazon

embeddable Git in Rust

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Remaining Challenges and Limitations of Grit

Grit is still in early development; it does not pass all tests, and some features like email handling, internationalization, and importers are skipped. Performance issues, API design, and cross-platform support (notably Windows) remain unresolved. Its stability and safety in real-world use are unconfirmed, and it may contain bugs or data corruption risks if deployed prematurely.

Amazon

memory-safe Git implementation

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Upcoming Development Milestones for Grit

The developer plans to refine the codebase, improve performance, complete testing for skipped areas, and develop comprehensive documentation. Future steps include building a stable release, exploring WASM support for browser and edge environments, and integrating Grit into existing tools like GitButler and Jujutsu. Community feedback and contributions are encouraged to accelerate progress toward a production-ready version.

Claude Code for Terminal Developers: Build Scripts, Fix Bugs, Refactor Code, Automate Git Workflows, and Ship Cleaner Software with AI Agents

Claude Code for Terminal Developers: Build Scripts, Fix Bugs, Refactor Code, Automate Git Workflows, and Ship Cleaner Software with AI Agents

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

What is Grit and how does it differ from traditional Git?

Grit is a reimplementation of Git written entirely in Rust, designed as a safe, modular library that can be embedded into applications. Unlike traditional Git, which is built on Unix command chaining, Grit aims for a reentrant, linkable core with agent-based development to improve safety and extensibility.

Can Grit replace Git in production environments now?

No. Grit is still experimental, passes most core tests but not all, and may contain bugs. It is not recommended for production use until further development and testing are completed.

What are the main advantages of rewriting Git in Rust?

Rust provides memory safety, concurrency, and modularity, which can reduce bugs, improve performance, and facilitate embedding Git functionality into various environments, including web assembly and custom applications.

Will Grit support Windows or other platforms soon?

Support for Windows and other platforms is not yet available. The current focus is on stabilizing core functionality and performance improvements before expanding platform compatibility.

How can I contribute or follow Grit’s development?

The developer encourages community feedback, bug reports, and contributions. Updates are likely to be shared through the project’s website and repositories, with plans for more documentation and milestones in the coming months.

Source: Hacker News

You May Also Like

Password Security for Normal Humans: A Simple System That Works

Learn a straightforward, memorable password system that keeps your accounts secure—discover the key to protecting your digital life today.

We tested 20 wall chargers, from cheap to expensive, to see what we would find – from 15-140W, with screens and without, to arm you with the knowledge to pick a good one out of a sea of mediocrity

An in-depth test of 20 wall chargers from budget to premium to evaluate output, efficiency, and safety. What do you need to know before your next purchase?

Looking Forward to Postgres 19: Query Hints

Postgres 19’s feature freeze includes new contrib modules, pg_plan_advice and pg_stash_advice, enabling query hints—an unprecedented move for the database.

Port React Compiler to Rust

React’s compiler support is being ported from JavaScript to Rust, aiming for improved performance and stability, with ongoing testing and development.