René's URL Explorer Experiment


Title: fails pulling hooks from sha1 repos with `init.defaultobjectformat=sha256`. · Issue #3434 · pre-commit/pre-commit · GitHub

Open Graph Title: fails pulling hooks from sha1 repos with `init.defaultobjectformat=sha256`. · Issue #3434 · pre-commit/pre-commit

X Title: fails pulling hooks from sha1 repos with `init.defaultobjectformat=sha256`. · Issue #3434 · pre-commit/pre-commit

Description: search you tried in the issue tracker sha256 describe your issue I have init.defaultobjectformat=sha256 configure globally to ensure I do not create any new repositories with sha1 anymore. If in a (local) sha256 repo which refers to a re...

Open Graph Description: search you tried in the issue tracker sha256 describe your issue I have init.defaultobjectformat=sha256 configure globally to ensure I do not create any new repositories with sha1 anymore. If in a ...

X Description: search you tried in the issue tracker sha256 describe your issue I have init.defaultobjectformat=sha256 configure globally to ensure I do not create any new repositories with sha1 anymore. If in a ...

Opengraph URL: https://github.com/pre-commit/pre-commit/issues/3434

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fails pulling hooks from sha1 repos with `init.defaultobjectformat=sha256`.","articleBody":"### search you tried in the issue tracker\n\nsha256\n\n### describe your issue\n\nI have `init.defaultobjectformat=sha256` configure globally to ensure I do not create any new repositories with sha1 anymore. If in a (local) sha256 repo which refers to [a remote sha1 repo](https://github.com/fsfe/reuse-tool) in its `.pre-commit-config.yaml` I run\n\n```sh\npre-commit run --all-files\n```\n\n, I get the following error:\n\n```\n[INFO] Initializing environment for https://github.com/fsfe/reuse-tool.\nAn unexpected error has occurred: CalledProcessError: command: ('/usr/bin/git', 'fetch', 'origin', '--tags')\nreturn code: 128\nstdout: (none)\nstderr:\n    fatal: mismatched algorithms: client sha256; server sha1\nCheck the log at /home/mschilli87/.cache/pre-commit/pre-commit.log\n```\n\nTemporarily setting\n\n```sh\ngit config --global init.defaultObjectFormat sha1\n```\n\nenables `pre-commit run` to pass and successfully I can set\n\n\n```sh\ngit config --global init.defaultObjectFormat sha256\n```\n\nagain and it keeps working.\n\nI guess for some reason, instead of cloning the upstream sha1 repo locally via `git clone`, `pre-commit` for some reason initiates an empty repo via `git init`, adds the upstream repo as `origin` via `git remote add` and the tries to fetch the specified tag via `git fetch`.\n\nAnyhow, running a pre-commit hook on an existing repo based on an upstream one should not depend on config options specific to the creation of new local repos, so I consider this a bug.\n\n### pre-commit --version\n\npre-commit 4.2.0\n\n### .pre-commit-config.yaml\n\n```yaml\n# SPDX-FileCopyrightText: 2020 Free Software Foundation Europe e.V.\n# SPDX-License-Identifier: CC0-1.0\nrepos:\n  - repo: https://github.com/fsfe/reuse-tool\n    rev: v5.0.2\n    hooks:\n      - id: reuse\n```\n\n### ~/.cache/pre-commit/pre-commit.log (if present)\n\n### version information\n\n```\npre-commit version: 4.2.0\ngit --version: git version 2.49.0\nsys.version:\n    3.12.9 (main, Mar  4 2025, 22:48:41) [GCC 13.3.0]\nsys.executable: /usr/bin/python3.12\nos.name: posix\nsys.platform: linux\n```\n\n### error information\n\n```\nAn unexpected error has occurred: CalledProcessError: command: ('/usr/bin/git', 'fetch', 'origin', '--tags')\nreturn code: 128\nstdout: (none)\nstderr:\n    fatal: mismatched algorithms: client sha256; server sha1\n```\n\n```\nTraceback (most recent call last):\n  File \"/usr/lib/python3.12/site-packages/pre_commit/store.py\", line 207, in clone_strategy\n    self._shallow_clone(ref, _git_cmd)\n  File \"/usr/lib/python3.12/site-packages/pre_commit/store.py\", line 189, in _shallow_clone\n    git_cmd('-c', git_config, 'fetch', 'origin', ref, '--depth=1')\n  File \"/usr/lib/python3.12/site-packages/pre_commit/store.py\", line 204, in _git_cmd\n    cmd_output_b('git', *args, cwd=directory, env=env)\n  File \"/usr/lib/python3.12/site-packages/pre_commit/util.py\", line 111, in cmd_output_b\n    raise CalledProcessError(returncode, cmd, stdout_b, stderr_b)\npre_commit.util.CalledProcessError: command: ('/usr/bin/git', '-c', 'protocol.version=2', 'fetch', 'origin', 'v5.0.2', '--depth=1')\nreturn code: 128\nstdout: (none)\nstderr:\n    fatal: mismatched algorithms: client sha256; server sha1\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"/usr/lib/python3.12/site-packages/pre_commit/error_handler.py\", line 73, in error_handler\n    yield\n  File \"/usr/lib/python3.12/site-packages/pre_commit/main.py\", line 417, in main\n    return run(args.config, store, args)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/lib/python3.12/site-packages/pre_commit/commands/run.py\", line 425, in run\n    for hook in all_hooks(config, store)\n                ^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/lib/python3.12/site-packages/pre_commit/repository.py\", line 233, in all_hooks\n    return tuple(\n           ^^^^^^\n  File \"/usr/lib/python3.12/site-packages/pre_commit/repository.py\", line 236, in \u003cgenexpr>\n    for hook in _repository_hooks(repo, store, root_config)\n                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/lib/python3.12/site-packages/pre_commit/repository.py\", line 211, in _repository_hooks\n    return _cloned_repository_hooks(repo_config, store, root_config)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/lib/python3.12/site-packages/pre_commit/repository.py\", line 177, in _cloned_repository_hooks\n    manifest_path = os.path.join(store.clone(repo, rev), C.MANIFEST_FILE)\n                                 ^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/lib/python3.12/site-packages/pre_commit/store.py\", line 211, in clone\n    return self._new_repo(repo, ref, deps, clone_strategy)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/lib/python3.12/site-packages/pre_commit/store.py\", line 165, in _new_repo\n    make_strategy(directory)\n  File \"/usr/lib/python3.12/site-packages/pre_commit/store.py\", line 209, in clone_strategy\n    self._complete_clone(ref, _git_cmd)\n  File \"/usr/lib/python3.12/site-packages/pre_commit/store.py\", line 181, in _complete_clone\n    git_cmd('fetch', 'origin', '--tags')\n  File \"/usr/lib/python3.12/site-packages/pre_commit/store.py\", line 204, in _git_cmd\n    cmd_output_b('git', *args, cwd=directory, env=env)\n  File \"/usr/lib/python3.12/site-packages/pre_commit/util.py\", line 111, in cmd_output_b\n    raise CalledProcessError(returncode, cmd, stdout_b, stderr_b)\npre_commit.util.CalledProcessError: command: ('/usr/bin/git', 'fetch', 'origin', '--tags')\nreturn code: 128\nstdout: (none)\nstderr:\n    fatal: mismatched algorithms: client sha256; server sha1\n```","author":{"url":"https://github.com/mschilli87","@type":"Person","name":"mschilli87"},"datePublished":"2025-03-24T11:07:38Z","url":"https://github.com/pre-commit/pre-commit/issues/3434"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:67ee1adf-eded-718e-f0ca-1d45c3cb80f9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC4E0:7F906:17B4E86:1F36060:6B067243
html-safe-nonce142405bda719b01dfbb0de9a8f8b59b0f1e86966645ab4805926f25e1540dd4c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNEUwOjdGOTA2OjE3QjRFODY6MUYzNjA2MDo2QjA2NzI0MyIsInZpc2l0b3JfaWQiOiI1MjQzMTMyOTY2Nzc5Mzg0Mzg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac8a2173e5cfcaa03210b6a6b337b40842afe216dd82db24045cdcb927e6121b12
hovercard-subject-tagissue:2942880008
github-keyboard-shortcutsrepository,issues,commits,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pre-commit/pre-commit/3434/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3f7e351aaf3fb54ec86e226cc2eaa7117a3ab8f9417dc9c2bd65a17193218fdf/pre-commit/pre-commit/issues/3434
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3f7e351aaf3fb54ec86e226cc2eaa7117a3ab8f9417dc9c2bd65a17193218fdf/pre-commit/pre-commit/issues/3434
og:image:altsearch you tried in the issue tracker sha256 describe your issue I have init.defaultobjectformat=sha256 configure globally to ensure I do not create any new repositories with sha1 anymore. If in a ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemschilli87
hostnamegithub.com
expected-hostnamegithub.com
None4462ff7ebfd3d551f202659f2423dae617b6849d23b1df6465dc504ef497d14a
turbo-cache-controlno-preview
go-importgithub.com/pre-commit/pre-commit git https://github.com/pre-commit/pre-commit.git
octolytics-dimension-user_id6943086
octolytics-dimension-user_loginpre-commit
octolytics-dimension-repository_id17689377
octolytics-dimension-repository_nwopre-commit/pre-commit
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id17689377
octolytics-dimension-repository_network_root_nwopre-commit/pre-commit
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release6d3909414814ff86ce7da4c51a0f4918a13fb41b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/pre-commit/pre-commit/issues/3434#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpre-commit%2Fpre-commit%2Fissues%2F3434
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpre-commit%2Fpre-commit%2Fissues%2F3434
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=pre-commit%2Fpre-commit
Reloadhttps://github.com/pre-commit/pre-commit/issues/3434
Reloadhttps://github.com/pre-commit/pre-commit/issues/3434
Reloadhttps://github.com/pre-commit/pre-commit/issues/3434
pre-commithttps://github.com/pre-commit
pre-commithttps://github.com/pre-commit/pre-commit
Codehttps://github.com/pre-commit/pre-commit
Issues17 (17)https://github.com/pre-commit/pre-commit/issues
Pull requests8 (8)https://github.com/pre-commit/pre-commit/pulls
Actionshttps://github.com/pre-commit/pre-commit/actions
Security and qualityhttps://github.com/pre-commit/pre-commit/security
Insightshttps://github.com/pre-commit/pre-commit/insights
https://github.com/pre-commit/pre-commit
New issuehttps://github.com/login?return_to=https://github.com/pre-commit/pre-commit/issues/3434
New issuehttps://github.com/login?return_to=https://github.com/pre-commit/pre-commit/issues/3434
fails pulling hooks from sha1 repos with init.defaultobjectformat=sha256.https://github.com/pre-commit/pre-commit/issues/3434#top
https://github.com/mschilli87
mschilli87https://github.com/mschilli87
on Mar 24, 2025https://github.com/pre-commit/pre-commit/issues/3434#issue-2942880008
a remote sha1 repohttps://github.com/fsfe/reuse-tool
https://github.com/asottile
asottilehttps://github.com/asottile
on Mar 24, 2025https://github.com/pre-commit/pre-commit/issues/3434#issuecomment-2748453321
asottilehttps://github.com/asottile
completedhttps://github.com/pre-commit/pre-commit/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Mar 24, 2025https://github.com/pre-commit/pre-commit/issues/3434#event-16957753096
https://github.com/mschilli87
mschilli87https://github.com/mschilli87
on Mar 24, 2025https://github.com/pre-commit/pre-commit/issues/3434#issuecomment-2749102734
@asottilehttps://github.com/asottile
https://github.com/Guiorgy
Guiorgyhttps://github.com/Guiorgy
on Feb 25, 2026https://github.com/pre-commit/pre-commit/issues/3434#issuecomment-3959700739
https://github.com/asottile
asottilehttps://github.com/asottile
on Feb 25, 2026https://github.com/pre-commit/pre-commit/issues/3434#issuecomment-3959725514
pre-commithttps://github.com/pre-commit
on Feb 25, 2026https://github.com/pre-commit/pre-commit/issues/3434#event-23070785473
Sign up for freehttps://github.com/signup?return_to=https://github.com/pre-commit/pre-commit/issues/3434
Sign in to commenthttps://github.com/login?return_to=https://github.com/pre-commit/pre-commit/issues/3434
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.