-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Support merging with git LFS hooks #729
Conversation
2039dcb
to
806fe49
Compare
If local |
Hmm that's a good point. I could see two ways of fixing that problem:
|
❯ git lfs install
Hook already exists: pre-push
#!/bin/sh
# husky
# Created by Husky v4.2.5 (https://github.com/typicode/husky#readme)
# At: 6/1/2020, 6:14:22 PM
# From: /ant-design/node_modules/husky (https://github.com/typicode/husky#readme)
. "$(dirname "$0")/husky.sh"
To resolve this, either:
1: run `git lfs update --manual` for instructions on how to merge hooks.
2: run `git lfs update --force` to overwrite your hook. |
What if it was like this instead: ❯ git lfs install
Hook already exists: pre-push
#!/bin/sh
# husky
# Created by Husky v4.2.5 (https://github.com/typicode/husky#readme)
# At: 6/1/2020, 6:14:22 PM
# From: /ant-design/node_modules/husky (https://github.com/typicode/husky#readme)
# See the following documentation for using husky with git lfs: [url to documentation]
. "$(dirname "$0")/husky.sh"
To resolve this, either:
1: run `git lfs update --manual` for instructions on how to merge hooks.
2: run `git lfs update --force` to overwrite your hook. Note the added comment above |
@typicode Look like good. Please help check, thanks |
Any chances this can be merged? |
@jdtzmn Any chance you could resolve the merge soon? I can't wait to see this PR land 😀 |
@kawazoe Done! |
Thanks! I hope that with a passing build, we have more chances of the PR getting merged quickly. ;) EDIT: Eh, talked too quickly... |
Oops- I forgot to update the snapshots. I'll fix that. |
@kawazoe I'm not sure why the checks are failing. Running |
@jdtzmn I took a quick peak at the CI logs and it looks like the only issue is with prettier's linting:
|
@kawazoe I saw that as well, but the error is caused by the Normally I would believe the CI over my local environment, but I've checked every file in the project called Let me know what you think. |
@jdtzmn from what I'm seeing, checks have been failing on this file for a while now: https://github.com/typicode/husky/commits/master/src/installer/checkGitVersion.ts @typicode could you please look into it? |
Sorry for the late reply and thanks for the PR! I didn't run the code, but wouldn't it append husky's shell script multiple time if husky installer is run multiple times (for example when upgrading from v4.x.y to v4.x.z or with That said, it should be easier to have LFS work with husky 5 as hooks are exposed in |
I've this exact same issue, but it isn't solved by this PR. The difference is that mine is on our CI pipeline on Azure Devop. On each run, when git-lfs is enabled for this pipeline, it does run Any idea how I can workaround this? |
Disclaimer: I don't think that this will handle updating hooks if git lfs hooks are present. I would consider adding functionality to check if there is git-lfs and husky installed and then only update husky, but that might be more advanced than this pr should be.