-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
git.promptToSaveFilesBeforeCommit should not warn on unstaged files. #66296
Comments
Hi, can I work on this one? |
@flurmbo Sure! |
I'm not in favor of changing this. Or if it is changed, perhaps give finer grain control over when it prompts. I always want a prompt because I'm a bit lazy and usually let VSCode add the files to staging for me when I commit. |
@rkeithhill I see the value in your use case, but I don't think it makes sense in this feature. If you committed with a file that was untracked but saved this warning wouldn't help you. I think it would make more sense as a separate feature that warns on commit if there are untracked files regardless of save state. |
Experienced this today. I had to loop on this experience 3 times before I finally groked what was occurring and my choices in the dialog. I believe there are two issues here:
Rules triggering dialogIn my scenario today, this was triggered by me having an untracked file named Dialog itselfThis is the dialog I was presented:
I kept clicking cancel. Because I equated This dialog is poorly designed. The question proposed is a yes/no question "Would you like to save it before committing?". Unfortunately, the three buttons are not Setup
|
@diablodale I've rephrased it to @maslade Changed the |
@joaomoreno , The text you proposed doesn't address the situation. Referencing the post I made, the file in question was unstaged. Therefore the text you propose doesn't address the unstaged files that are triggering this dialog box. You could change the text to All of this suggests to me that the feature itself needs rethinking, not just text in the dialog box. Personally (as a focus group of one), I don't want the feature. But someone somewhere though this feature was cool. So exploring with that group can perhaps surface a better mechanism to address their needs. |
I see what you mean now. I simply removed the |
One more small thing, the warning says
But if the file has saved changes and also some unsaved changes, then the file will be included, it's just the unsaved changes that won't be included. This seems like it would be a common case so maybe it could say "will be incomplete in the commit" or "is unsaved and those changes will not be included" or "has unsaved changed that won't be included in the commit" something. |
Changed to |
Issue Type: Feature Request
This new feature is over-eager and triggers on unsaved files that are not part of the commit, which I don't think makes sense. If I have staged file
A.js
and am committing only fileA.js
, I should not receive a warning thatB.js
is unsaved. Ideally it will only consider staged files unless I am committing all staged and unstaged.VS Code version: Code 1.30.2 (61122f8, 2019-01-07T22:54:13.295Z)
OS version: Windows_NT x64 10.0.17763
The text was updated successfully, but these errors were encountered: