-
-
Notifications
You must be signed in to change notification settings - Fork 423
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
Unstaged local changes get committed with --no-stash
flag from version 15.2.0
#1468
Comments
The unstaged changes are normally put into the stash, which gets disabled with Why are you using the option in this case? |
We are using The option used to be compatible with having files with some staged and some unstaged changes. Having all of the changes committed is quite confusing. |
If I don't want to change this behavior because both have their pros and cons. One possibility might to add a flag |
Ref #1262 |
Thank you, that clarifies things quite a bit. 🙇 I respectfully disagree that adding unstaged changes is a good default for the following reasons:
The way I understand the situation, the behaviour has recently been changed. But I suppose you are referring to reverting that change and going back to the behaviour in versions
That does sound like a pretty good workaround. 👍 I will vote in favour of the referenced issue. In case I haven't managed to change your mind, I think it makes sense to close this issue now. |
I solved it by using
referred: #1294 |
Description
Unstaged local changes get committed with
--no-stash
flag. This happens from version15.2.0
, and all the way up to the most recent version oflint-staged
.Expected: When unstaged changes exist within a file with staged changes, only the staged changes get committed.
Actual: Both unstaged and staged changes get committed.
Steps to reproduce
Clone this repository and install dependencies using
npm ci
Create a new file and stage the changes:
Make another change to the file with staged changes:
Commit the changes:
Debug Logs
expand to view
Environment
v20.15.0
lint-staged
:15.2.0
The text was updated successfully, but these errors were encountered: