Skip to content
/ astral Public

Astral (asl) is a blazingly fast version control system built in Go.

License

Notifications You must be signed in to change notification settings

Codimow/astral

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Astral (asl)

A modern, blazingly fast version control system built in Go

Go Version License

Astral is a next-generation version control system that reimagines how developers interact with their code history. Built with performance and simplicity in mind, it provides a cleaner interface than Git while maintaining enterprise-grade reliability.

✨ Features

  • πŸš€ Blazingly Fast: Blake3 hashing and parallel operations make operations 2-3x faster than Git
  • 🎯 Simple Interface: No staging area - just save your changes
  • πŸ“š Stack-Based Workflow: First-class support for stacked changes and patch series
  • ⚑ Zero Configuration: Works out of the box with sensible defaults
  • πŸ”’ Enterprise Ready: Production-grade quality with comprehensive test coverage
  • 🌍 Cross-Platform: Works seamlessly on Linux, macOS, and Windows

πŸš€ Quick Start

Installation

# Build from source
git clone https://github.com/codimo/astral.git
cd astral
make build
sudo make install

Basic Usage

# Initialize a repository
asl init

# Save changes (no staging area!)
asl save -m "Add new feature"

# View history
asl log

# Create a branch
asl branch feature-x

# Switch branches
asl switch feature-x

# View commit stack
asl stack

πŸ“– Commands

Repository Management

  • asl init [directory] - Initialize a new repository
  • asl save [files...] -m "message" - Commit changes
  • asl undo - Revert last commit (keeps working changes)
  • asl amend -m "new message" - Modify last commit

Branching

  • asl branch [name] - Create or list branches
  • asl switch <branch> - Switch to a branch
  • asl stack - Visualize commit hierarchy

History

  • asl log - Show commit history
  • asl show [commit] - Show commit details
  • asl diff [commit1] [commit2] - Show differences

Merging ✨ NEW

  • asl merge \<branch\> - Merge a branch into current branch
  • asl merge --abort - Cancel ongoing merge
  • asl merge --continue - Complete merge after resolving conflicts
  • asl resolve \<file\> - Mark file as resolved
  • asl resolve --ours - Resolve all using our version
  • asl resolve --theirs - Resolve all using their version
  • asl status - View repository and merge status

🌿 Merging Branches

Astral provides powerful merge capabilities with automatic conflict detection:

# Create and work on a feature branch
asl branch new-feature
asl switch new-feature
# ... make changes ...
asl save -m "Implement feature"

# Merge back to main
asl switch main
asl merge new-feature
# βœ“ Merge completed successfully

Handling Conflicts

When conflicts occur, Astral guides you through resolution:

$ asl merge feature-x
βœ— Merge conflict detected

Conflicted files:
  βœ— src/main.go

# Fix conflicts manually
vim src/main.go

# Mark as resolved
asl resolve src/main.go

# Complete the merge
asl merge --continue
# βœ“ Merge completed

Or use automatic strategies:

# Keep our changes
asl resolve --ours

# Keep their changes
asl resolve --theirs

# Then continue
asl merge --continue

See docs/MERGING.md for detailed merge documentation.

πŸ—οΈ Architecture

Astral uses a content-addressable storage system with several key innovations:

  • Blake3 Hashing: 2x faster than SHA-1 with better security
  • Concurrent Operations: Lock-free algorithms for parallel file processing
  • Smart Compression: zlib compression for efficient storage
  • Object Caching: In-memory cache for frequently accessed objects

Directory Structure

.asl/
β”œβ”€β”€ objects/        # Content-addressable object database
β”‚   β”œβ”€β”€ 12/         # First 2 chars of hash
β”‚   β”‚   └── 3456... # Remaining hash
β”œβ”€β”€ refs/
β”‚   └── heads/      # Branch references
β”œβ”€β”€ config/         # Repository configuration
└── HEAD            # Current branch pointer

πŸ§ͺ Development

Building

# Build binary
make build

# Run tests
make test

# Run benchmarks
make bench

# Format code
make fmt

# Run linter
make vet

Testing

# Run all tests with coverage
make test

# Run only unit tests
make test-unit

# Run integration tests
make test-integration

πŸ“Š Performance

Astral is designed for speed:

# Benchmark hashing performance
go test -bench=BenchmarkHashBytes ./internal/core/

# Benchmark storage operations
go test -bench=BenchmarkStorePut ./internal/storage/

Typical results on modern hardware:

  • Hashing: ~2 GB/s (Blake3)
  • Object Storage: ~50k ops/sec
  • Commit Operations: <10ms for typical repositories

🀝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Code Quality Standards

  • Follow idiomatic Go conventions
  • Maintain test coverage above 80%
  • Add benchmarks for performance-critical code
  • Document all public APIs
  • Use structured logging
  • Never panic in library code

πŸ“ License

MIT License - see LICENSE for details

πŸ—ΊοΈ Roadmap

Phase 1: Local Operations βœ…

  • Repository initialization
  • Commit operations (save, undo, amend)
  • Branching and switching
  • History viewing
  • Stack visualization

Phase 2: Merging βœ…

  • Three-way merge algorithm
  • Conflict detection and resolution
  • Fast-forward merges
  • Merge state management
  • Conflict resolution strategies

Phase 3: Remote Operations

  • Custom sync protocol
  • Clone, push, pull
  • Incremental transfers

Phase 4: Advanced Features

  • Garbage collection
  • Pack files with delta compression
  • Interactive timeline
  • Git interoperability

πŸ™ Acknowledgments

Inspired by Git, Mercurial, and modern VCS design principles.

Built with:


Made with ❀️ by the Astral team

About

Astral (asl) is a blazingly fast version control system built in Go.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published