di-sukharev / opencommit

Generate conventional git commit messages with AI in 1 second 🤯🔫
https://www.npmjs.com/package/opencommit
MIT License
5.97k stars 318 forks source link

[Feature]: --signoff #418

Open kaovilai opened 5 days ago

kaovilai commented 5 days ago

Description

https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff

Suggested Solution

oco --signoff \<email>

if this takes too long we can alias.

Alternatives

set in some config file

or have a way to not have oco prompt for push oco config set OCO_GITPUSH=false .. then we can && git commit --amend --signoff && git push --force

Additional Context

https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/managing-the-commit-signoff-policy-for-your-repository#about-commit-signoffs

https://wiki.linuxfoundation.org/dco

For linux foundation, DCO is a requirement.

DCO sign-offs must be present on every single commit, or else the contribution will not be accepted. A contributor agreement may be signed by a third party, like a company, on behalf of its employees, whereas the DCO is always an attestation by the author of the contribution.

matscube commented 5 days ago

@kaovilai How about using prepare-commit-msg hook? By doing the following, the AI-generated message by oco will be set from the beginning when you commit with git. This way, you can use all git options in combination.

$ oco hook set // set prepare-commit-msg hook
$ git commit --signoff // in addition to the signoff message, the message generated by oco is set from the beginning (overwriting is also possible)

image

kaovilai commented 4 days ago

Sure if it would be documented as the way opencommit dev prefer to this issue.