-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Why are git hooks disabled by default? #2885
Comments
Nope, I think it's reasonable that if the hooks exist and are executable, you expect them to be executed. I think we were hesitant to just run stuff without you knowing we would run stuff, but I think opt-out makes more sense in this case. |
Maybe you guys should enable this setting in a future update and change it to be enabled by default and letting people know about this change? (Because it's really tedious to enable it for all my projects) |
I actually disagree with this change. Take a tool like trunk.io, an amazing tool which can manage you git hooks, but it still explictictly asks to enable git hooks. I think turning on by default in a Git Tool like this could lead to confusion with some users, leading to them blaming butler for not working when their hooks might be the thing which is incompatible. There should be an explicit understanding when the hooks are enabled which separates the hook problems from the client. |
I don't think it would cause issues, I saw GitButler improved how it shows errors from git hooks, they only run if you set them up anyway but if your team uses git hooks and someone uses GitButler and doesn't know that they are off by default they end up committing broken code or unlinted code which in my opinion causes more issues. I think when you first import it there should be an option which is checked by default giving the user the choice. |
This is where my point about things breaking comes from though, I could say the reverse. Some of my team, don't understand how Git Hooks work - not fully at least - and on a few occasions when something has gone wrong, I've had users come to me with "My VSCode is broken" and it turns out to be a hook isn't playing nice and isn't well displayed to the user. I think the key takeaway is: Whichever way the default hooks toggle is set - it needs to be displayed to the user when initialising a project So maybe the solution here is to add a UI element to the initialisation page asking if the user wants the hooks, then add option in a configuration file for centrally managing it. |
@schacon VSCode prompts "do you trust this repository" when you open it. We could replicate that, then store a local |
I don't think that the user needs to be asked. If git is executing the hooks, I also expect GitButler to do so. I can't come up with a use case where you want regular git users to execute hooks but somehow GitButler users not. |
Yeah, like why setup git hooks if you get the option to not run them by default? Like with normal git you can use |
So far I really enjoy using GitButler but I do always find myself confused as to why git hooks are disabled by default as those ensure consistent stable/linted code.
Is there any reason behind this or am I just using it wrong?
The text was updated successfully, but these errors were encountered: