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: togithub.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5e04685d-79ee-a845-e0b5-a38347012bd5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D50C:D7527:8E3D9:C3AF6:69693CFB |
| html-safe-nonce | 6074f35b421244847193b5f0dd4194937d8f561a6f297902e00e60296dc87f04 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTBDOkQ3NTI3OjhFM0Q5OkMzQUY2OjY5NjkzQ0ZCIiwidmlzaXRvcl9pZCI6IjQ5Njg3NzUxMTU5MjMzNDA1MzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5d6a0f9098bb001b6aa8fb1edf2b2653089b054945af071595bf90925e55e0ce |
| 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 | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| 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 | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width