rycus86 / githooks

Githooks: per-repo and global Git hooks with version control
MIT License
382 stars 20 forks source link

LFS initialize after uninstall #43

Closed gabyx closed 5 years ago

gabyx commented 5 years ago

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 if git lfs is available, otherwise errors could occur :-)

gabyx commented 5 years ago

We dont have local uninstall? Shouldn't this be supported?

rycus86 commented 5 years ago

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?

rycus86 commented 5 years ago

We dont have local uninstall? Shouldn't this be supported?

Yeah, we could delete the Githooks hook from a single repo I suppose.

gabyx commented 5 years ago

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?

rycus86 commented 5 years ago

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!

gabyx commented 5 years ago

I think you should probably implement this: I think git hooks uninstall [--global] should do:

gabyx commented 5 years ago

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.

rycus86 commented 5 years ago

Yeah, the main direction seems to be good to me. I'll review a PR when you open one. 👍 Thanks!