Git AST provides language-aware extensions for Git, leveraging Abstract Syntax Trees (ASTs) instead of traditional line-based diffs. This enhances Git with semantic understanding, leading to more meaningful history, easier merges, and enhanced code consistency.
Why use Git AST?
- Cleaner Diffs: Focus on meaningful code changes, ignore formatting noise
- Smarter Merges: Reduce conflicts caused by code movement or non-competing structural edits
- Consistent Formatting: Enforce a canonical code style automatically across your repository
Git AST leverages Git's clean and smudge filters to operate on the structure of your code:
- When You Commit: Source code is parsed into a syntax tree (AST/CST) and stored in Git
- When You Check Out: The stored tree is converted back into consistently formatted source code
This structural approach lets you focus on semantic changes rather than textual differences.
- Installation Guide - Set up Git AST in your environment
- Usage Guide - Learn how to use Git AST in your workflow
- Documentation - Comprehensive documentation
- Project Overview - Goal, mechanism, and key concepts
- Roadmap - Project development timeline
- Architecture Design - Technical architecture and data flow
- Clean/Smudge Filters - Details on the Git filter implementation
- Key Concepts - Detailed explanation of core concepts
- Glossary - Definition of terms
- FAQ - Frequently asked questions
- Contribution Guidelines - How to contribute
- Development Setup - Setting up your development environment
For a full documentation overview, see Documentation Index.
Design stage — not yet a working tool. This repository is primarily a design
worked out in docs/, plus a small Rust skeleton that
compiles and exposes the subcommand surface (git-ast filter-process | diff-driver | merge-driver). The filter, diff, and merge logic are
placeholders: parsing, serialization, and pretty-printing are not implemented
yet. The hardest open problem — stable AST node identity across versions, which
structural diff/merge and refactor-aware history depend on — is described in
docs/planning/scope.md and explicitly out of scope
for the initial MVP.
If you are evaluating this repo: the value here is the architecture and the problem framing, not a runnable extension.
This project is licensed under the MIT License. See the LICENSE file for details.
We welcome contributions! Please see our contribution guidelines for how to get involved.