Damn cool. “How Git’s Smudge and Clean Filters Work” from @gilesgoatboy.
is equivalent to "run this code whenever you check anything out," and clean is equivalent to "run this code whenever you check anything in." One major caveat to that overgeneralization is that git expects the code you run to be a filter. Because of this, it not only expects input from standard out and passes your code input via standard in, it also suppresses both standard out and standard error. (Like git-bisect , git filters allow you to execute arbitrary Unix software in a very powerful context, opening up the possibility for other use cases , but firmly encourages a particular use case.)