Reject commits based on patterns of commit messages #9982

Open
opened 2025-11-02 08:54:53 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @typeless on GitHub (Dec 15, 2022).

Feature Description

I think it would be great if Gitea can have a per-repository setting that can automatically reject commits that don't include certain trailers (and even check the number of those trailers). Specifically, I would like to reject commits that don't have enough count of the Reviewed-by lines or the trailers with patterns configurable by the repo owner. It's particularly helpful in a patch-based workflow.

This can be done by git server hooks, but it has been disabled by default due to security concerns.
So, it probably makes sense to have a web UI for such functionality. I have no idea if any other Git hosting software has implemented it though.

Screenshots

No response

Originally created by @typeless on GitHub (Dec 15, 2022). ### Feature Description I think it would be great if Gitea can have a per-repository setting that can automatically reject commits that don't include certain trailers (and even check the number of those trailers). Specifically, I would like to reject commits that don't have enough count of the `Reviewed-by` lines or the trailers with patterns configurable by the repo owner. It's particularly helpful in a patch-based workflow. This can be done by git server hooks, but it has been disabled by default due to security concerns. So, it probably makes sense to have a web UI for such functionality. I have no idea if any other Git hosting software has implemented it though. ### Screenshots _No response_
GiteaMirror added the type/proposaltype/feature labels 2025-11-02 08:54:53 -06:00
Author
Owner

@xochitlhct commented on GitHub (Jan 26, 2023):

You can re-enable the git hook interface on the webpage by changing the server configuration and restarting the server. Then you will see the Git Hooks tab after navigating to a specific repository's settings.
[security]
DISABLE_GIT_HOOKS = false
Document: https://docs.gitea.io/en-us/config-cheat-sheet/
https://forum.cloudron.io/topic/3975/gitea-git-hooks-disabled/2

@xochitlhct commented on GitHub (Jan 26, 2023): You can re-enable the git hook interface on the webpage by changing the server configuration and restarting the server. Then you will see the Git Hooks tab after navigating to a specific repository's settings. [security] DISABLE_GIT_HOOKS = false Document: https://docs.gitea.io/en-us/config-cheat-sheet/ https://forum.cloudron.io/topic/3975/gitea-git-hooks-disabled/2
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9982