sourcegit icon indicating copy to clipboard operation
sourcegit copied to clipboard

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

Open dsteinbe-aip opened this issue 10 months ago • 11 comments

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

dsteinbe-aip avatar Feb 12 '25 15:02 dsteinbe-aip

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 avatar Feb 13 '25 02:02 love-linger

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 😅

dsteinbe-aip avatar Feb 13 '25 06:02 dsteinbe-aip

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.

SebastianSchumann avatar Feb 24 '25 13:02 SebastianSchumann

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...

love-linger avatar Feb 24 '25 13:02 love-linger

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

mithom avatar Feb 25 '25 10:02 mithom

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'?

sven-n avatar Feb 28 '25 12:02 sven-n

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)

mithom avatar Feb 28 '25 13:02 mithom

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 avatar Feb 28 '25 14:02 love-linger

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

mithom avatar Feb 28 '25 14:02 mithom

#240

love-linger avatar Mar 07 '25 02:03 love-linger

Image

Hello,

This request is still in discussion? I implement this feature but I can't tested it on Linux and Mac. Can I still make a PR or post the file to be review?

BR, Xavier

#1516

xavierdono avatar Jul 03 '25 12:07 xavierdono