Commit messages are for traceability. Any dev should understand the whys of a given implementation by looking at commits. This means:
- Write useful commit messages
- Avoid modyfing code when not directly needed
The general rule is: Use common sense, ask yourself what a dev, in 18 months, should read when he inspects a line you wrote because he needs to know why things are coded like this.