You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
git post-command hooks that don't exist still runs code #800
When users typo a git command, the typo'd command takes a few seconds to return that there was an issue with the input.
Expected output:
When a user makes a typo or enters a command that does not exist, the response should be immediate vs a delay and unnecessary background task running.
Hmm. I wonder whether this is anything but by design. The pre-/post-hook commands are supposed to run so that internal telemetry can be accumulated, which should benefit from acquiring statistics about mistyped commands, no? Feel free to reach out internally if you can provide more context that way.
One important context of this bug report is that the repo is configured with postCommand.strategy=post-index-change.
Before using that strategy, these hooks were configured to no-op if they didn't see a sentinel file written by the post-index-change hook. Now, the post-command hook runs unconditionally (because the conditional logic is in Git itself).
The problem is likely due to Git not trying to load config when fast failing like this, leading to the strategy not being engaged. Can we consider loading config before executing a post-command hook? Can we have this only matter for repos that have a post-command hook present?
Activity
dscho commentedon Sep 27, 2025
Hmm. I wonder whether this is anything but by design. The pre-/post-hook commands are supposed to run so that internal telemetry can be accumulated, which should benefit from acquiring statistics about mistyped commands, no? Feel free to reach out internally if you can provide more context that way.
derrickstolee commentedon Sep 30, 2025
One important context of this bug report is that the repo is configured with
postCommand.strategy=post-index-change.Before using that strategy, these hooks were configured to no-op if they didn't see a sentinel file written by the post-index-change hook. Now, the post-command hook runs unconditionally (because the conditional logic is in Git itself).
The problem is likely due to Git not trying to load config when fast failing like this, leading to the strategy not being engaged. Can we consider loading config before executing a post-command hook? Can we have this only matter for repos that have a post-command hook present?
dscho commentedon Nov 10, 2025
This was addressed by #813, correct?
derrickstolee commentedon Nov 10, 2025
Yes. I should have linked it from that PR.
derrickstolee commentedon Nov 10, 2025
Closed via #813.
dscho commentedon Nov 10, 2025
Funny, I thought I should have remembered and linked it ;-)
In any case, thank you so much Derrick Stolee (@derrickstolee)!