JonBlog
Thoughts on website ideas, PHP and other tech topics, plus going car-free
Git post-commit hook to print author
Categories: Ideas, Outline

A nice easy project proposal, for Git users. Every Git user who maintains several profiles has run into this problem: an email address used for committing gets used in the wrong context, and the error is only noticed much later, perhaps when local commits are pushed to a remote repo. The solution is easy: run a local post-commit hook that echos the real name and email address that is attached to the commit; if it’s wrong, the user can immediately change their config and amend the commit.

Leave a Reply