-
Notifications
You must be signed in to change notification settings - Fork 220
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
new feature refetch remotes config sync hooks fail #743
Comments
Hey! I found a place where the error happens however lefthook does not log the error, so it's hard to say what was the actual problem. Does it fail the same way if you don't use |
whether I set refetch true or false, It works well when i run
|
So, it only fails if you run lefthook implicitly with Could you please check these steps:
Since you've touched the |
These are the details of my operations, I hope it can help.
|
Ok, I will try to prepare a fix that at least displays the error. I assume that this may be related to configuration merging and Could you share your |
Of course, My config is very simple like:
|
Thank you. I could not reproduce the error but I will release a new version that prints the error so we can have more context on what is the reason. |
If you have a chance to install lefthook with |
Hey, The log I used master version with refetch option is as follows:
My config was like this:
|
Ok, I see that the problem is related to opening a file which is probably being executed at the moment of calling the script. I will need to think out a solution for this issue 🤔 |
Hey, thank you for your reply. Although I am not familiar with Go and Bash, I would like to share my approach. I don't think updating prepare-commit-msg scripts during execution is necessary in this "refetch" case. Would it be feasible to update only remote scripts in the ./.git/info directory instead? |
Yes, I think so, I will try to implement this approach 👍 |
@SirNoSir , could you please check the unpublished version (using the same |
Great! I just tested the latest version. It ran perfectly and correctly, executed the script I had just modified on Git. Thank you for your help! 😄 |
Nice! I will prepare the release later this week 👍 |
🔧 Summary
I test the new feature refetch #736 but a problem occured while synchronizing git hooks.
Lefthook version
I test
version 1.6.15
in windows environment.Steps to reproduce
set
refetch: true
and send a commit.Expected results
Actual results
sync hooks fail, and git hooks files was removed after executing the commit.
Possible Solution
I suspect that the reason for the problem may be that the git hooks script(like prepare-commit-msg etc.) is trying to update itself during execution, the operating system reject this update command.
Also, before using refetch feature I add
lefthook install
command in the rc file, the result is the same and error was file prepare-commit-msg access denied.Maybe just download the remote file without updating git hooks is a way to fix this problem?
Logs / Screenshots
The text was updated successfully, but these errors were encountered: