-
Notifications
You must be signed in to change notification settings - Fork 2
[Question] Why is post-commit part of suggested setup? #20
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
Comments
@Svish Thanks for your question! It is true that in the scenario you describe, the additional However, there are other cases like when using |
Ah, ok, that makes sense. I do find it kind of annoying that it runs |
@Svish The current logic is in this git command: run-if-changed/src/gitChangedFilesSinceLastHead.js Lines 3 to 14 in ebef4cd
So it runs: git diff-tree --name-only --no-commit-id -r HEAD@{1} HEAD This would return a newline-separated list of pathnames that are changed between the previous and the current state of the Everything is around the I'm not sure how you would imagine changing that check, but if you can provide some ideas I can help with the git part. I think a different solution would be to reduce the cost of the unnecessary And if the problem is not about the speed, we can just hide the output when not doing anything substantial. |
Just wondering why the
post-commit
hook is part of the suggested setup. I understand the other 3, but, yeah... 🤔From what I can understand, the setup checks
package-lock.json
for changes and runsnpm install
if it has any. Makes sense for the other 3, but in what cases wouldpackage-lock.json
change withoutnpm install
having been run already as part of a commit? For example if I upgrade or add a package, I runnpm install new-package
, which updates thepackage.json
andpackage-lock.json
files, and then I rungit commit
to commit that change.What's the use of running
npm install
again after that as part of thepost-commit
hook? Or is there a case I'm not thinking of here?The text was updated successfully, but these errors were encountered: