Do not strip trailing whitespace in Git diffs

Problem: Editorconfig was configured to strip trailing whitespace in all
file types. This is generally a good thing, but when interactive
rebasing with Git and editing the contents of a commit, trailing
whitespace is significant on blank lines and must be preserved in order
for edits to be applied cleanly.

Solution: Update Editorconfig to exclude *.diff from the strip
whitespace rule, as interactive rebasing edits are done in a temporary
file with a '.diff' suffix.
This commit is contained in:
Chris Beams 2019-12-20 21:46:22 +01:00
parent d6a6b9535c
commit b4ee9d33e5
No known key found for this signature in database
GPG Key ID: 3D214F8F5BC5ED73

View File

@ -9,6 +9,9 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.diff]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab