Closed gabyx closed 5 years ago
We dont have local uninstall? Shouldn't this be supported?
Hm, yeah, maybe. Wouldn't that complain about existing hooks being there potentially? I suppose we can try and see what happens.
Does LFS install hooks into each and every repository by the way? Or do you need to set it up with each repo?
We dont have local uninstall? Shouldn't this be supported?
Yeah, we could delete the Githooks hook from a single repo I suppose.
So we should provide a proper uninstall and afterwards call git lfs install
(since these hooks have never been there, and could have been moved back inplace by the uninstall)
If the lfs hooks have been renamed by githooks, they will fall inplace again and git lfs install
is a noop...
LFS magically initializes hooks when you clone/checkout/init (without githooks installed) how that works I am not sure, if its an internal feature in git
?
LFS magically initializes hooks when you clone/checkout/init (without githooks installed) how that works I am not sure, if its an internal feature in git? That sounds like the Git template directory I used here too to get hooks installed into all the repos.
I checked the git-lfs source, and it looks like it does indeed do a noop install if everything is already in place: https://github.com/git-lfs/git-lfs/blob/df881bf23a08f1b57209825e0f6b2d0b9e6dcd5c/docs/man/git-lfs-install.1.ronn#options
So, yeah, it all makes sense. If you have time, a PR would be awesome, otherwise I'll try to have a look the next time I can.
Thanks!
I think you should probably implement this: I think git hooks uninstall [--global]
should do:
--local
(or --global if its possible)I implemented the changes
Can you please review: PR https://github.com/gabyx/githooks/pull/1
This seems to work. After feature/install-dir
is merged I can submit this request.
Yeah, the main direction seems to be good to me. I'll review a PR when you open one. 👍 Thanks!
I think there is something missing: When we uninstall githooks. the LFS hooks need to be in place again, ->
git lfs install
. Small fix. I think we should include this ifgit lfs is available
, otherwise errors could occur :-)