Skip to content

bounded-systems/git-ast

Git AST: A Language-Aware Git Extension

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.

Value Proposition

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

How It Works

Git AST leverages Git's clean and smudge filters to operate on the structure of your code:

  1. When You Commit: Source code is parsed into a syntax tree (AST/CST) and stored in Git
  2. 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.

Getting Started

Documentation

Core Documentation

Technical Documentation

Concepts and Reference

  • Key Concepts - Detailed explanation of core concepts
  • Glossary - Definition of terms
  • FAQ - Frequently asked questions

Contributing

For a full documentation overview, see Documentation Index.

Project Status

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.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

We welcome contributions! Please see our contribution guidelines for how to get involved.

About

Language-aware Git: a clean/smudge design for AST-based diffs & merges. Design stage — spec + compiling skeleton, not yet a working tool.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages