Posted on

Commit messages from generator outputs

A practise I always follow while working with tools that generate code is that any code that is generated and not written by me is committed in isolation. This makes skimming through commit logs later easier because generators often generate many files upfront that wouldn’t be edited until much later. So the subsequent commit wouldn’t be littered with changes that aren’t directly related to the actual operation mentioned in the commit message. Also while browsing through commit diffs keeping generated code in their own commits speeds up the reviewing process – because in most cases we already have an idea of what the generated could be, so it can be skipped.