gabyx / Githooks

🦎 Githooks: per-repo and shared Git hooks with version control and auto update. [✩Star] if you're using it!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Configurable time between update checks, or store last update time outside .gitconfig

agentydragon opened this issue · comments

commented

Hi, I have my dotfiles including .gitconfig stored in a repository.

The githooks update mechanism stores the last time an autoupdate check was performed in .gitconfig, and checks every 24 hours.

This means that basically every time I go into my dotfiles repo, I'll see a spurious diff in the timestamp caused by githooks having executed an autoupdate check since my last commit.

Minor annoyance but it'd be nice to get it fixed.

I think .gitconfig isn't the best place for this, I think one better place for autoupdate time might be XDG_CACHE_DIR or something.

Or alternatively, another thing that would make the slight annoyance less annoying would be ability to set githooks to autoupdate on a longer interval than 24 hours - i.e. having an option for this interval rather than it being hardcoded in

return time.Since(lastUpdateCheck).Hours() > 24.0 //nolint: gomnd

Thanks for your work on this, good piece of software!

Hi, I also have that issue, that the gitconfig is changed due to this...

You are totally right. I guess its only the autoupdate time which is a problem, right.
So I could easily move that part out to the ~/.githooks/.last-update-time. Would make also my dotfiles easier.
I might do that in while.

PS> Thanks for the report and for the kudos. I tried hard to make this thing as bomb proof as possible (to my flavor it has too many features, should get reduced somewhat, I think the manual install as described is the most useful, everything else just gets in your ways because so many repos are clones in different places on a dev machine, in the background and githooks will interfere therre too, although not doing things but it runs everywhere basically.

commented

thanks for the quick fix :)