Skip to content

✨ add gitmoji-aware commit message generation#658

Open
SOUMITRO-SAHA wants to merge 2 commits intopingdotgg:mainfrom
SOUMITRO-SAHA:feature/gitmoji-commit-support-638
Open

✨ add gitmoji-aware commit message generation#658
SOUMITRO-SAHA wants to merge 2 commits intopingdotgg:mainfrom
SOUMITRO-SAHA:feature/gitmoji-commit-support-638

Conversation

@SOUMITRO-SAHA
Copy link

@SOUMITRO-SAHA SOUMITRO-SAHA commented Mar 9, 2026

  • 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

What Changed

This PR adds support for gitmoji-style commit messages by reading git configuration and adjusting the AI prompt accordingly.

Implementation:

  • Read t3code.commitMessageStyle from git config during commit message generation
  • Wire GitCore service into CodexTextGeneration layer to access config
  • Conditionally modify AI prompt based on config value:
    • gitmoji → Include gitmoji emoji instructions and examples
    • conventional or unset → Use conventional commit style
  • Handle case-insensitive matching and partial matches (e.g., use-gitmoji)
  • Add 8 comprehensive test cases covering all config scenarios
  • Add user documentation in docs/features/gitmoji-support.md
    Files changed:
  • apps/server/src/git/Layers/CodexTextGeneration.ts - Core implementation
  • apps/server/src/git/Layers/CodexTextGeneration.test.ts - Test coverage
  • apps/server/src/serverLayers.ts - Layer composition
  • docs/features/gitmoji-support.md - User documentation

Why

Addresses #638 - Users requested gitmoji support to keep generated commits consistent with repos that already use gitmoji. This is especially useful for teams that have adopted gitmoji as part of their workflow.

Approach:

  • Configuration-based: Users opt-in via git config (no breaking changes)
  • Backward compatible: Defaults to conventional style when config not set
  • Flexible: Supports repository-specific and global configuration
  • Safe: Handles invalid config values gracefully with fallback to conventional

UI Changes

N/A - This is a backend-only change. The generated commit messages will include gitmoji emojis when enabled.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Example:

Before:

add gitmoji feature documentation

- Add comprehensive guide in docs/features/gitmoji-support.md
- Document enable/disable commands
- Include commit examples with and without gitmoji
- List supported gitmoji emojis
- Note platform availability (web, desktop)

After:

✨ add gitmoji-aware commit message generation

- 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
- Add comprehensive guide in docs/features/gitmoji-support.md
- Note platform availability (web, desktop)

Note

Add gitmoji-aware commit message generation by reading t3code.commitMessageStyle in git.Layers.CodexTextGeneration.generateCommitMessage and wiring GitCore into CodexTextGenerationLive

generateCommitMessage reads t3code.commitMessageStyle via GitCore and builds a gitmoji or conventional prompt with a 72‑char subject rule; server wiring provides GitCore to CodexTextGenerationLive; tests cover config parsing and prompt rules; docs describe configuration.

📍Where to Start

Start with makeCodexTextGeneration and generateCommitMessage in CodexTextGeneration.ts, then review the layer wiring in serverLayers.ts.

Macroscope summarized 330ea17.

- 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
@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 36f6fcdd-9552-4036-bbf2-eae9900bd57e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Mar 9, 2026
@binbandit
Copy link
Contributor

binbandit commented Mar 9, 2026

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:

@SOUMITRO-SAHA
Copy link
Author

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.
Thanks again for the feedback.

@binbandit
Copy link
Contributor

@juliusmarminge until I get knighted, you wanna speak to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants