Metadata-Version: 2.4
Name: patchwork-semantic-diff
Version: 0.1.5
Summary: A semantic code diff tool powered by tree-sitter
Author-email: Vedant <your-email@example.com>
License: MIT
Project-URL: Homepage, https://github.com/your-username/patchwork
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: click
Requires-Dist: rich
Requires-Dist: textual
Requires-Dist: gitpython
Requires-Dist: tree-sitter
Requires-Dist: tree-sitter-python
Requires-Dist: tree-sitter-javascript

# Patchwork

A semantic code diff tool that understands functions, not just lines.

![Build Status](https://github.com/your-username/patchwork/actions/workflows/ci.yml/badge.svg)

### [Demo placeholder]
> **Recording your own demo:**
> 1. Install `asciinema` and `agg`
> 2. Run `asciinema rec demo.cast`
> 3. Perform a few diffs (e.g., `patchwork diff old.py new.py`)
> 4. Convert to GIF: `agg demo.cast demo.gif`

---

## Installation

```bash
pip install patchwork-semantic-diff
```

## Usage

### 1. Compare local files
```bash
patchwork diff old.py new.py
```

### 2. Compare Git commits
```bash
patchwork diff HEAD~1 HEAD path/to/file.js
```

### 3. Audit an entire commit
```bash
patchwork show HEAD~1
```

### 4. Visual TUI mode
```bash
patchwork diff old.py new.py --tui
```

---

## How it Works

Patchwork uses **Tree-sitter** to parse your source code into an Abstract Syntax Tree (AST). Instead of looking at raw text changes, it traverses the tree to identify specific function declarations, arrow functions, and class methods. 

By mapping code changes to these semantic blocks, Patchwork can tell you precisely which functions were added, deleted, or modified. This eliminates the "noise" of line-level diffs—like changes to comments, whitespace, or reordering—and lets you focus on the logic that actually changed.

## Supported Languages

| Language | Extensions |
| :--- | :--- |
| **Python** | `.py` |
| **JavaScript** | `.js`, `.jsx` |
| **TypeScript** | `.ts`, `.tsx` |


---

## Contributing

We welcome contributions! Please open an issue or submit a pull request on GitHub.
