# git: Compress diff for commit message generation \(\#42835\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/9094eb811b6897c2dd327ddc801c4507bce0e1c7)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 9094eb811b6897c2dd327ddc801c4507bce0e1c7

Requested commit: 9094eb811b6897c2dd327ddc801c4507bce0e1c7

Commit: 9094eb811b6897c2dd327ddc801c4507bce0e1c7

Tree: 580a3f1f07a081ea4bfeea7cfa47d30c407c6827

Author: Bhuminjay Soni

Committer: GitHub

## Message

```
git: Compress diff for commit message generation (#42835)

This PR compresses diff capped at 20000 bytes by:
- Truncation of all lines to 256 chars
- Iteratively removing last hunks from each file until size <= 20000
bytes.


Closes #34486

Release Notes:

- Improved: Compress large diffs for commit message generation (thanks
@11happy)

---------

Signed-off-by: 11happy <soni5happy@gmail.com>
Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
```

## Parents

- [29f9853978a61b0109e08b1680aea36710fa5ea5](https://git.cafe/gitcafe/zed/commit/29f9853978a61b0109e08b1680aea36710fa5ea5?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/9094eb811b6897c2dd327ddc801c4507bce0e1c7?format=markdown)
