From b4ee9d33e5a95b58bdbc0b4cf2cd4c9928d32c7c Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Fri, 20 Dec 2019 21:46:22 +0100 Subject: [PATCH] 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. --- .editorconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.editorconfig b/.editorconfig index 28bb212ebd..81dc8b4ad3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,6 +9,9 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true +[*.diff] +trim_trailing_whitespace = false + [Makefile] indent_style = tab