Title: Fix commit hooks to respect core.hooksPath configuration by MirrorDNA-Reflection-Protocol · Pull Request #2090 · gitpython-developers/GitPython · GitHub
Open Graph Title: Fix commit hooks to respect core.hooksPath configuration by MirrorDNA-Reflection-Protocol · Pull Request #2090 · gitpython-developers/GitPython
X Title: Fix commit hooks to respect core.hooksPath configuration by MirrorDNA-Reflection-Protocol · Pull Request #2090 · gitpython-developers/GitPython
Description: Summary Fixes #2083 The run_commit_hook() function was hardcoded to look for hooks in $GIT_DIR/hooks, ignoring the core.hooksPath configuration option that Git has supported since v2.9. Changes Add _get_hooks_dir() helper function that reads core.hooksPath from config Handle both absolute and relative paths per git-config documentation: Absolute paths: used as-is Relative paths: resolved relative to the working tree root (or git_dir for bare repos) Not set: defaults to $GIT_DIR/hooks Update run_commit_hook() to use the new helper Add comprehensive tests for both absolute and relative hooksPath configurations Testing All existing hook tests pass Added 2 new tests: test_run_commit_hook_respects_core_hookspath - tests absolute path test_run_commit_hook_respects_relative_core_hookspath - tests relative path Backwards Compatibility The existing hook_path() function is preserved for backwards compatibility and has been documented to note that it does not respect the config. Code that directly uses hook_path() will behave as before. Only code using run_commit_hook() (including index.commit()) will benefit from the new behavior. References Git documentation on core.hooksPath: https://git-scm.com/docs/git-config#Documentation/git-config.txt-corehooksPath Issue: #2083
Open Graph Description: Summary Fixes #2083 The run_commit_hook() function was hardcoded to look for hooks in $GIT_DIR/hooks, ignoring the core.hooksPath configuration option that Git has supported since v2.9. Changes Ad...
X Description: Summary Fixes #2083 The run_commit_hook() function was hardcoded to look for hooks in $GIT_DIR/hooks, ignoring the core.hooksPath configuration option that Git has supported since v2.9. Changes Ad...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/2090
X: @github
Domain: redirect.github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b70d94bd-0c64-5cd2-b8d4-b7ab599a7c33 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9FCE:5F13B:1EC973:2B0CA9:696A40EA |
| html-safe-nonce | ad083106ad7273773e7fffb8f930ecfd001daadf1dd8bfba30466d587f351555 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RkNFOjVGMTNCOjFFQzk3MzoyQjBDQTk6Njk2QTQwRUEiLCJ2aXNpdG9yX2lkIjoiNDQ5MDc3Mjg5ODI4ODEyNDEzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cd6f0a7dd5d99c5da26f8b943a94fbbfd43045d3708f085d760c3b65e97c8d36 |
| hovercard-subject-tag | pull_request:3079222181 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/2090/files |
| twitter:image | https://avatars.githubusercontent.com/u/239564541?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/239564541?s=400&v=4 |
| og:image:alt | Summary Fixes #2083 The run_commit_hook() function was hardcoded to look for hooks in $GIT_DIR/hooks, ignoring the core.hooksPath configuration option that Git has supported since v2.9. Changes Ad... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 321736bfdb3f591415ae895a0459bec204b26a76caf47ba5c980634cfacc4538 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 13581a31d51edf4a3aca179e10890a4d4f9b6d76 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width