plushu / plushu-git

Plugin that handles Git shell commands (specifically receive-pack) and initializes repos with hook scripts
MIT License
0 stars 0 forks source link

Integrate core.hooksPath #11

Open stuartpb opened 8 years ago

stuartpb commented 8 years ago

This is a new feature introduced in Git 2.9 which allows Plushu to not have to shim its hooks into everything (as mentioned in the README): https://git-scm.com/docs/githooks

stuartpb commented 6 years ago

My thinking right now is that we'll have this be a runtime check in https://github.com/plushu/plushu-git/blob/master/hooks/create-repo/10_git-init that, if the version of Git is adequately new, only adds a config option to the repo pointing it to this plugin's hooks.

Or, really, honestly... I think I'd rather just have, like, a git plugin that does the intercepting-commands-with-the-config-stuff-changed thing, and a git-legacy-hook-link plugin that does the actually-symlinking-the-files-on-repo-creation stuff - and then the latter can be a part of the Plusku setup for the foreseeable future (and it can have a check during setup that says "You can safely uninstall this plugin if you don't expect Git to ever roll back"), and this plugin won't need it, because it has no need to be intrusive to repos on its own.

...feh.

stuartpb commented 6 years ago

Actually, you know what? Now that I think about it, I feel like the Git-commands-always-link-into-Git behavior of this plugin is kind of a core assumption of the plugin, but also it should be forward-looking enough to not rely on legacy, intrusive behavior. Luckily, since it's actually installed as part of install in the core installation script, I can cheat a little from the usual restrictions I'm following around what's the domain of setups / what's the domain of install scripts / what's the domain of user choice, and have the install script make the choice as to whether the aforementioned git-link-new-repo-hooks plugin is necessary to install (and probably outputting a message to that effect either way, explaining the tradeoff).

stuartpb commented 6 years ago

Reminder that this will necessitate a tweak to the README in https://github.com/plushu/plushu-git-apps

stuartpb commented 6 years ago

Also, the git-link-new-repo-hooks plugin would need to announce on uninstallation that any hooks links should probably get undone (but not actually do the unlinking).