Skip to content
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

"Undo commit" dialog: can't false warnings be transparently handled? #18388

Open
aybe opened this issue Apr 1, 2024 · 4 comments
Open

"Undo commit" dialog: can't false warnings be transparently handled? #18388

aybe opened this issue Apr 1, 2024 · 4 comments

Comments

@aybe
Copy link

aybe commented Apr 1, 2024

The feature request

Example:

  • I commit .editorconfig
  • in fact I didn't intend to do it now (lol)
  • so I undo the change
  • greeted by the following message which is incorrect

The actual message:

image

The reality:

No changes will ever be lost, file was committed in whole, there are no remaining changes that would be overwritten if undo-ing.

Proposed solution

Maybe the software could avoid showing these false warnings for such cases?

There could be an option to set this behavior.

If these messages are tied to accessibility, above option should be original behavior so as to not break accessibility experience.

Additional context

No response

@pichpeyman

This comment has been minimized.

@steveward
Copy link
Member

@aybe thanks for the issue. Just to confirm -- were there uncommitted changes present in your repository, but they weren't for the .editorconfig file?

The modal shows if there are any uncommitted changes (you can see some context around this in #12341 (review)). We tend to prefer to warn when at all possible since there are quite a few scenarios at play here that can cause lost data or confusion, and is also why we provide the option to disable the dialog.

@steveward steveward added the more-info-needed The submitter needs to provide more information about the issue label Apr 1, 2024
@aybe
Copy link
Author

aybe commented Apr 1, 2024

Just to confirm -- were there uncommitted changes present in your repository, but they weren't for the .editorconfig file?

Exactly, other changes but not for the file being undo-ed.


Ironically, I just realized that there is already the option to disable the behavior...
It's funny how people tend to ignore everything around when they see a warning!🤣

I checked it and tried, yes, it is dangerous; I modified .editorconfig then undo-ed previous commit and it gave no warning.
I'd rather have the warning as I happen to commit specific lines but eventually can make mistakes so usual undo is a safety net.

But if somehow there could be a 'smart' behavior that is between the actual ones, that would be much appreciated!

@github-actions github-actions bot removed the more-info-needed The submitter needs to provide more information about the issue label Apr 1, 2024
@tidy-dev
Copy link
Contributor

tidy-dev commented Apr 3, 2024

Drive by comment. Restoring a stash does what I think is requested here and only warns if there are files with the same name in the stash and in the changes list so possibility to reuse logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants