-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Proposal: hook improvements #8935
Comments
A palette of git hooks with useful functionality could be added too. For example. |
Consider setting git config core.hooksPath: By default Git will look for your hooks in the $GIT_DIR/hooks directory. Set this to different path, e.g. /etc/git/hooks, and Git will try to find your hooks in that directory, e.g. /etc/git/hooks/pre-receive instead of in $GIT_DIR/hooks/pre-receive. The path can be either absolute or relative. A relative path is taken as relative to the directory where the hooks are run (see the "DESCRIPTION" section of githooks[5]). This configuration variable is useful in cases where you’d like to centrally configure your Git hooks instead of configuring them on a per-repository basis, or as a more flexible and centralized alternative to having an init.templateDir where you’ve changed default hooks. |
We could actually set this and avoid the no exec problem in gitea-repositories etc. |
@zeripath Can this be generalized as "add configurable settings to .git/config on repo creation"? So other settings can be added (I don't know, there might be something else that's useful). For example, in
Then, in
I guess we need to keep Gitea from managing them (e.g. overwrite them?), however. |
Yeah that could very easily be done. Writing to the per repository git config is probably the best bet as then any git commands that try to touch the repo outside of Gitea automatically also get the settings. I think it's find if Gitea touches other git config settings - they're our repos in the end. We also need to manage how configs work with our temporary repos. |
this point is basically related to issue 1089, isn't it? |
@alexanderadam I'll link that issue here, since this one is more comprehensive. |
I am sorry to revamping a nearly 2 years old topic, but I am having this issue when running gitea with docker. I mounted the disk containing Is there a workaround? As I understood the proposed API has not been implemented yet and I am not well versed enough with the project to contribute by myself. Thanks! |
How about adding the --template argument here? Line 75 in 6870453
According to git-init(1):
So another option would be to set the GIT_TEMPLATE_DIR environment variable in an specific setup. I've tried setting the init.tempalteDir option in the .gitconfig file of the user running the Gitea server but it didn't work. Gitea might be doing something to the execution context of the commands or the git config that I'm not aware of. But that would not be enough, the hook resync admin action should reinstall the template too. Maybe that's a new "reinit" action? |
Here's a list of improvements for git and web hooks that might be of interest:
core.hooksPath
) to solve issues like noexec file-systems.Related: #1089
The text was updated successfully, but these errors were encountered: