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
pre-commit hook affects staging of partially staged files #62
Comments
I read the same thing in their docs this week: https://github.com/nrwl/precise-commits#why-precise-commits |
Workaround:
|
Happy to know I'm not alone, thanks for the workaround :) |
Adding some info after reading in; it's a hard problem to properly fix. After running The problem then is that the stashed changes can conflict with the reformatted files in the working copy when unstashing them. If we're fine with that, we could add a |
Let's ignore this for now. Just keep in mind that you cannot commit partially staged files. |
I keep having serious issues with this, committing partially is an essential element of my workflow that works well for all other projects I work on. I would personally instead choose for disabling the pre-commit hook entirely until this can be fixed. |
@MattijsKneppers I think you are the only one with a workflow like that. Nobody did a thumb up or reported the same issue. Disabling the hook is not really an option we want formatted and code according to the coding standard in the repo. Using the workaround from Narie has drawbacks with conflicts. So I don't really see a way to fix this for your workflow. |
@hjeti True, if I'm the only one using partially staged files I can imagine this is not a priority. |
@MattijsKneppers Lint staged supports partially staged files in version 8.0.0. I've updated all dependencies to the latest version so the latest version of vue skeleton should have support for your workflow. I didn't test it but you can test it now in the latest version of vue-skeleton (v1.7.1). |
@hjeti great news, thanks for chasing this! This is going to make my life and that of the people who's code I keep messing up a lot easier :) |
I can confirm that it is fixed now. |
When pre-commit is enabled in package.json, if files are partially staged in git, all file changes are moved to staged instead.
Explanatory screen grab here (unlisted):
https://youtu.be/U2G7Sso9geU
The issue also stands when using the git CLI.
The text was updated successfully, but these errors were encountered: