Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support post-merge and post-commit git hooks #5120

Open
2 of 7 tasks
stealthybox opened this issue Mar 23, 2018 · 0 comments
Open
2 of 7 tasks

Support post-merge and post-commit git hooks #5120

stealthybox opened this issue Mar 23, 2018 · 0 comments
Labels
🎯 feature Categorizes as related to a new feature

Comments

@stealthybox
Copy link

  • Gogs version: 0.11.34.1122
  • Git version: 1.8.3.1
  • Operating system: CentOS Linux release 7.4.1708 (Core)
  • Database:
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gogs.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

It would be useful to support post-merge and other git hooks intended for local use on the gogs remote.

My use-case would be to run a git hook when a pull-request is merged.

This is part of the use case in #96 -- it's possible to run hooks when a user pushes to the repo's remote but not when gogs modifies the repo locally such when merging a pull request or modifying files in the web UI.

post-commit may be useful for resolving #4338.

However, I don't believe these hooks are supported on bare repositories.
I tried manually adding post-commit and post-merge hooks to the gogs bare repo, and they did not run when editing files in the UI or merging pull-requests.

We could exec these hooks during these actions from the Web UI, but that would make the behavior non-standard.
If we write code to exec scripts in a non-standard way, we could name the files in a gogs namespace such as ./hooks/gogs-post-merge or ./hooks/gogs/post-commit

cc: @unknwon / @xiayhub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 feature Categorizes as related to a new feature
Projects
None yet
Development

No branches or pull requests

2 participants