Repository navigation
Description
Description
Enhance the display of commit messages by rendering SemVer tags as colored badges, improving clarity and readability.
Visual Example
Current commit view:
Proposed improvement:
Detailed Explanation
semantic-release prefixes commit messages with conventional labels (e.g., feat, fix, chore), creating a structured naming convention. Currently, commit titles look like this:
GitHub does not visually distinguish SemVer prefixes from the rest of the commit message, making it harder to quickly identify commit types. These prefixes, however, are crucial for tools that automatically generate changelogs and versioning.
By transforming these prefixes into colored badges, we can instantly communicate the purpose of each commit:
- Red for
fix - Green for
feat - Gray for
chore - Orange/Brown for
refactor(and similar types)
The scope (inside parentheses) could be displayed next to the commit type, as shown in the example.
Customization Options
To increase flexibility, the following options could be added:
- Badge Position: Display the badge either before or after the commit title.
- Color Customization: Allow users to customize badge colors for each commit type.
- Custom Types: Let users define additional commit types and assign specific colors to them.
Guideline Compliance:
- Existing solutions: No known userscripts or extensions provide this functionality after a thorough search.
- Universal applicability: SemVer is widely adopted in libraries, making this feature useful for most users.
- No options required: The SemVer specification dictates clear rules, so additional options are unnecessary. Customization (e.g., color changes) could be optional.
- Minimal UI/code effort: This feature only replaces the prefix with a colored badge, requiring minimal code changes.
- No external server: The badge rendering can happen statically, with no need for server interactions.
- No increased HTTP traffic: The solution is entirely client-side and does not introduce additional network requests.
- Scope of enhancement: This enhancement targets commit views, not GitHub Projects.
Example URLs
https://github.com/revanced/revanced-patches/commits (In the list of commits)
ReVanced/revanced-patches@09e3b30 (Where the commit is shown)
https://github.com/revanced/revanced-patches (Where the last commit is shown)



Activity
fregante commentedon Sep 8, 2024
Thanks for the detailed issue. It would be interesting to explore this concept, particularly to turn those keywords into colors for example. Two concerns:
oSumAtrIX commentedon Sep 8, 2024
Thank you for the quick response! I'd like to share my perspective on the points you raised:
You're correct that the commit title is technically altered, but this is only in terms of display. Let's consider this example commit title:
feat: Render semantic release prefix as badgesThis would be rendered as:
No semantic information is lost here; the prefix is simply displayed in a more user-friendly manner (which is intentional). A similar case can be seen in changelogs, where commits like "bug:" are converted to user-facing content:
This process is made possible by adhering to a standard commit format like SemVer. The prefix, while crucial for syntax, is not fundamentally part of the commit title, allowing it to be consumed programmatically for various uses like this.
While this is understandable, SemVer is designed specifically for libraries with a public API, as stated in the SemVer specification. It provides a standard for adding semantics to commits, categorizing them into groups like features, bug fixes, or refactoring. Tools like
semantic-releaseleverage this standard to automatically generate releases based on commit types. This format serves two key purposes:A. Commits are immediately recognizable as a specific type, such as a feature or bug fix.
B. Commits can be programmatically processed, enabling automated versioning (e.g., bug fixes bump the patch version, while features bump the minor version).
In this sense, semantic-release treats commit prefixes as syntax—similar to how HTML syntax is rendered for users in a more human-readable way. The prefix serves a functional purpose but is not meant to be shown directly to the user. SemVer and semantic-release are widely adopted conventions for versioning and release automation across many languages and ecosystems:
While some might opt against using SemVer, it’s worth noting that it is near-universally adopted (you’ve likely encountered it in the form of versions like "v1.2.3" without realizing it). Its simplicity and programmatic processability make it a practical choice for many. I hope to bring more motivation to your attention 😁 PS: I would happily contribute to this feature (I am currently exploring the project source to learn how to do that and have opened a draft PR #7796)
fregante commentedon Sep 9, 2024
True but your example is 80% why semantic release exists: to create release notes. People expect the commit to be trimmed and turned into human-readable grouped document. When looking at commit lists (the source of truth) however one might be surprised to see that the commit titles are altered in place.
This is why I suggested as a start to just color-code commits instead of trimming their titles. This can help visually parse a list without causing possibly-undesired side effects.
https://semver.org/ is not the same as https://github.com/semantic-release, I’m talking about the commit format, not the versioning system.
oSumAtrIX commentedon Sep 9, 2024
semantic release is primarily used for automating versioning and releases as the name suggests. The commit titles are altered to begin with to fit the syntax requirements of semantic release. The actual commit message is the title after the colon and the commit hash holds the actual source of truth. The title is a fancy alias of the hash to describe it. Following that purpose, semantic release actually has a negative impact in a certain way as it requires adding contextual information for the purpose of semantic release next to the actual message that describes the commit. The reason it does that is to enable programs the ability to programmatically process the actual commit titles that describe the commit which as explained earlier comes after the colon. This can be seen in the changelogs as well where the actual commit titles are printed and not the syntactical prefix used for the programmatic purpose. For that reason I believe that the prefix can be rendered in a fancy way where it makes it actually more readable and enhances the purpose and goal of a commit title, to describe the commit. Adding a colored label, separating it from the actual commit title describing the commit achieves exactly this, all while this commit syntax being used for such very reason.
How the PR I made currently works is that it parses the commit type and scope and converts it to a label as described in the Primer design language GitHub uses. It states labels are used to add contextual information and may use the format "a: ..." which I have applied for the commit type and scope. If no scope is present the type will be used as the label. As you can see the actual message is prefixes by contextual information and thus is the perfect subject to be displayed as a label as part of the Primer design language. Next to that the commit itself is barely altered. The original commit in its original naked form only received a styling for it's prefix and a little change from parenthesis to a colon as part of the Primer design language. Semantic release uses () because the prefix already ends with a colon and it would be weird to have two colons in the message. This issue does not exist when rendered, therefore also no motivation for parenthesis. A colon on the other hand adheres to Primers design language and is more readable than parenthesis. Of course we can still violate the design language and keep the original raw naked commit message. In this case the label with a scope, the current unaltered prefix would simply be styled as a label, but I see no real motivation to do that when we have the option to adhere to the design language all while making it simpler to read, which is the purpose of a commit title.
fregante commentedon Sep 9, 2024
By the way, please replace the “example URLs” with repos that actually use semantic release.
oSumAtrIX commentedon Sep 9, 2024
Understood. I saw one commit that was eligible to be rendered as a semantic release (It started with "Mode:") so I thought an official link would be more suitable.
fregante commentedon Sep 9, 2024
Which is why I don’t like it. So much tooling just to save a couple of minutes visually parsing the commit list and sorting the release notes. And now we’re here discussing further tooling to make the situation slightly better.
While reading the rest of your comment I realized that
fix:is a valid semrel prefix, but also a common prefix for everyone else. We can’t affect repos (i.e. trim commit titles) where people don’t use semrel. I suppose this could be avoided by attempting to parse the rest of the list for “obvious” semrel usage (e.g. the keywordchore); this adds further logic/code.Also keep in mind that GitHub already parses and alters commit title in place, for example by
formattingbackticked word and linkifying issue references like #7795, so safely altering commit titles might not be straightforward.For these reasons I’d be more open to lightly color code commits than to trim them, it would be safer and less controversial.
We actually have a tool that would allow us to safely and easily dim the semrel keywords in order to reduce noise without eliminating it: https://github.com/fregante/zip-text-nodes I can explain how to integrate this later.
oSumAtrIX commentedon Sep 9, 2024
What you don't like is using something unfinished. Semantic release is adding syntax to commits. What's left is to process them like it is done by the PR. Suddenly this way, the commits get more readable, descriptive and programmatically processable.
I have written the code in a way which allows easily counting the amount of semantic commits. A threshold can be used to detect a semantic commits repo, usually if most commits are semantic commits so a threshold of 90% could be used for example. Still, the prefix is parsed into a label, which fix: is regardless of semantic release. It is subject to be rendered as a label. fix: is just contextual information.
I have already accounted for that in my implementation.
GitHub already "trims" them in the DOM. Backticked words for example are trimmed and styled. Why not prefixes too? Instead of a gray background they get a semantically fitting label background. This feature neatly integrates into GitHub as is. To only make the prefix lightly colored, I'd just need to change the css a bit, the rest of the code would remain the same. A label is preferred due to the design language because prefix are contextual information, but if the style really bothers you we could make it an option and just lightly color the prefix by default. Let me know what you think
[-]Render SemVer prefix (used in `semantic-release` for example) as colored badges [/-][+]Render conventional commits as colored labels prefixing the commit message [/+][-]Render conventional commits as colored labels prefixing the commit message [/-][+]Display conventional commits as colored labels before the commit message [/+]Rami-0 commentedon Dec 13, 2025
Hello, have they removed this one? I used it a lot, and it disappeared lately.
fregante commentedon Dec 13, 2025
It was broken and the latest version should fix it. Try v25.12.12