desktop / desktop

Focus on what matters instead of fighting with Git.
https://desktop.github.com
MIT License
19.71k stars 9.42k forks source link

Command + Delete should discard the selected file, not remove the repository #11924

Open norbiu opened 3 years ago

norbiu commented 3 years ago

Describe the feature or problem you’d like to solve

Whenever I delete a file in Finder, I use the Cmd + Delete shortcut to do so. Because of this muscle memory, I ended up deleting my local repository from Github Desktop dozens of times when I meant to just discard a selected file.

Proposed solution

After selecting a file or multiple files in the "Changes" tab, I'd like to be able to use the Cmd + Delete shortcut to discard the selected files.

billygriffin commented 3 years ago

Hi @norbiu, thanks for the issue and sorry you're running into that. Because shortcuts are commonly used, we try not to change them, so we're going to leave the remove repo shortcut as is. There's not currently a shortcut to discard a single file or subset, but there is Shift + Cmd + Delete to discard all changes. Are you usually discarding one or a subset, or would that shortcut work to meet most of your use cases?

norbiu commented 3 years ago

Hi @billygriffin, that's too bad. But I could get used to having an alternative shortcut. I never used Shift + Cmd + Delete because I mostly need it for a couple of files when I'm going through the list before I commit.

mrudelle commented 3 years ago

I just made that mistake for the third or fourth time in the last few months (confirmation panels are not working when you think you know what the panels says, but you don't).

@billygriffin I understand your reasoning for not changing a shortcut. However here this is a specific context where some changes are selected in the change list. The behaviour could be changed to target selected changes if any, rather than the whole repo. The latter is confusing, in my commonly used softwares (Finder, Lightrom, Jetbrain's IDEs, ...) this shortcut targets the currently selected items. That said I do not have access to any telemetry so that's only my 2 cents.

Like @norbiu a shortcut for clearing changes would not be useful to me either, more often than not I select a subset of changes.

steveward commented 2 years ago

Requested in https://github.com/desktop/desktop/issues/15033.

steveward commented 1 year ago

Requested in https://github.com/desktop/desktop/issues/16548.