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

"Reset unstaged files" with "deleted added files" should not delete ignored files by default #5849

Closed
johndog opened this issue Dec 4, 2018 · 13 comments · Fixed by #6002
Closed
Assignees
Labels
type: bug 🐛 type: regression regression, normally to latest official release
Milestone

Comments

@johndog
Copy link

johndog commented Dec 4, 2018

Probably a bug. Other issues like #2204 suggest that ignored files were only deleted if the filter was changed to include them.

What is the current behavior?

  1. Go to Commit UI with some unstaged changes
  2. Click "Reset unstaged changes"
  3. Click the checkbox to delete added files, then OK

Result: "git reset -f -d -x" is run, with -x indicating that ignored files should be deleted.
Expect: Don't include -x by default.

Environment:

  • Git Extensions 3.00.00.03-RC2
  • 8cbcd2b (Dirty)
  • Git 2.19.0.gvfs.1.34.gc7fb556
  • Microsoft Windows NT 10.0.18290.0
  • .NET Framework 4.8.3694.0
  • DPI X:100.00% Y:100.00%

Did this work in previous version of GitExtensions (which)?
I believe we see the expected behavior in the release build of GitExtensions, this is the first RC build I've tried and the first time I've observed the behavior.

@gerhardol
Copy link
Member

I do not expect this command to have changed since 2.51

Yes, git-clean -x is what is intended. Make the caption should be changed to "Also delete untracked files and directories".

@johndog
Copy link
Author

johndog commented Dec 4, 2018 via email

@MonkAlex
Copy link

MonkAlex commented Dec 27, 2018

So, now i know, who delete all my local configs

Good job =_=

@gerhardol
Copy link
Member

Suggest text is changed to "Also delete ignored and untracked files and directories"

@gerhardol gerhardol added this to the 3.1.0 milestone Dec 27, 2018
@vbjay
Copy link
Contributor

vbjay commented Dec 27, 2018 via email

@johndog
Copy link
Author

johndog commented Dec 27, 2018 via email

@vbjay
Copy link
Contributor

vbjay commented Dec 27, 2018

git clean options. What we need is to run git clean -d if new files check box is checked. Add another checkbox that asks about ignored files. In the dialog add a listbox or listview that uses git clean with the -n option to list the files that would be cleaned along with what reset would do.

2 cases:

  1. User hits one of the reset ... changes buttons. This case ignores file selection. Dialog comes up with the new/untracked files and ignore checkboxes. git clean -n is run and we union what git reset would reset. If only unstaged files, we filter to exclude staged changes.

  2. User selects files and hits r or right clicks selected files. We use -- option to only clean/reset specific files. We still do what 1 would do but we only include files that were selected so if you didn't show ignored files and selected file(s) or didn't select any ignored files, the ignored files checkbox would not be checked and it would be disabled. If no untracked files were selected then uncheck untracked files and disable it.

Always include -f in clean arguments. We update the list when user changes checkboxes.

@gerhardol
Copy link
Member

The intention with this command was likely to only delete the not ignored files, this is why this option is grayed out if there are no untracked (not ignored files). The arguments are slightly conflicting.

I will submit a PR to only delete non ignored files.

A second step would be to add a second checkbox for ignored files too.
Compare to the clean catalog that has tree options: nonignored, ignored, nonignored+ignored. This dialog could be changed for consistency (but 'none' makes no sense here).

@vbjay
Copy link
Contributor

vbjay commented Dec 27, 2018

None does make sense. It would just be a git reset and no clean.

@vbjay
Copy link
Contributor

vbjay commented Dec 27, 2018

Related: #5937

@gerhardol
Copy link
Member

Regression in 3.0, from c9b4e25

@gerhardol gerhardol added type: bug 🐛 type: regression regression, normally to latest official release and removed status: ready labels Dec 27, 2018
@gerhardol gerhardol modified the milestones: 3.1.0, 3.0.1 Dec 27, 2018
@johndog
Copy link
Author

johndog commented Jan 2, 2019

Is there a pointer somewhere to current builds of head of master ?

@vbjay
Copy link
Contributor

vbjay commented Jan 2, 2019

image Canary in readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 type: regression regression, normally to latest official release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants