You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right clicking and choosing to 'discard changes' works as expected, however it seems selection jumps to the first item in the list and a subsequent right click and choosing 'discard changes' appears to be choosing the right row visually... but it actually discards the first time in the list
Version
GitHub Desktop: 1.2.0
Operating system: 10.13.4 (17E199)
Steps to Reproduce
have a repo with unstaged changes
right click on something down the list
choose 'discard changes'
without clicking anywhere else first, right click on something else down the list
choose 'discard changes'
Expected Behavior
I expect the second thing I right clicked on to be discarded
I wonder if this is what I've been seeing. On several occasions the wrong files have been discarded, but I could never repro.
Luckily the changes go to Trash, but unlike on Windows it seems on a Mac I have to then manually navigate to the specific folder and drag them back, which is a bit tedious.
I think the times I've seen this I've been debugging something, so had debug prints and a fix in my working directory. I switched back to GHD, aimed to discard the debug prints, but somehow lost the fix. I think it's happened with a multi-file selection but I can't say for sure - every time it happens and I tried to repro, I failed.
Ok I just saw my issue again; though I'm not sure if it's exactly what's reported above. Basically, if you right-click on any file that is not selected, then click Discard, the prompt has the previously-selected file in it (like the context menu decides which item is selected before the visual selection moves to the item under the mouse on the click).
The file shown in the discard prompt is, as far as I can tell, accurate to what gets discarded. So the danger is if you don't read the filename in the prompt rather than it just deleting a different file.
Activity
steveward commentedon May 25, 2018
Good catch @IanKeen! I was able to reproduce this as well, so I'm going to mark this as a 🐛 .
DanTup commentedon Jul 14, 2018
I wonder if this is what I've been seeing. On several occasions the wrong files have been discarded, but I could never repro.
Luckily the changes go to Trash, but unlike on Windows it seems on a Mac I have to then manually navigate to the specific folder and drag them back, which is a bit tedious.
I think the times I've seen this I've been debugging something, so had debug prints and a fix in my working directory. I switched back to GHD, aimed to discard the debug prints, but somehow lost the fix. I think it's happened with a multi-file selection but I can't say for sure - every time it happens and I tried to repro, I failed.
DanTup commentedon Jul 18, 2018
Ok I just saw my issue again; though I'm not sure if it's exactly what's reported above. Basically, if you right-click on any file that is not selected, then click Discard, the prompt has the previously-selected file in it (like the context menu decides which item is selected before the visual selection moves to the item under the mouse on the click).
The file shown in the discard prompt is, as far as I can tell, accurate to what gets discarded. So the danger is if you don't read the filename in the prompt rather than it just deleting a different file.
billygriffin commentedon Jul 18, 2018
Confirmed @DanTup's feedback that it's the previously selected file that is the one shown in the prompt. Thanks for clarifying!