Git hooked
Session Description
Git hooks make for a great help in OSS maintenance and are a very practical and useful tool that a lot of organisations in the software industry can benefit from adopting but I feel there's a lack a conversation or a lack of exposure around them.
This workshop will cover how git handles hooks internally (alongwith an overview of git internals), how to write your own hooks, the pre-commit framework, a bingo of common problems you might face setting up your own hooks or sharing them and demonstrations of how I've adopted pre-commit hooks in professional settings as well as fun experiments I've done on my own personal workflows (meta-hooks, fun TUI updates).
Introduction to git hooks
What git hooks are and why they matter
Local vs. server-side hooks (brief overview, focus on local)
Real-world examples of hooks in action
Going over Git internals relevant to hooks: how Git executes them, what chaining/limitations exist.
Exploring built-in hooks
Tour of the
.git/hooksdirectoryDemo: activating a sample hook
Hands-on with Pre-Commit hooks
Writing a simple custom hook
Adding checks for commit messages, file changes, or secrets
Sharing hooks across a team
Other useful hooks
Exploring the uses for
commit-msg,pre-pushandpost-merge
Leveraging the ecosystem
Introduction to
pre-commitframework (multi-language support, shareable configs)Using Husky for JavaScript/Node projects
Comparing custom hooks vs. ecosystem tools
Building complex hooks
Either pick from a prepared list of fun/useful hook ideas or add support for a project you already use
Putting It All Together
Designing a hook strategy for your workflow/team
Where hooks fit in modern CI practices
Resources to go further
Key Takeaways
What Git hooks are and how they fit into development workflows
Hands-on experience writing and customizing Git hooks
How you can integrate hooks into team projects with frameworks like
pre-commitor HuskyExplore creative and practical applications to make workflows smoother
By covering projects that enable you to go beyond default IDE code-formatting and linting in general functionalities as well as in specific field examples, the workshop aims to get folks aware about adopting existing pre-commit hooks as well as to start thinking creatively in this space about how they can make hooks to work within their own specific contexts and software practices.
Session Categories
Speakers
Akshit Tyagi