Comments (6)
smaller diff text:
const diffCached = ['diff', '--cached','--ignore-all-space','--diff-algorithm=minimal'];
from aicommits.
I thought about this, but some commits are just white-space changes (e.g. stylistic/linting).
If the diff doesn't show, GPT wouldn't be able to produce an accurate description of the change.
from aicommits.
Or actually even better, now that the new chat API is available and they take turns, the entire diff could be consumed file by file actually if detect it's bigger than some threshold and have a turn by turn chat, managing then to generate a comment about each and then asking to summarise each comment in the end. This would allow to work with quite large diffs as well.
https://github.com/openai/openai-python/blob/main/chatml.md
https://platform.openai.com/docs/guides/chat/chat-vs-completions
from aicommits.
I wonder if we can be smart about this and detect how much of the diff is white-space changes.
If the diff is mainly white-space change, we can pass in the diff with white-space.
If not (or if the diff is close to the OpenAI size limit), we can pass in the white-space ignored diff.
from aicommits.
It could be a conf option, but for many cases detecting these changes are important, particularly for languages where indentation matters and as above - ie formatting & linting changes. How about just counting the tokens with tokeniser and set it to the models max number instead of line count? and allow people to set a limit themselves.
from aicommits.
I don't think we can ignore white space for the reason provided above, and we've added --diff-algorithm=minimal
so I think this is closable.
@salomartin
That idea sounds interesting but I worry that it may (unexpectedly) incur large expenses for generating a commit.
from aicommits.
Related Issues (20)
- Rate limit error when not limited HOT 1
- Local Setup Guide for Development and Testing HOT 4
- Pre-Commit Hook Not Working with Husky HOT 1
- Take into account previous commit messages HOT 5
- Add an option to accept whatever the suggestion is HOT 3
- Generate a commit message from an existing commit HOT 3
- Socket connection timeout
- AI commits crash when generating commit message
- aicommits uses first the envVar instead of the env in .aicommits file HOT 1
- Include Past commits HOT 1
- Prompt shouldn't include Character limit
- Generate Message Body
- aicommits hides the output of husky HOT 1
- Option to skip precommit checks HOT 1
- Error: Too many requests HOT 1
- Extract issue name from branch and append to commit message HOT 2
- Message sanitization should not always remove newlines
- Feature: Ollama integration HOT 6
- self-signed certificate in certificate chain
- Unable to Set OpenAI API Key HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aicommits.