Skip to content
mnaoumov.dev
Go back

Useful git hooks - Part 4

Continuing Useful git hooks - Part 3

Lots of git hooks were written since my last blogpost.

I really want to sum up what was done so far.

All the hooks are available on BitBucket and GitHub repos

We have simple branching model: master represents future releases, at some point we are creating a separate release branch and then only adding bug fixes for those branches. At the moment we have 4 release branches (including master) and not being careful developers can mess up the repo.

That was the original idea to build some safety net to help developers to enforce the best practices.

The very first hook was written by my tech lead, is to ensure that people prefix their commit messages with corresponding TFS WorkItem ID. Yeah, this is the only thing which I liked in TFS source control system and miss in git - easy link changesets with tasks.

Later on we made that hook more interactive, added WPF for GUI dialog, and console interaction for console prompts.

Then we decided to implement hooks to enforce all the git rules and best practices that we have

Implementation of all these hooks heavily improved my git knowledge and I solved a lot of interesting problems.

I will create a separate blogpost describing the most interesting findings.

For now, I abandoned all the hooks tests because it became too complex to write them, I have to review the whole approach and make hooks more tests-friendly. Ideally they should be unit testable.


Share this post on:

Previous Post
Parse git merge commit messages
Next Post
WTF_ PowerShell 3 _ Cygwin