KitCat VCS
KitCat is a Git-like version control system implemented in Rust, designed to be simple, fast, and Git-compatible where possible. It's an educational project demonstrating how version control systems work under the hood.
β¨ Features
β Currently Implemented
-
Repository Management
- Initialize repositories (
.kitcatdirectory structure) - Configuration management (user.name, user.email)
- Initialize repositories (
-
Object Storage
- Content-addressable blob storage with SHA-1 hashing
- Zlib compression for efficient storage
- Tree objects for directory snapshots
- Commit objects with full metadata (author, timestamp, parents)
-
Staging Area
- Binary DIRC format index (Git-compatible)
- File metadata tracking (permissions, timestamps)
- Atomic writes with file locking
-
Version Control
- Create commits with messages
- View commit history (
log,log --oneline) - Branch management (create, list, delete, switch)
- Checkout (branch switching, detached HEAD, file restoration)
- Working tree status (staged, unstaged, untracked files)
- Diff (compare working tree, index, and commits)
- Merge (three-way merge with conflict detection and resolution)
- Show commit details
-
CLI Interface
- Full command-line interface with help
- Intuitive Git-like commands
-
Repository Optimization
- Garbage collection with object packing
- Packfile format for efficient storage
- Prune unreachable objects
- Repository size optimization
π Planned
- Delta compression for packfiles
- LFS (Large File Storage) for very large files
- Remote repository support
- Network operations (push, pull, fetch)
- Advanced merge strategies
- Submodules
π Quick Start
Installation
# Clone the repository
# Build in release mode
# The binary is at target/release/kitcat
# Optionally, add to your PATH
See the Installation Guide for detailed instructions.
Your First Repository
# Initialize a new repository
# Configure your identity
# Create and add a file
# Create your first commit
# View history
See the Quick Start Guide for a complete tutorial.
π Documentation
Comprehensive documentation is available in the docs/ directory:
-
Getting Started
-
Guides
- Testing Guide - How to test KitCat
- Architecture - System design and internals
π οΈ Development
Prerequisites
- Rust 1.92.0 or later
- Cargo (comes with Rust)
Building
# Debug build
# Release build (optimized)
# Run tests
# Run with logging
RUST_LOG=debug
Testing
# Run all tests
# Run specific test
# Run with output
# Run manual tests
π Usage Examples
Basic Workflow
# Initialize repository
# Configure identity
# Add files
# Create commit
# View history
Working with Branches
# Create a branch
# List branches
# Switch to branch
# Make changes and commit
# Switch back to master
# Delete branch
Merging Branches
# Create and switch to a feature branch
# Make changes on feature branch
# Switch back to master
# Merge feature into master
# If there are conflicts:
# - Edit files to resolve conflicts
# - Stage the resolved files
# - Continue the merge
# Or abort the merge
Inspecting Objects
# Write tree from index
# List tree contents
# Show commit details
# View commit history
ποΈ Architecture
KitCat uses a modular architecture:
βββββββββββββββββββββββββββββββββββββββ
β CLI Layer β
β (Command Parsing) β
ββββββββββββββ¬βββββββββββββββββββββββββ
β
ββββββββββββββΌβββββββββββββββββββββββββ
β Commands Layer β
β (Business Logic) β
ββββββ¬ββββββββ¬βββββββββ¬ββββββββββββββββ
β β β
ββββββΌββββ βββΌβββββ ββΌβββββββββ
β Index β βObjectβ β Repo β
β (Stage)β βStorageβ β (Config)β
ββββββββββ ββββββββ βββββββββββ
Object Model: Git-compatible
- Blobs: File content
- Trees: Directory snapshots
- Commits: Versioned snapshots with metadata
Storage: Content-addressable
- SHA-1 hashing for deduplication
- Zlib compression
- Split directories for performance
See Architecture Documentation for details.
π― Project Goals
- Educational: Demonstrate how VCS internals work
- Git-Compatible: Use same object formats as Git
- Performance: Leverage Rust's zero-cost abstractions
- Simplicity: Clean, readable codebase
- Extensible: Easy to add new features
π Project Status
Version: 0.1.0 (Alpha) Rust Edition: 2024
Feature Completeness
| Feature | Status |
|---|---|
| Repository initialization | β Complete |
| Binary index (staging) | β Complete |
| Blob objects | β Complete |
| Tree objects | β Complete |
| Commit objects | β Complete |
| Branch management | β Complete |
| Commit history (log) | β Complete |
| Configuration | β Complete |
| Status command | β Complete |
| Checkout | β Complete |
| Diff | β Complete |
| Merge | β Complete |
| Garbage collection | β Complete |
| Packfiles | β Complete |
Phase 1 Progress: 11/11 features complete (100%) β¨
π€ Contributing
Contributions are welcome! Please read our Contributing Guide (coming soon) for details on our code of conduct and the process for submitting pull requests.
Areas Where We Need Help
- Large file support (packfiles, delta compression, LFS)
- Test coverage expansion
- Performance optimization
- Documentation improvements
- Remote repository support
π License
This project is licensed under the MIT License - see the LICENSE.rst file for details.
π Acknowledgments
- Inspired by Git and its excellent internals documentation
- Built with Rust π¦
- Uses clap for CLI parsing
- Compression with flate2
π Support & Contact
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: docs/
π Related Projects
- Git - The inspiration
- libgit2 - Git implementation library
- gitoxide - Git implementation in Rust
- jujutsu - Version control tool in Rust
Built with β€οΈ and Rust π¦
KitCat: Because version control should be easy to understand!