Nutlope / aicommits

A CLI that writes your git commit messages for you with AI
https://www.npmjs.com/package/aicommits
MIT License
7.71k stars 365 forks source link

Allow for custom prefix for the commit message #111

Open aslakhol opened 1 year ago

aslakhol commented 1 year ago

It would be great to have a flag -p or --prefix that would take an argument that would be prefixed into the final commit message.

aicommits -p web: would yield this commit message web: <commit message generated by aicommits>

Why? For monorepos it can be useful to prefix commits the name of the project you are working on. It would also allow us to make it possible to use semantic commits before we get that generated by GPT, while being more versatile.

ghost commented 1 year ago

I'd also welcome this feature but for adding JIRA ticket references 😄

mreduar commented 1 year ago

I'd also welcome this feature but for adding JIRA ticket references 😄

That's exactly why I came here, without this feature I can't use this tool as such, I would only have to copy the text and do the commit myself manually.

ghost commented 1 year ago

I'd also welcome this feature but for adding JIRA ticket references 😄

That's exactly why I came here, without this feature I can't use this tool as such, I would only have to copy the text and do the commit myself manually.

The workaround I'm doing is that I add the Jira ticket prefix manually. In my case, the installed hook opens nano for commit message editing and I can add the jira ticket there.

mreduar commented 1 year ago

The workaround I'm doing is that I add the Jira ticket prefix manually. In my case, the installed hook opens nano for commit message editing and I can add the jira ticket there.

There is a PR #113 that could solve the problem for many. But there doesn't seem to be much activity from the maintainers.

DanielWeidensdoerfer commented 1 year ago

Meanwhile this is getting implemented. You can create a git hook that reads the ticket number of a jira ticket from the branch and prefixes every commit message. https://betterprogramming.pub/how-to-automatically-add-the-ticket-number-in-git-commit-message-bda5426ded05

tchenu commented 4 weeks ago

Meanwhile this is getting implemented. You can create a git hook that reads the ticket number of a jira ticket from the branch and prefixes every commit message. https://betterprogramming.pub/how-to-automatically-add-the-ticket-number-in-git-commit-message-bda5426ded05

https://github.com/tchenu/aicommits/commit/82dabdc0ebf51408a506a6aa1a8b7550c6479f90