-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Handle GPG sign git config for initial commit #5823
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
Conversation
I prefer to change the error message.
|
No problem 👍 Question: Should the error message be something like this? `Skipped git commit due to missing username and email in git config${gpgSign === 'true' ? ' or failed to sign commit' : '' }.` |
I think either is fine. The message looks good to me. |
👍 Should I also add this to prevent GPG signing on testing/debugging? if (isTestOrDebug) {
await run('git', ['config', 'user.name', 'test'])
await run('git', ['config', 'user.email', '[email protected]'])
+ await run('git', ['config', '--unset', 'commit.gpgSign'])
} |
Yeah, that would be nice. |
If git config `commit.gpgSign` is `true`, warning will be expanded to also say that failed commit may be due to failure to sign commit. Addresses #5818
Sets git config `commit.gpgSign` on test or debug to false in order to stop git from attempting to sign commit with a GPG signature that does not belong to [email protected] Addresses #5818
if (isTestOrDebug) {
await run('git', ['config', 'user.name', 'test'])
await run('git', ['config', 'user.email', '[email protected]'])
+ await run('git', ['config', 'commit.gpgSign', 'false'])
} Did this instead because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
@char101 Thanks for the feedback! I'll fix this ASAP. |
Fix the issue described at vuejs#5823 (comment) This simplifies the logic, thus less error-prone. The error message is still correct anyway.
😨 I apologize for this! I didn't notice this behavior in my environment. I should have also tested in an environment where the option was never set. |
Fix the issue described at #5823 (comment) This simplifies the logic, thus less error-prone. The error message is still correct anyway.
Fixes #5818
If the git config optioncommit.gpgSign
is setto
true
, passes the flag--no-gpg-sign
whencreating the initial commit, then warns user that
initial commit is not signed and instructs how
to sign the initial commit
If git config
commit.gpgSign = true
, then warning on failed initial commit is expanded to also state that failure to commit couldbe due to failure to sign commit. Also sets the
commit.gpgSign
config tofalse
if testing or debugging.What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
Other information:
This PR will change🙂vue create
to never sign the initial commit. My personal opinion is that this is the preferred behavior, since I wouldn't want to default to signing a commit that I did not create. But another way to fix #5818 would be to continue to attempt GPG sign ifcommit.gpgSign = true
in git config, and make warning say that commit failed due to missing username, email, or failure to sign commit. If you think it is better to continue signing and change thegitCommitFailed
warning instead, I could create a PR for that instead