Skip to content

Undocumented pre-receive git hook from template directory #34768

Open
@xor-gate

Description

@xor-gate

Description

Hi All,

I manage a gitea server for small company and want to enforce branch naming using server side git pre-receive hook. Now I have enabled git hook execution on server side in app.ini via DISABLE_GIT_HOOKS = false. If i debug print directly in /var/lib/gitea/data/gitea-repositories/<org>/<repo>/hooks/pre-receive.d/gitea then this script is executed. When I place gitea server wide scripts under /var/lib/gitea/custom/hooks/pre-receive.d/branch-policy.sh then this script is not executed. Is this even possible? I cant find anything in the documentation or in the code this path is valid to have a list of scripts to be executed by gitea. It is highly likely Gemini AI search was hallucinating this template/server side directory is available as feature.

It would be nice to have server wide hooks instead of patching every repository. Maybe I'm doing something wrong or don't understand it because of the lack of documentation (or not sure where to find it).

Thanks in advance!

Gitea Version

v1.24.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

v2.39.5

Operating System

Linux (Debian 12)

How are you running Gitea?

From downloads under systemd, no package from Debian

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions