git diff --color-words you can scan changes to be committed faster. Here’s the proof.
Sometimes doing code review can be faster when ‘word-level’ changes are displayed on the same line. Fortunately
--color-words for that purpose
I couldn’t find how to present the example in markdown via pygments lexer as only
diff is supported, so let me attach the screen shot.
# Left git diff a82b90b..983597
# Right git diff --color-words a82b90b..983597
The example is short for the sake of simplicity, but suppose that you have lots of similar changes in a bunch of files.
Usually I switch between the two modes when it is not clear what has been changed. With
--color-words changes like:
- Added / removed dots / semicolons / etc
- And, for example changes in docs like
can be spotted faster, so if you have never tried it out, give it a short next time!