✨ add gitmoji-aware commit message generation#658
✨ add gitmoji-aware commit message generation#658SOUMITRO-SAHA wants to merge 2 commits intopingdotgg:mainfrom
Conversation
- Read `t3code.commitMessageStyle` from git config to switch prompt style - Wire `GitCore` into `CodexTextGeneration` runtime/test layers - Add coverage for gitmoji/conventional fallback cases and new feature docs
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I feel like this is not the best way to do this, nor should we? I believe we could instead tailor the prompt to give the ai a snippet of some of the previous commit messages, and ask it to follow the same detected style. This way we can ensure that we support the majority of commit message patterns without hard-coding anything like this. @t3dotgg Do you have an plans around this kind of work that you want to weigh in with? My above "solution" would work to resolve: |
|
Hi @binbandit , thanks for the suggestion and sorry for the delayed reply. I did not receive the notification earlier and only noticed your comment while reviewing my PRs today. Your idea about adapting the prompt using a few previous commit messages to detect and follow the existing style makes sense. That approach would likely make the system more flexible and avoid hard-coding behaviour for specific commit formats. When I originally implemented this change, I interpreted the issue as requesting a switchable feature (enable/disable). Because of that, I added the configuration option to explicitly control the behaviour. My goal was to provide a straightforward solution that satisfies the requirement described in the issue. However, I agree that dynamically inferring the style from recent commit messages could be a cleaner and more scalable approach. It would allow the tool to support different commit message conventions (with emojis, without emojis, conventional commits, etc.) without needing explicit configuration. Before making further changes, I would like to confirm the preferred direction with the maintainers. Would you prefer that I update this implementation to follow the prompt-based approach you suggested, or should the configurable switch remain the intended solution? Happy to adjust the implementation based on the maintainers’ guidance. |
|
@juliusmarminge until I get knighted, you wanna speak to this? |
t3code.commitMessageStylefrom git config to switch prompt styleGitCoreintoCodexTextGenerationruntime/test layersWhat Changed
This PR adds support for
gitmoji-stylecommit messages by reading git configuration and adjusting the AI prompt accordingly.Implementation:
t3code.commitMessageStylefrom git config during commit message generationGitCoreservice intoCodexTextGenerationlayer to access configgitmoji→ Include gitmoji emoji instructions and examplesconventionalor unset → Use conventional commit styleuse-gitmoji)docs/features/gitmoji-support.mdFiles changed:
apps/server/src/git/Layers/CodexTextGeneration.ts- Core implementationapps/server/src/git/Layers/CodexTextGeneration.test.ts- Test coverageapps/server/src/serverLayers.ts- Layer compositiondocs/features/gitmoji-support.md- User documentationWhy
Addresses #638 - Users requested
gitmojisupport to keep generated commits consistent with repos that already usegitmoji. This is especially useful for teams that have adopted gitmoji as part of their workflow.Approach:
UI Changes
N/A - This is a backend-only change. The generated commit messages will include gitmoji emojis when enabled.
Checklist
Example:
Before:
After:
Note
Add gitmoji-aware commit message generation by reading
t3code.commitMessageStyleingit.Layers.CodexTextGeneration.generateCommitMessageand wiringGitCoreintoCodexTextGenerationLivegenerateCommitMessagereadst3code.commitMessageStyleviaGitCoreand builds a gitmoji or conventional prompt with a 72‑char subject rule; server wiring providesGitCoretoCodexTextGenerationLive; tests cover config parsing and prompt rules; docs describe configuration.📍Where to Start
Start with
makeCodexTextGenerationandgenerateCommitMessagein CodexTextGeneration.ts, then review the layer wiring in serverLayers.ts.Macroscope summarized 330ea17.