Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 51 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,64 @@

> Summarize your changes into a concise title and a detailed description.

In this project, we provide a simple command called `sum-diff`. This command automatically generates a concise and clear title and a detailed description from the current branch's differences in a git repository.
`sum-diff` is a simple command-line tool that automatically generates a concise title and a detailed description by analyzing the current git branch, including:

## Install
- Branch name
- Code changes (`git diff`)

## Installation

Install using `pipx`:

```bash
# Download and unzip
$ unzip sum-diff.zip
$ pipx ./sum-diff
$ pipx install ./sum-diff

# Install nightly from GitHub
$ pipx install git+https://github.com/ishikawa/sum-diff
```

## How to use
## API Key

`sum-diff` uses Anthropic's Claude 3.5 Sonnet to generate the output. Obtain an API key from [Anthropic's console](https://console.anthropic.com/) and set it as an environment variable:

```bash
$ export ANTHROPIC_API_KEY=sk-ant-...
```

## Usage

After making changes to your project and before creating a PR, run the `sum-diff` command to have the AI generate a title and description for your PR.

```bash
$ sum-diff
```

The command will take a few seconds to process and then output the title and description. For example:

````
Add `while` statement support to compiler

This PR introduces support for `while` loops in the compiler, enhancing the language's control flow capabilities.

Key changes:
- Add `While` token and parsing logic in `tokenizer.rs`
- Implement `WhileStmt` struct and parsing in `parser.rs`
- Add code generation for `while` loops in `asm.rs`
- Update `LocalVarAllocator` to handle `while` statements in `allocator.rs`
- Add test cases for `while` loops in `test.sh`

The implementation follows the existing pattern for control flow statements, such as `if` statements. The `while` loop consists of a condition and a body, which are evaluated and executed accordingly.

Example of the new `while` loop syntax:

```rust
i = 0;
while (i < 20)
i = i + 1;
return i;
```

This PR completes the basic control flow structures for the compiler, allowing for more complex program logic to be expressed in the language.
````