-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
"Git: Unstage Selected Range" does not revert "Git: Stage Selected Range" on the same range #156748
Comments
@SimonTheLeg, thank you very much for the detailed repro steps. I have looked into this and while I do agree with you that the experience is not ideal, looking at the code, this seems to be the intended behaviour. The "Stage/Unstage Selected Ranges" commands are always present in the command palette but there are several conditions that have to be fulfilled in order for the command to execute (ex: there has to be an opened document, there has to be a selection, the selection has to contain changes, etc.). If any of these conditions are unmet, the command will not execute. In the case of the "Unstage Selected Ranges", the selection has to be made on the right side of the diff editor (Index), and the selection has to contain changes. There are couple of things that we could to in order to avoid the confusion:
@joaomoreno, what are your thoughts? |
@Iszomorou those sound like massive limitations. I'm coming over from atom, since now it's sunset... 😢 and I could open a single combined diff view and unstage or stage any line I wanted by selecting it, right clicking and selecting "stage/unstage selected" it was a hugely useful workflow and not being able to undelete a section that has been removed because you can only stage/unstage on the "right" side is, to put it frankly, dumb. it's completely unintuitive to anybody coming from a another IDE where things "just work(tm)" |
@SampsonCrowley, thank you very much for your feedback and apologies for not getting back to you on this until now. I will take another look here to see if there is anything that we can do to enable this functionality. |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
Select line 2 like so
Run "Git: Stage Selected Ranges". Everything should look fine, the range is being staged, like so
With the same selection (pic), run "Git: Unstage Selected Ranges"
The selection is not being unstaged, everything stays as before. I would have expected that the selection is being unstaged
Additional Notes:
This is similar to #120928, but not exactly the same. Because in my case the "Stage Selected Ranges" does work outside of the diff view, just the "Unstaging" does not. Therefore I decided to open a separate issue.
The text was updated successfully, but these errors were encountered: