Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging when ignoring whitespace, doesn't stage changed whitespace #63397

Open
garyking opened this issue Nov 19, 2018 · 6 comments
Open

Staging when ignoring whitespace, doesn't stage changed whitespace #63397

garyking opened this issue Nov 19, 2018 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues
Milestone

Comments

@garyking
Copy link

Issue Type: Bug

  1. Indent several lines of code, and save. These should appear as changes in Git.
  2. Click on "Open changes".
  3. Ensure whitespace changes are hidden (which is the default).
  4. Select the indented lines, and stage them with "Stage selected ranges".
  5. Nothing is staged. Even though whitespace is hidden, shouldn't changes like indentation be staged, if they're within the selected range? Otherwise I end up with lines like if (true) staged, since it's a text change, but the block contained within its braces as not staged, since it's just an indentation change.

VS Code version: Code 1.29.1 (bc24f98, 2018-11-15T19:06:21.742Z)
OS version: Darwin x64 18.0.0

@vscodebot
Copy link

vscodebot bot commented Nov 19, 2018

@cleidigh cleidigh added the git GIT issues label Nov 19, 2018
@vscodebot vscodebot bot removed the new release label Nov 20, 2018
@joaomoreno
Copy link
Member

Stage selected ranges only works if the diffs are visible. If you show whitespace changes, does the action work?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Nov 22, 2018
@garyking
Copy link
Author

Yeah, if I show whitespace changes, then it works. But I'm asking, why does it work that way? Meaning, if I have whitespace changes hidden, and I stage a range, then the textual changes are staged, but the whitespace changes are not staged. So I end up with a commit that has changes committed without any indentation, so I have to then stage and commit the indentation separately.

Having whitespace changes hidden definitely makes it easier to identify changes, but having to remember to turn it on before any staging every time, is a bit tedious.

@joaomoreno joaomoreno added this to the Backlog milestone Nov 26, 2018
@joaomoreno joaomoreno added feature-request Request for new features or functionality diff-editor Diff editor issues and removed info-needed Issue requires more information from poster labels Nov 26, 2018
@joaomoreno joaomoreno removed their assignment Nov 26, 2018
@admirabilis
Copy link

To anyone arriving from Google, the current workaround is "diffEditor.ignoreTrimWhitespace": false.

@wesinator
Copy link
Contributor

Stage selected ranges only works if the diffs are visible. If you show whitespace changes, does the action work?

@joaomoreno whitespace changes should be displayed (i.e. not ignored) by default.

For Python , whitespace changes are a critical syntatic and semantic aspect of the code .
ignoring whitespace changes by default will break Python code change commits

@joaomoreno joaomoreno added help wanted Issues identified as good community contribution opportunities and removed help wanted Issues identified as good community contribution opportunities labels Oct 9, 2019
@joaomoreno joaomoreno self-assigned this Oct 9, 2019
@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality labels Oct 9, 2019
@alexdima alexdima removed the diff-editor Diff editor issues label Oct 11, 2019
@alystair
Copy link

alystair commented Mar 3, 2020

Thanks @teresaejunior - what a pain in the ass, will use work around. I noticed using selective diff was breaking and had to revert or append commits often. This is currently pretty bad UX :/

@lszomoru lszomoru self-assigned this Oct 4, 2021
Swyter added a commit to Swyter/mab-tools that referenced this issue Dec 9, 2022
…Whitespace": false to make indentation changes appear at all when committing, stupid, it should fix the build: microsoft/vscode#63397 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues
Projects
None yet
Development

No branches or pull requests

9 participants