Nutlope / aicommits

A CLI that writes your git commit messages for you with AI

Home Page:https://www.npmjs.com/package/aicommits

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Take into account previous commit messages

DanielWeidensdoerfer opened this issue · comments

Feature request

Option to take preivous commit messages into account when creating a new one.

Why?

So that the generated commit messages are in same style as previous ones. Therefore increasing the chance of suggested message to fit.

Alternatives

Reject the suggested commit msg and manually commit.

Additional context

No response

I had the exact same idea, and implemented it here:

joeytwiddle@890996f

Feel free to grab that code. Or I can open a pull request if you prefer.

Concerns:

  1. Perhaps it should be an option in the config file, so people can enable or disable it. (It certainly makes the prompt larger.)

I think there is one thing to be noted: If previous commits with AI generated messages are factored in, this will distort the style, therefore there would either be a system to separately store which commits are AI generated or just storing a single commit hash after which it can't be assumed that all commits are written by humans.

@joeytwiddle I really like your tweaks, you should definitely make a pr!

@moritz-t-w Thanks, but my experience is that my tweaks don't work very well!

The AI always chooses to use conventional style (usually with the "refactor" label) even if previous commits used different tags, or didn't use conventional style at all.

Well maybe that'll need some work but the other things you've done seem pretty reasonable