opencommit icon indicating copy to clipboard operation
opencommit copied to clipboard

FEAT: Support to enforce conventional commits, custom scopes and amend other tool commits

Open D4RKAR117 opened this issue 1 year ago • 14 comments

Hey, first of all awesome tool

I want to know if there is something about conventional commits (or any other preset like angular) into the tool, would be awesome for workflows that use extensively commit lint.

Also, there is some way that you can choose the scope? Would be great for monorepos where scopes usually belongs to the package that is being modified.

Finally, would be great if this tool can amend the commit after the manual writing of the commit, this could help for integration with other git tools like commitizen.

Keep the awesome work!!

D4RKAR117 avatar Mar 28 '23 04:03 D4RKAR117

you can do oc --amend and all other git commit flags are also passed to oc. Sorry, I dont get your first 2 points :0

di-sukharev avatar Mar 29 '23 06:03 di-sukharev

@di-sukharev, just some context:

Tools like commitizen are widely used to make conventional commits for automating semantic versioning and changelogs. Currently, OC does not conform to conventional commits. You can find the specifications here.

The main issue a missing blank space between the first line describing header (type, scope, and subject) and the descriptive text.

jakob1379 avatar Mar 29 '23 09:03 jakob1379

Yeah, by default some tools like monorepos use git scopes to automate releases of certain packages, so would be great that as @jakob1379 suggest, the AI uses conventional commits or any other git spec (like angular commits) or even custom specs to do their job, so tools that sues that spec don't fail, something like commitlint and that

D4RKAR117 avatar Mar 29 '23 17:03 D4RKAR117

so you are saying that adding a blank space between header and description would solve the issue?

di-sukharev avatar Mar 30 '23 07:03 di-sukharev

It goes beyond that, usually projects use the following package to lint their commits using git hooks (husky), if the AI follow the specs configured at commitlint.config.js/ts file, and as @jakob1379 said the specification of conventional commits. That way, many workflows that implement the commit linting can use opencommit without major problems

D4RKAR117 avatar Mar 30 '23 13:03 D4RKAR117

+1 this. I maintain multiple projects with their respective commit message style. It is not always conventional commits sometimes just plain english (what I dislike. But this is a different discussion altogether). However, it would be great if OC recognizes this and creates messages according to the commit style that is already present. As far as I know one can send this is further context for GPT-3.5. I suppose that last n commits are sufficient as well, so that you don't have to send the while history for this to work.

dasheck0 avatar Apr 05 '23 16:04 dasheck0

could anybody help me here please and make the PR? <3

di-sukharev avatar May 04 '23 05:05 di-sukharev

I can take a look it this. Not sure when I get to it. Probably this weekend

dasheck0 avatar May 24 '23 08:05 dasheck0

+1 this. I maintain multiple projects with their respective commit message style. It is not always conventional commits sometimes just plain english (what I dislike. But this is a different discussion altogether). However, it would be great if OC recognizes this and creates messages according to the commit style that is already present. As far as I know one can send this is further context for GPT-3.5. I suppose that last n commits are sufficient as well, so that you don't have to send the while history for this to work.

I'd rather have a config to define the style, because previous commit messages might be flawed. Yet enhancing prompt with previously correct commit messages could be a nice option.

sebastienfi avatar Jun 15 '23 04:06 sebastienfi

I'm working on this, I will submit a PR soon.

sebastienfi avatar Jun 16 '23 22:06 sebastienfi

@D4RKAR117 @jakob1379 @dasheck0 Could you please review the PR and provide feedback?

sebastienfi avatar Jun 18 '23 18:06 sebastienfi

Stale issue message

github-actions[bot] avatar Jul 28 '23 21:07 github-actions[bot]

@sebastienfi hi, are we done here or should i reopen?

di-sukharev avatar Feb 28 '24 06:02 di-sukharev

ok, i see <3

di-sukharev avatar Feb 28 '24 06:02 di-sukharev