Closed gabyx closed 3 years ago
@Nithin Gunasekaran: thanks for the compliment and great that it worked out for gitea.
I was just thinking about extending the server doc with respect to gitea (since gitea does some akward things like overwriting hooks in .git/hooks
and basically placing the installed githooks
runner script into a e.g. pre-receive.d
folder which means the manager runs after the gitea hooks etc...). I will let you know when I maybe have time to do this.
Actually we have never tested a setup to run git hooks shared update
when executing a hook. :-P. Good that it works, it will just git clone/pull
the shared hooks which are configured for this repo. I think you are running git hooks shared upadate
on the pre-receive hook in the codebase repo (not in the hooks repo) on the server, otherwise I dont understand how it should work :-)? I think your usecase should be transformed into a PR to automatically update shared hooks also on a pre-receive hook (which is only run on the server side). Currently this is not the case:
https://github.com/rycus86/githooks/blob/ab86d2a529f58744a71e79227e434f19b84589e6/base-template.sh#L520
So you can get rid of this manual CLI invocation.
With #119 , it should be possible on the server to directly use a local path to the bare hooks repo (if it is also located on the same server) in the codebase repo's shared hooks. But that does not enable automatic
@gabyx, since both the repositories resided in the same server, it worked for us. The intention was to not have any server side hooks configured on the code-base-repo. It's great that you already have a PR solves that issue as well!
Ah, because you directly use a local path right? something like git hooks shared --local /data/git/repositories/hooks.git
In #119 , local paths will be forbidden in .githooks/.shared
(the git hooks shared --local
) and #125 will introduce local/global
shared hooks through the Git config as well as shared hooks trough the .shared
file. So once this is contributed you need eventually to move the entry from .githooks/.shared
to the git config --local githooks.shared
variable. But more on that later.
@nithin001 See latest changes and githooks.sharedHooksUpdateTriggers
you can set.
I recently had a conversation with someone who needed assistance with setting up hooks on gitea: I thought about sharing his feedback with all of the contributors here: