-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Hook : Sort all hooks following an human listing #1830
Comments
This is standard Edit: If you need them to be executed in a specific order just prefix them with |
Hi
I've forgotten to provide a sample, I've an use case with subgit (hook
system to translate git<->svn)
… I would also like to point to one thing: in pre-receive.d/ it would be
better if a symlink to SubGit hook would be called the last, so maybe it's
worth renaming the hooks to
start with numbers if Gitea respects names order:
pre-receive.d/
00-hook1
01-hook2
...
99-symlink-to-subgit-hook
This is because SubGit could translate something to SVN but if there were
a hook running after SubGit hook, this hook could reject the whole push. As
result there would be
a corresponding commit in SVN while "git push" command would fail (and
then SubGit will translate this new SVN revision back to Git and the result
will be as if that later
hook didn't fail at all). It's not a big problem but just a strange
behaviour. E.g.this would be especially strange if the hook running after
SubGit hook would control access to
this or that branch, because its result would be completely ignored. We
had this problem with Gitolite and for it we recommended to make sure Git
hooks are called the last.
|
As said on mine examples, NN prefix is not relevant we can have 10 before 1 |
NN prefix works just fine, |
but could be better to have a predictable sort without considerate separator :) |
But it is predictable. This is literaly how every single |
Hi
Ok as won't be changed, maybe should be better to provide a documentation
about hooks behavior and naming
|
That does however make sense :) |
can this be closed now, to get gitea forward, please? |
Gitea execute hook following a glob listing, in some case this list could be not adapted. Mainly if a hook required to be execute at specific step.
Prefer a
$(ls -1 |sort -h)
looks useful.Then with this list : 01-erere ezaezae 02-erezrze 1-zerezr 10-erezrze 2-erezrze 99-ererer
we obtain actually :
01-erere
02-erezrze
10-erezr
1-zerezr
2-erezrze
99-ererer
ezaezae
As we can see 10 is previous 1
Should be better to get this result :
ezaezae
01-erere
1-zerezr
02-erezrze
2-erezrze
10-erezrze
99-ererer
The text was updated successfully, but these errors were encountered: