Skip to content

Commit

Permalink
Do not strip trailing whitespace in Git diffs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cbeams committed Jan 10, 2020
1 parent d6a6b95 commit b4ee9d3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.diff]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab

Expand Down

0 comments on commit b4ee9d3

Please sign in to comment.