Skip to content

[Feature Request] Discarded changes should be saved in a dated file in the Trash #977

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

Open
dsteinbe-aip opened this issue Feb 12, 2025 · 10 comments
Assignees
Labels
suggestion We are still considering whether it is necessary to add this feature

Comments

@dsteinbe-aip
Copy link

GitHub Desktop can save discarded changes in the Trash, this would be a nice feature. 😁

Discarded changes are saved in a dated file in the Trash

@love-linger
Copy link
Collaborator

Why not use Stash if you want to keep worktree clean and up to date to HEAD, and also save the changes before to another place?

@love-linger love-linger self-assigned this Feb 13, 2025
@dsteinbe-aip
Copy link
Author

Why not use Stash if you want to keep worktree clean and up to date to HEAD, and also save the changes before to another place?

Sure, but sometimes when I´m on fire, I miss to make a stash or use the option while checkout 😅

@love-linger love-linger added the suggestion We are still considering whether it is necessary to add this feature label Feb 18, 2025
@SebastianSchumann
Copy link

I've the same requirement. Switching branches asks how to deal with changes. The last choice is restored and if you're a little bit off you'll discard your changes.

The discarding dialog should be enhanced by an option to store that changed to trash or not.

@love-linger
Copy link
Collaborator

I've the same requirement. Switching branches asks how to deal with changes. The last choice is restored and if you're a little bit off you'll discard your changes.

The discarding dialog should be enhanced by an option to store that changed to trash or not.

This is why I didn't want to add the feature requested in #185 in the first place...

@mithom
Copy link

mithom commented Feb 25, 2025

adding the option to store will only make the dialog more verbose/confusing. With still the same issue of being slightly off resulting in a discard. The current approach lets you safely close the dialog if you want to stash your changes manually. I'm on the side of love-linger here.
remembering options for these actions is asking for trouble. Sane defaults are the better way to go combined with actual preference choices that are remembered (rebase vs merge on pull for example). But anything that is potentially dangerous or never a 'sane default' should not be remembered

@sven-n
Copy link

sven-n commented Feb 28, 2025

I've had a similar problem several times this week. I was in a hurry and didn't pay too much attention to what option was selected for local changes when doing a pull or merge. Unfortunately it was 'discard', which sourcegit remembered from last time. Can we at least agree that it's a bad idea to pre-select 'discard'?

@mithom
Copy link

mithom commented Feb 28, 2025

Can we at least agree that it's a bad idea to pre-select 'discard'?

that, i can agree with, although i'm very happy that the stash & apply option is remembered (my company uses rebasing a lot which makes this a required feature to happily work with git)

@love-linger
Copy link
Collaborator

I decide not to record the last selected handling method for uncommitted local change anymore. Instead, the default option is Do Nothing (let git decide how to handle it - when there are modified files, git will prevent related operations). If necessary, users can change the handling method according to the actual situation on their own.

love-linger added a commit that referenced this issue Feb 28, 2025
@mithom
Copy link

mithom commented Feb 28, 2025

not what i had hoped, but i agree on this decision, this is the smartest solution. only other option (but i will not pursue this) would be to have a preference for the default of this setting, but where are we going then haha

@love-linger
Copy link
Collaborator

#240

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion We are still considering whether it is necessary to add this feature
Projects
None yet
Development

No branches or pull requests

5 participants