Better visual presentation of an error message coming from a git hook #5086

Open
opened 2025-11-02 06:13:58 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @mshgh on GitHub (Mar 20, 2020).

  • Gitea version (or commit ref): 1.11.3 docker image
  • Git version: not relevant
  • Operating system: not relevant
  • Database (use [x]): not relevant
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist: not relevant

Description

Creating separate issue based on request in https://github.com/go-gitea/gitea/issues/10322#issuecomment-601037000

I would like to have better visual presentation of an error message coming from a git hook. See screenshot below.

I can see two possible solutions
a) we allow HTML to be used in the message. Very flexible, possibly dangerous, but as only site admin can create git hooks this should be ok, I think.
or
b) the message is displayed in pre-formatted block which itself is centered however its content is left-aligned. So, in the example below, commits are nicely aligned one under another.

Screenshots

MergeFailMessage

Originally created by @mshgh on GitHub (Mar 20, 2020). - Gitea version (or commit ref): 1.11.3 docker image - Git version: not relevant - Operating system: not relevant - Database (use `[x]`): not relevant - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: not relevant ## Description Creating separate issue based on request in https://github.com/go-gitea/gitea/issues/10322#issuecomment-601037000 I would like to have better visual presentation of an error message coming from a git hook. See screenshot below. I can see two possible solutions a) we allow HTML to be used in the message. Very flexible, possibly dangerous, but as only site admin can create git hooks this should be ok, I think. or b) the message is displayed in pre-formatted block which itself is centered however its content is left-aligned. So, in the example below, commits are nicely aligned one under another. ## Screenshots ![MergeFailMessage](https://user-images.githubusercontent.com/36337240/77143116-80f42c80-6a82-11ea-976e-019cd0020e5d.png)
GiteaMirror added the type/proposal label 2025-11-02 06:13:58 -06:00
Author
Owner

@zeripath commented on GitHub (Mar 22, 2020):

My suspicion is that a user could almost always get round this and end up causing unescaped strings

@zeripath commented on GitHub (Mar 22, 2020): My suspicion is that a user could almost always get round this and end up causing unescaped strings
Author
Owner

@mshgh commented on GitHub (Mar 23, 2020):

Did I get it right you suggest there is a way how to prepare error message so the markup is processed?
If so can you tell me how to make this work? I am not a golang-man...

echo "Foo <b>bar</b>" >&2
exit 1
@mshgh commented on GitHub (Mar 23, 2020): Did I get it right you suggest there is a way how to prepare error message so the markup is processed? If so can you tell me how to make this work? I am not a golang-man... ``` bash echo "Foo <b>bar</b>" >&2 exit 1 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5086