-
Notifications
You must be signed in to change notification settings - Fork 408
Support Gitmoji Format in Commit Messages #249
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
Support Gitmoji Format in Commit Messages #249
Conversation
…t GitMoji convention and descriptions of changes 📝 docs(prompts.ts): update prompt message to include information about GitMoji convention and descriptions of changes
…ove conventional commit word from commit prompts 🐛 (prompts.ts): remove conventional commit word from `commitFix` and `commitFeat` prompts to improve clarity 📝 (removeConventionalCommitWord.ts): add `removeConventionalCommitWord` function to remove conventional commit word from commit message
…er-GitMoji-Support
|
Hi @malpou, I've tested your PR locally, and it does enhance the specificity of GPT's emoji output, moving away from the constant use of 🔧. However, it seems to have lost the prefixing of messages with tags like Additionally, the increased token count due to the inclusion of various emojis and explanations may not be universally beneficial. Perhaps a flag to toggle this feature on a per-commit basis could be a worthwhile addition. What do you think? |
|
Thanks for looking at it @shkreios The loss of As my understanding the Quote from issue:
If it should be a flag I'm not sure: I think these changes are moving us closer to having two options of commit messages one being Conventional Commits and the other being GitMoji. Then the If we go with this approach we should maybe work on the prompts making our non-emoji messages be more forced towards the conventional commits spec: https://www.conventionalcommits.org/en/v1.0.0/#specification Let me hear your thoughts 😄 cc: @stalinkay & @di-sukharev |
|
Hey @malpou,
Understood, and it's logical to align with the Conventional Commits standard. While I personally preferred the prior commit style, the standard takes precedence.
My primary concern is the frequent need to switch between |
|
I just had an idea, What if we select a few standard emojis from GitMoji and always add these to the emoji prompts. Then I'll add a flag you can include if you want ALL of the GitMoji emojis. Toughts @shkreios ? |
|
The flag could be called |
|
This is the list of emojis i would prioritize:
|
… '--fgm' flag in the CLI command 🔧 (commit.ts): pass the value of the 'fgm' flag to the 'commit' function to enable or disable full GitMoji specification ♻️ (commit.ts): refactor the 'commit' function to accept the 'fullGitMojiSpec' parameter and pass it to the 'commit' function recursively ♻️ (generateCommitMessageFromGitDiff.ts): refactor the 'generateCommitMessageByDiff' function to accept the 'fullGitMojiSpec' parameter and pass it to the 'generateCommitMessageChatCompletionPrompt' function ♻️ (generateCommitMessageFromGitDiff.ts): refactor the 'generateCommitMessageChatCompletionPrompt' function to accept the 'fullGitMojiSpec' parameter and pass it to the 'getMainCommitPrompt' function ♻️ (generateCommitMessageFromGitDiff.ts): refactor the 'getCommitMsgsPromisesFromFileDiffs' function to accept the 'fullGitMojiSpec' parameter and pass it to the 'getMessagesPromisesByChangesInFile' function ♻️ (generateCommitMessageFromGitDiff.ts): refactor the 'getMessagesPromisesByChangesInFile' function to accept the 'fullGitMojiSpec' parameter and pass it to the 'generateCommitMessageChatCompletionPrompt' function ♻️ (prompts.ts): refactor the 'getMainCommitPrompt' function to accept the 'fullGitMojiSpec' parameter and pass it to the 'INIT_MAIN_PROMPT' function
…mmand to enable the use of the full GitMoji specification
|
@shkreios there is new stuff to look at whenever you have time 😄 |
…cation 📝 (README.md): add link to the GitMoji specification for reference
… Specification` flag 🔧 (api.ts): update the default value of the `apiKey` variable to a placeholder value for testing purposes
… GitMoji Specification` flag" This reverts commit 230a4aa.
… Specification` flag
…n about the fullGitMojiSpec flag and provide instructions on how to choose the right emoji for the commit message
|
@di-sukharev |
|
@shkreios there is new stuff to look at whenever you have time 😄 Sorry i was currently busy i try to have a look this week |
|
Stale pull request message |
|
will test and merge |
|
@malpou i've resolved the readme conflict, have you tested this PR by building |
This PR modifies opencommit to better support the Gitmoji convention, ensuring compatibility with projects that currently use Gitmoji.
Changes
Added a utility method in
removeConventionalCommitWord.tsto adjust the commit format according to the Gitmoji guidelines.Updated
prompts.tsto dynamically generate prompts based on whether theOCO_EMOJIconfiguration option is enabled. When enabled, prompts will guide users to follow the Gitmoji format.Notes
I'm unsure if this is the best approach to implement Gitmoji support. Specifically:
Issue #239
Feedback is much appreciated!
Best regards
@malpou