feat: add refetch_frequency parameter to settings #857
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
⚡ Summary
First of all, thanks everyone for the great tool!
The
remote
feature of lefthook allows us at the place where I work to easily share configuration across our hundreds of repositories. Usually, our devs have some dozens of repositories cloned on their machines and work actively in one or two at a time. To ensure that they will have a reasonably recent config when going back to a repo after some time, we configure our remotes withrefetch: true
, but this has the side effect that every time they run lefthook on a currently active repository, either by commiting something or by hand to manually check the output of the QA tools, they trigger a fetch.To make the experience smother, this PR introduces a new parameter
refetch_frequency
that allows a more fine grained control over the remote refetching by allowing the definition of time periods instead of just a boolean flag. This is a working implementation already, but it defers some decisions that could be made to maybe improve the usability. I didn't want to touch the following points without consulting the core team before, but:refetch
, so maybe it could be marked deprecated;I also apologize in advance for any oddities in the code, I'm not a go programmer, but I can make changes that you see fit to make the PR more fitting.
☑️ Checklist