Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.

Commit 91e062d

Browse files
committed
update README
1 parent d18ef68 commit 91e062d

1 file changed

Lines changed: 39 additions & 1 deletion

File tree

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# GitDiff4LLM
33

4-
**GitDiff4LLM** is a tool designed to simplify code reviews by generating comprehensive git diffs between two commits, branches, or pull requests. It combines diffs into a single output file optimized for consumption by large language models (LLMs).
4+
**GitDiff4LLM** is a tool designed to simplify code reviews by generating comprehensive git diffs between two commits or branches. It allows you to configure diff options based on file paths, optimizing the output for consumption by large language models (LLMs).
55

66
## Features
77

@@ -38,13 +38,51 @@ gitdiff4llm -c1 <commit1> -c2 <commit2> [-o /path/to/output_file.txt]
3838
* `-c2`, `--commit2`: Second commit hash.
3939
* `-o`, `--output_file`: (Optional) Path to the output file. If not provided, the diff will be written to a default file in the system's temporary directory.
4040

41+
### Configuring Diff Options
42+
43+
You can customize the diff options using a `config.json` file. This allows you to apply different diff strategies depending on the file path.
44+
45+
For example:
46+
47+
```bash
48+
{
49+
"tiktoken_model": "gpt-4o",
50+
"diffs": [
51+
["-U50", "--ignore-all-space", "--", ":!*Test*"],
52+
["-U20", "--ignore-all-space", "--", "*Test*"]
53+
]
54+
}
55+
```
56+
57+
Explanation of the options:
58+
59+
* `tiktoken_model`: This specifies the language model you're using (for example, gpt-4o), which helps estimate how many tokens the output will contain.
60+
* `diffs`: This is a list of different comparison rules. Each rule has settings that control how Git compares the files:
61+
* `-U50`: Show 50 lines of context around changes (default is 3 lines).
62+
* `--ignore-all-space`: Ignore spaces when comparing files (useful when whitespace changes don't matter).
63+
* `--`: Signals the end of options and the start of file patterns.
64+
* `:!*Test*`: Exclude files with Test in their path.
65+
* `*Test*`: Include only files with Test in their path.
66+
67+
This setup means:
68+
* For most files, it shows a larger context (50 lines around each change) and ignores spaces.
69+
* For test files (*Test*), it shows fewer lines of context (20 lines) and also ignores spaces.
70+
4171
## Prerequisites
4272

4373
- **PowerShell (Windows Only)**: If you're using Windows, you need to run the script in PowerShell. The pattern matching functionality in the script will not work properly in Command Prompt (`cmd`).
4474
- **Python 3.x**: Ensure Python is installed on your system.
4575

4676
## Installation
4777

78+
### Option 1: Download the Executable
79+
80+
1. Go to the [Releases](https://github.com/EntityProcess/GitDiff4LLM/releases) page.
81+
2. Download the latest version of the `gitdiff4llm.exe` executable.
82+
3. Move the `gitdiff4llm.exe` file to a directory included in your system's `PATH`.
83+
84+
### Option 2: Build the Executable Yourself
85+
4886
Clone the repository and navigate to the directory:
4987

5088
```bash

0 commit comments

Comments
 (0)