Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request: auto sign-off when commit use melos version #591

Open
1 task done
CaiJingLong opened this issue Oct 20, 2023 · 6 comments
Open
1 task done

request: auto sign-off when commit use melos version #591

CaiJingLong opened this issue Oct 20, 2023 · 6 comments
Labels
feature request Needs: Triage The issue needs triaging

Comments

@CaiJingLong
Copy link

Is there an existing feature request for this?

  • 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

@CaiJingLong CaiJingLong added feature request Needs: Triage The issue needs triaging labels Oct 20, 2023
@CaiJingLong CaiJingLong changed the title request: auto sign-off when commit request: auto sign-off when commit use melos version Oct 20, 2023
@Salakar
Copy link
Member

Salakar commented Nov 6, 2023

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? 😄

@CaiJingLong
Copy link
Author

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:

  1. Custom args for git commit are allowed in version, and these parameters are inserted into the git commit command as they are.
  2. 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

@provokateurin
Copy link

I would also like to see this supported.

@spydon
Copy link
Collaborator

spydon commented Jan 7, 2024

Isn't it enough if you just set git config commit.gpgsign true in the repository?

@provokateurin
Copy link

Nope commit signing and the Signed-off-by tag are different things.

@spydon
Copy link
Collaborator

spydon commented Jan 7, 2024

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Needs: Triage The issue needs triaging
Projects
None yet
Development

No branches or pull requests

4 participants