Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Git hooks

From: Ross Jacobs <rossbjacobs@xxxxxxxxx>
Date: Mon, 20 May 2019 15:57:47 +0100
Hi Dario,

You should take a look at pre-commit, which is another way to enforce code quality. To run the tools in the tools folder, you would add a script hook in a `.pre-commit-config.yaml`.
To initialize your repo with hooks, you would use `pre-commit install`.

It's also possible to use server checks on push, which gitlab is capable of (to what extent is that already being done?).

Cheers,
Ross

On Mon, May 20, 2019 at 9:37 AM Dario Lombardo <lomato@xxxxxxxxx> wrote:
Hi list
In the current development process we're trying to enforce the contribution quality by providing git hooks that help the developer to push better changes.
Those hooks are provided in the 'tools' directory. According to the developer instructions they must be copied to .git/hooks to be used by git. They're a copy, then they're not updated with git while their "original" is. This can be improved under unix by creating a hard link. Unfortunately there is no way to fully automate this process, but I think there is room for improvement.

We could create a new directory under the tree called like 'git-hooks', and put all the git hooks we want under that. Then we change the developer instructions to use the command 'git config core.hooksPath git-hooks'. This approach would have many advantages:
1) it's the only way the wsdg tells to use
2) makes the hooks versioned
3) works on unix and on windows (although I haven't tried the hooks on windows)

What about this approach? Any drawbacks I can't see?
Dario.

--
Naima is online.
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe