melos
melos copied to clipboard
request: auto sign-off when commit use `melos version`
Is there an existing feature request for this?
- [X] I have searched the existing issues.
Command
No response
Description
Add sign-off and GPG sign for commits.
Reasoning
Signing a commit in git is a necessary thing to ensure that the commit was initiated by a validator.
Additional context and comments
In commits, the command I often use is git commit --signoff -S
I wish there was an option added to melos version
I'm not sure if Melos should directly support this itself, however we can enable you to do this perhaps by adding another hook to the version command (https://melos.invertase.dev/commands/version#hooks) that allows you to do your own command for committing already staged files (like preCommit allows you to stage your own extra things)
Wdyt? And are you willing to do a PR for it? 😄
I can't understand the precommit part of the document and what step this preCommit does. I can only view it through the source code.
If I were to open PR to handle the problem, I should do one of the following two things:
- Custom args for git commit are allowed in version, and these parameters are inserted into the git commit command as they are.
- Add two flags to version subcommand, params name like git commit command, use -S(--gpg-sign=xxx), -s(--signoff).
Of course, they all also support configuring corresponding parameters in melos.yaml
I would also like to see this supported.
Isn't it enough if you just set git config commit.gpgsign true in the repository?
Nope commit signing and the Signed-off-by tag are different things.
Nope commit signing and the Signed-off-by tag are different things.
Ah right, of course. I guess the only way to do it outside of melos is something like this then:
git config --global alias.c 'commit -s'