Skip to content

Feature: Pre-commit Hook

Jacob Faibussowitsch requested to merge jacobf/2021-06-03/pre-commit-hook into main

Add a pre-commit hook, which when installed to ./git/hooks/ automatically checks for files over a certain size and aborts the commit. But one can do pretty much everything here, for example run the new linter over the changed files. Potentially gone are the days of filtering the repo for commits containing 3GB meshes that stick around for eternity.

The only downside is that it is impossible to have these hooks come preinstalled (since you can't ship a .git folder with the repo), so its use is still "optional" in that regard. Perhaps we can have configure automatically move it to the git folder if it exists?

See also: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks

Edited by Jacob Faibussowitsch

Merge request reports

Loading