Multiple git hooks of same type; predefined hooks #8382

Open
opened 2025-11-02 08:04:20 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @johnnybubonic on GitHub (Jan 20, 2022).

Feature Description

This is really a two-part request, but I'd imagine their incorporation would be changing much of the same code.

Multiple same-type git hooks
It is beneficial to be able to create/specify multiple git hooks of the same type (such as gitolite) - this would change the "Git Hooks" configuration options for a repository to contain an orderable list for each hook type supported, and each item in the list would be a specific hook. Hooks would be executed in their specified order upon the relevant action being triggered.

Predefined hooks
Often one may want to define a hook once and then be able to use it for multiple (but not all) repositories. Currently this necessitates copying the hook to each repository - this is particularly a high maintenance cost. Using the concept of system-wide (or perhaps org-wide) git hooks, it allows for changing the hook/maintaining it in a single place and have all usages of it updated at once by reference.

Screenshots

No response

Originally created by @johnnybubonic on GitHub (Jan 20, 2022). ### Feature Description This is really a two-part request, but I'd imagine their incorporation would be changing much of the same code. **Multiple same-type git hooks** It is beneficial to be able to create/specify multiple git hooks of the same type ([such as gitolite](https://gitolite.com/gitolite/non-core#hooks-and-gitolite)) - this would change the "Git Hooks" configuration options for a repository to contain an orderable list for each hook type supported, and each item in the list would be a specific hook. Hooks would be executed in their specified order upon the relevant action being triggered. **Predefined hooks** Often one may want to define a hook once and then be able to use it for multiple (but not all) repositories. Currently this necessitates copying the hook to each repository - this is particularly a high maintenance cost. Using the concept of system-wide (or perhaps org-wide) git hooks, it allows for changing the hook/maintaining it in a single place and have all usages of it updated at once by reference. ### Screenshots _No response_
GiteaMirror added the type/proposal label 2025-11-02 08:04:20 -06:00
Author
Owner

@thearchivalone commented on GitHub (Jan 23, 2022):

Whoa. I just started using gitolite myself as an alternative git server and, despite it taking a bit to get going (the docs are really well done, just requires a substantial amount of reading and possible rage when you make a mistake that breaks it), once I got it going, I found that using a cron job to push to it on timer as a backup was the route I had to go. This would honestly be a great addition. Good luck

@thearchivalone commented on GitHub (Jan 23, 2022): Whoa. I just started using gitolite myself as an alternative git server and, despite it taking a bit to get going (the docs are really well done, just requires a substantial amount of reading and possible rage when you make a mistake that breaks it), once I got it going, I found that using a cron job to push to it on timer as a backup was the route I had to go. This would honestly be a great addition. Good luck
Author
Owner

@kousu commented on GitHub (Feb 25, 2023):

I think this exists now? Under Site Administration > Webhooks.

Screenshot 2023-02-25 at 01-24-58 Gitea Git with a cup of tea

Is this very new? Did this not exist last year?

@kousu commented on GitHub (Feb 25, 2023): I think this exists now? Under Site Administration > Webhooks. ![Screenshot 2023-02-25 at 01-24-58 Gitea Git with a cup of tea](https://user-images.githubusercontent.com/987487/221342271-1cb6ee95-aab5-4aba-94fb-f4c0af3c5c98.png) Is this very new? Did this not exist last year?
Author
Owner

@kousu commented on GitHub (Feb 25, 2023):

Apparently this was added in #10546, a few years ago now.

Hope that helps you out!!

@kousu commented on GitHub (Feb 25, 2023): Apparently this was added in #10546, a few years ago now. Hope that helps you out!!
Author
Owner

@lunny commented on GitHub (Mar 5, 2023):

I think he means git hooks but not webhooks.

@lunny commented on GitHub (Mar 5, 2023): I think he means git hooks but not webhooks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8382