René's URL Explorer Experiment


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

direct link

Domain: togithub.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:5e04685d-79ee-a845-e0b5-a38347012bd5
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD50C:D7527:8E3D9:C3AF6:69693CFB
html-safe-nonce6074f35b421244847193b5f0dd4194937d8f561a6f297902e00e60296dc87f04
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTBDOkQ3NTI3OjhFM0Q5OkMzQUY2OjY5NjkzQ0ZCIiwidmlzaXRvcl9pZCI6IjQ5Njg3NzUxMTU5MjMzNDA1MzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac5d6a0f9098bb001b6aa8fb1edf2b2653089b054945af071595bf90925e55e0ce
hovercard-subject-tagpull_request:3079222181
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/2090/files
twitter:imagehttps://avatars.githubusercontent.com/u/239564541?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/239564541?s=400&v=4
og:image:altSummary 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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git
octolytics-dimension-user_id503709
octolytics-dimension-user_logingitpython-developers
octolytics-dimension-repository_id1126087
octolytics-dimension-repository_nwogitpython-developers/GitPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1126087
octolytics-dimension-repository_network_root_nwogitpython-developers/GitPython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released69ac0477df0f87da03b8b06cebd187012d7a930
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://togithub.com/gitpython-developers/GitPython/pull/2090/files#start-of-content
https://togithub.com/
Sign in https://togithub.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F2090%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://togithub.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F2090%2Ffiles
Sign up https://togithub.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=gitpython-developers%2FGitPython
Reloadhttps://togithub.com/gitpython-developers/GitPython/pull/2090/files
Reloadhttps://togithub.com/gitpython-developers/GitPython/pull/2090/files
Reloadhttps://togithub.com/gitpython-developers/GitPython/pull/2090/files
gitpython-developers https://togithub.com/gitpython-developers
GitPythonhttps://togithub.com/gitpython-developers/GitPython
Please reload this pagehttps://togithub.com/gitpython-developers/GitPython/pull/2090/files
Notifications https://togithub.com/login?return_to=%2Fgitpython-developers%2FGitPython
Fork 964 https://togithub.com/login?return_to=%2Fgitpython-developers%2FGitPython
Star 5k https://togithub.com/login?return_to=%2Fgitpython-developers%2FGitPython
Code https://togithub.com/gitpython-developers/GitPython
Issues 169 https://togithub.com/gitpython-developers/GitPython/issues
Pull requests 8 https://togithub.com/gitpython-developers/GitPython/pulls
Discussions https://togithub.com/gitpython-developers/GitPython/discussions
Actions https://togithub.com/gitpython-developers/GitPython/actions
Security Uh oh! There was an error while loading. Please reload this page. https://togithub.com/gitpython-developers/GitPython/security
Please reload this pagehttps://togithub.com/gitpython-developers/GitPython/pull/2090/files
Insights https://togithub.com/gitpython-developers/GitPython/pulse
Code https://togithub.com/gitpython-developers/GitPython
Issues https://togithub.com/gitpython-developers/GitPython/issues
Pull requests https://togithub.com/gitpython-developers/GitPython/pulls
Discussions https://togithub.com/gitpython-developers/GitPython/discussions
Actions https://togithub.com/gitpython-developers/GitPython/actions
Security https://togithub.com/gitpython-developers/GitPython/security
Insights https://togithub.com/gitpython-developers/GitPython/pulse
Sign up for GitHub https://togithub.com/signup?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://togithub.com/login?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
MirrorDNA-Reflection-Protocolhttps://togithub.com/MirrorDNA-Reflection-Protocol
gitpython-developers:mainhttps://togithub.com/gitpython-developers/GitPython/tree/main
MirrorDNA-Reflection-Protocol:fix-core-hookspath-supporthttps://togithub.com/MirrorDNA-Reflection-Protocol/GitPython/tree/fix-core-hookspath-support
Conversation 4 https://togithub.com/gitpython-developers/GitPython/pull/2090
Commits 4 https://togithub.com/gitpython-developers/GitPython/pull/2090/commits
Checks 27 https://togithub.com/gitpython-developers/GitPython/pull/2090/checks
Files changed 2 https://togithub.com/gitpython-developers/GitPython/pull/2090/files
Fix commit hooks to respect core.hooksPath configuration https://togithub.com/gitpython-developers/GitPython/pull/2090/files#top
Show all changes 4 commits https://togithub.com/gitpython-developers/GitPython/pull/2090/files
7977004 Fix commit hooks to respect core.hooksPath configuration MirrorDNA-Reflection-Protocol Dec 7, 2025 https://togithub.com/gitpython-developers/GitPython/pull/2090/commits/7977004dd8169605c572ac7a00325700d89bdd28
1a10226 Add test for core.hooksPath in bare repositories MirrorDNA-Reflection-Protocol Dec 8, 2025 https://togithub.com/gitpython-developers/GitPython/pull/2090/commits/1a1022681fb76c6ea17fcd8d5aabdf6e43145cf1
7b1acdb Fix ruff lint: remove whitespace from blank lines in docstrings MirrorDNA-Reflection-Protocol Dec 8, 2025 https://togithub.com/gitpython-developers/GitPython/pull/2090/commits/7b1acdb713e8dbfd7f1f7d13cc2407457de6a82a
6e58a69 Fix bare repo test: use custom-hooks dir inside git_dir MirrorDNA-Reflection-Protocol Dec 8, 2025 https://togithub.com/gitpython-developers/GitPython/pull/2090/commits/6e58a6994d5346ae702a7de96d9739ba585a94d6
Clear filters https://togithub.com/gitpython-developers/GitPython/pull/2090/files
Please reload this pagehttps://togithub.com/gitpython-developers/GitPython/pull/2090/files
Please reload this pagehttps://togithub.com/gitpython-developers/GitPython/pull/2090/files
fun.py https://togithub.com/gitpython-developers/GitPython/pull/2090/files#diff-1d155f283cbf575ea2d0cce3e16d9c60d5fab54c83626603f47eabd2334084b6
test_index.py https://togithub.com/gitpython-developers/GitPython/pull/2090/files#diff-21c27b991511d3d0e3a14b4dfb56017689de2fa114c3edf11c577bd1ce744b72
git/index/fun.pyhttps://togithub.com/gitpython-developers/GitPython/pull/2090/files#diff-1d155f283cbf575ea2d0cce3e16d9c60d5fab54c83626603f47eabd2334084b6
View file https://togithub.com/gitpython-developers/GitPython/blob/6e58a6994d5346ae702a7de96d9739ba585a94d6/git/index/fun.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://togithub.com/gitpython-developers/GitPython/pull/2090/{{ revealButtonHref }}
https://togithub.com/gitpython-developers/GitPython/pull/2090/files#diff-1d155f283cbf575ea2d0cce3e16d9c60d5fab54c83626603f47eabd2334084b6
https://togithub.com/gitpython-developers/GitPython/pull/2090/files#diff-1d155f283cbf575ea2d0cce3e16d9c60d5fab54c83626603f47eabd2334084b6
https://togithub.com/gitpython-developers/GitPython/pull/2090/files#diff-1d155f283cbf575ea2d0cce3e16d9c60d5fab54c83626603f47eabd2334084b6
https://togithub.com/gitpython-developers/GitPython/pull/2090/files#diff-1d155f283cbf575ea2d0cce3e16d9c60d5fab54c83626603f47eabd2334084b6
test/test_index.pyhttps://togithub.com/gitpython-developers/GitPython/pull/2090/files#diff-21c27b991511d3d0e3a14b4dfb56017689de2fa114c3edf11c577bd1ce744b72
View file https://togithub.com/gitpython-developers/GitPython/blob/6e58a6994d5346ae702a7de96d9739ba585a94d6/test/test_index.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://togithub.com/gitpython-developers/GitPython/pull/2090/{{ revealButtonHref }}
https://togithub.com/gitpython-developers/GitPython/pull/2090/files#diff-21c27b991511d3d0e3a14b4dfb56017689de2fa114c3edf11c577bd1ce744b72
https://togithub.com/gitpython-developers/GitPython/pull/2090/files#diff-21c27b991511d3d0e3a14b4dfb56017689de2fa114c3edf11c577bd1ce744b72
Please reload this pagehttps://togithub.com/gitpython-developers/GitPython/pull/2090/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.