go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
43.32k stars 5.33k forks source link

option to disable emoji replacements #23635

Open eveslage opened 1 year ago

eveslage commented 1 year ago

Feature Description

We need an option to disable the inplace emoji replacement in commits.

as c++ developers our commits often reference c++ namespaces like std::thread::

The result you can see in the screenshot. This is a totally different semantic.

Is there a way to disable these replacements completely?

Screenshots

image

eveslage commented 1 year ago

oh, GitHub did the same. I will write my example with spaces: std :: thread ::

silverwind commented 1 year ago

What works on both GitHub and Gitea is to put it in backticks like std::thread::, maybe that's good enough for you.

eveslage commented 1 year ago

since the commit messages are entered in tools like TortioseGit, Visual Studio code, or any other git client, this would not be such a good solution.

silverwind commented 1 year ago

As of recent, commit titles also support backtick syntax, and I'd guess the emoji replacement is disabled inside them as well, but please try it.

Still, I guess a global config switch to disable all emoji tokens would be possible, but it will also need to disable them in JS tribute autocomplete in addition to the backend.

eveslage commented 1 year ago

many of our devs are not aware of the gitea frontend, they just use it as the central git repo by using different client. it will be hard to tell them to use a special syntax for all c++ namespaces in commit messages, because it could be replaced with emojis.

its really not that a big deal. its just that with c++ code specifically this syntax is already overloaded (pun intended) and we really try to not use emojis in our production code base.

silverwind commented 1 year ago

Yes, I could see a option like ui.ENABLE_EMOJI_REPLACEMENT = true being added. As I said, it should also disable the emoji dropdown in the editor.

eveslage commented 1 year ago

I think that would a good option.

pauschuu commented 4 months ago

Ran in to the issue today with std::thread::available_parallelism.

Sorry to sound harsh but to me it's completely unacceptable. A commit message or title is generated by numerous tools and authors who expect their input to remain unchanged.

wxiaoguang commented 4 months ago

Agree to disable some emoji replacement.

A workaround could be quote the text: `std::thread:xxx`

image