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.87k stars 5.38k forks source link

Multiple git hooks of same type; predefined hooks #18339

Open johnnybubonic opened 2 years ago

johnnybubonic commented 2 years ago

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

bedwardly-down commented 2 years ago

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

kousu commented 1 year ago

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 1 year ago

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

Hope that helps you out!!

lunny commented 1 year ago

I think he means git hooks but not webhooks.