[PATCH] git: move non-kallithea hooks and execute other hooks

Thomas De Schampheleire patrickdepinguin at gmail.com
Tue Oct 20 20:12:17 UTC 2020


Hi Tim,

El mar., 20 oct. 2020 a las 21:12, Tim Ooms (<tim.ooms at aeronomie.be>)
escribió:

> Hi Thomas,
>
> Yes, I did.
>
> The goal of the patch is to not break the non-kallithea hook scripts
> that may be present when doing a rescan and reinstall (after an update
> for example) and at the same time supporting the execution of
> third-party hook scripts next to the kallithea ones.
>
> When using the force parameter, instead of overwriting the non-kallithea
> hook script, it renames the script by adding .<date>.<kallithea-version>
> to it (can off course be something else).
>
> The new version of the kallithea hook script will execute all scripts in
> the hook-directory matching <hook-name>.*.* (should just match previous
> pattern). This way, it executes the previously installed hook script and
> possible other hook scripts the admin added matching the pattern.
>

Thanks for the background.
In general, we encourage contributors to write clear commit messages with
all necessary info to understand the what/why/how of changes. So info like
the above would be great to have in such commit message.

For these changes, I think they can be seen as two separate things and
should therefore better be two separate patches:
- support running additional git hooks in addition to the kallithea one
- rename existing git hooks rather than overwriting them, when 'force' is
given.

I'm not sure if the second part is really necessary: it should normally
only occur once, the code adds quite some complexity for such mundane task
of renaming a file. Perhaps it could be enough to have clear enough
documentation or messages?
Let's see what Mads Kiilerich thinks.

For the first part, I can see that it can be useful.
See also the comments on following proposed change, for a recent discussion
regarding the git hooks and how it is implemented internally:
https://kallithea-scm.org/repos/kallithea-incoming/changeset/c63dd3aeacdbbd77349bb2b9100dee5ba0c3fda6

Best regards,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20201020/3324cf43/attachment.html>


More information about the kallithea-general mailing list