-
Suggestion
-
Resolution: Unresolved
-
None
-
None
Occasionally I will turn on the "Ignore whitespace" option when reviewing code, but forget and leave it on. A few days later, I may commit some code, and stage each chunk individually from the editor. The white space does not get committed though.
And the selected file shows an empty window with no indication that some changes still exist, other than the file being marked yellow in the staging area. The reason this always throws me off is that I see this exact effect when there are newline bugs and Show Whitespace is enabled, so in those cases, I just discard the file. I've never been able to narrow down what causes that, but it happens enough that I ignore the condition of a file that appears to have no changes in it.
A couple of options for this:
- Simply display a hint in the right window when it is empty but a file still has changes, especially if the "Ignore Whitespace" option is enabled. Something as simple as "There are whitespace changes that are currently not showing. Change your setting to Show Whitespace before committing so you don't lose any changes".
- When comitting with a file that is fully staged with all changes except whitespace changes, maybe present an alert or "Are you sure" explanation
- Add an option when committing to finish committing the remaining whitespace changes.
I'm sure there are some other approaches as well.