Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-pre-commit for
openSUSE:Factory checked in at 2026-05-18 17:47:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pre-commit (Old)
and /work/SRC/openSUSE:Factory/.python-pre-commit.new.1966 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pre-commit"
Mon May 18 17:47:04 2026 rev:25 rq:1353631 version:4.6.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pre-commit/python-pre-commit.changes
2026-01-19 18:40:57.093125026 +0100
+++
/work/SRC/openSUSE:Factory/.python-pre-commit.new.1966/python-pre-commit.changes
2026-05-18 17:47:21.486669625 +0200
@@ -1,0 +2,8 @@
+Sun May 17 21:34:57 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 4.6.0:
+ * `pre-commit hook-impl`: allow `--hook-dir` to be missing to
+ enable easier usage with `git` 2.54+ git hooks.
+ * `pre-commit hook-impl`: `--hook-type` is required.
+
+-------------------------------------------------------------------
Old:
----
pre-commit-4.5.1.tar.gz
New:
----
pre-commit-4.6.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pre-commit.spec ++++++
--- /var/tmp/diff_new_pack.dqRNqH/_old 2026-05-18 17:47:22.098694915 +0200
+++ /var/tmp/diff_new_pack.dqRNqH/_new 2026-05-18 17:47:22.098694915 +0200
@@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-pre-commit
-Version: 4.5.1
+Version: 4.6.0
Release: 0
Summary: Multi-language pre-commit hooks
License: MIT
++++++ pre-commit-4.5.1.tar.gz -> pre-commit-4.6.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pre-commit-4.5.1/.github/actions/pre-test/action.yml
new/pre-commit-4.6.0/.github/actions/pre-test/action.yml
--- old/pre-commit-4.5.1/.github/actions/pre-test/action.yml 2025-12-16
22:13:56.000000000 +0100
+++ new/pre-commit-4.6.0/.github/actions/pre-test/action.yml 2026-04-21
22:42:39.000000000 +0200
@@ -6,4 +6,4 @@
using: composite
steps:
- uses: asottile/workflows/.github/actions/[email protected]
- if: inputs.env == 'py39' && runner.os == 'Linux'
+ if: inputs.env == 'py310' && runner.os == 'Linux'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pre-commit-4.5.1/.pre-commit-config.yaml
new/pre-commit-4.6.0/.pre-commit-config.yaml
--- old/pre-commit-4.5.1/.pre-commit-config.yaml 2025-12-16
22:13:56.000000000 +0100
+++ new/pre-commit-4.6.0/.pre-commit-config.yaml 2026-04-21
22:42:39.000000000 +0200
@@ -10,7 +10,7 @@
- id: name-tests-test
- id: requirements-txt-fixer
- repo: https://github.com/asottile/setup-cfg-fmt
- rev: v3.1.0
+ rev: v3.2.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/asottile/reorder-python-imports
@@ -37,7 +37,7 @@
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
- rev: v1.19.1
+ rev: v1.20.1
hooks:
- id: mypy
additional_dependencies: [types-pyyaml]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pre-commit-4.5.1/CHANGELOG.md
new/pre-commit-4.6.0/CHANGELOG.md
--- old/pre-commit-4.5.1/CHANGELOG.md 2025-12-16 22:13:56.000000000 +0100
+++ new/pre-commit-4.6.0/CHANGELOG.md 2026-04-21 22:42:39.000000000 +0200
@@ -1,3 +1,15 @@
+4.6.0 - 2026-04-21
+==================
+
+### Features
+- `pre-commit hook-impl`: allow `--hook-dir` to be missing to enable easier
+ usage with `git` 2.54+ git hooks.
+ - #3662 PR by @asottile.
+
+### Fixes
+- `pre-commit hook-impl`: `--hook-type` is required.
+ - #3661 PR by @asottile.
+
4.5.1 - 2025-12-16
==================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pre-commit-4.5.1/pre_commit/commands/hook_impl.py
new/pre-commit-4.6.0/pre_commit/commands/hook_impl.py
--- old/pre-commit-4.5.1/pre_commit/commands/hook_impl.py 2025-12-16
22:13:56.000000000 +0100
+++ new/pre-commit-4.6.0/pre_commit/commands/hook_impl.py 2026-04-21
22:42:39.000000000 +0200
@@ -16,7 +16,7 @@
def _run_legacy(
hook_type: str,
- hook_dir: str,
+ hook_dir: str | None,
args: Sequence[str],
) -> tuple[int, bytes]:
if os.environ.get('PRE_COMMIT_RUNNING_LEGACY'):
@@ -33,6 +33,9 @@
else:
stdin = b''
+ if hook_dir is None: # git 2.54+ hooks
+ return 0, stdin
+
# not running in legacy mode
legacy_hook = os.path.join(hook_dir, f'{hook_type}.legacy')
if not os.access(legacy_hook, os.X_OK):
@@ -259,7 +262,7 @@
config: str,
color: bool,
hook_type: str,
- hook_dir: str,
+ hook_dir: str | None,
skip_on_missing_config: bool,
args: Sequence[str],
) -> int:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pre-commit-4.5.1/pre_commit/main.py
new/pre-commit-4.6.0/pre_commit/main.py
--- old/pre-commit-4.5.1/pre_commit/main.py 2025-12-16 22:13:56.000000000
+0100
+++ new/pre-commit-4.6.0/pre_commit/main.py 2026-04-21 22:42:39.000000000
+0200
@@ -357,7 +357,7 @@
hook_impl_parser = subparsers.add_parser('hook-impl')
add_color_option(hook_impl_parser)
_add_config_option(hook_impl_parser)
- hook_impl_parser.add_argument('--hook-type')
+ hook_impl_parser.add_argument('--hook-type', required=True)
hook_impl_parser.add_argument('--hook-dir')
hook_impl_parser.add_argument(
'--skip-on-missing-config', action='store_true',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pre-commit-4.5.1/setup.cfg
new/pre-commit-4.6.0/setup.cfg
--- old/pre-commit-4.5.1/setup.cfg 2025-12-16 22:13:56.000000000 +0100
+++ new/pre-commit-4.6.0/setup.cfg 2026-04-21 22:42:39.000000000 +0200
@@ -1,6 +1,6 @@
[metadata]
name = pre_commit
-version = 4.5.1
+version = 4.6.0
description = A framework for managing and maintaining multi-language
pre-commit hooks.
long_description = file: README.md
long_description_content_type = text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pre-commit-4.5.1/tests/commands/hook_impl_test.py
new/pre-commit-4.6.0/tests/commands/hook_impl_test.py
--- old/pre-commit-4.5.1/tests/commands/hook_impl_test.py 2025-12-16
22:13:56.000000000 +0100
+++ new/pre-commit-4.6.0/tests/commands/hook_impl_test.py 2026-04-21
22:42:39.000000000 +0200
@@ -63,6 +63,11 @@
assert (retv, stdin) == (0, b'')
+def test_run_legacy_git_2_54():
+ retv, stdin = hook_impl._run_legacy('pre-commit', None, ())
+ assert (retv, stdin) == (0, b'')
+
+
def test_run_legacy_executes_legacy_script(tmpdir, capfd):
hook = tmpdir.join('pre-commit.legacy')
hook.write('#!/usr/bin/env bash\necho hi "$@"\nexit 1\n')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pre-commit-4.5.1/tests/main_test.py
new/pre-commit-4.6.0/tests/main_test.py
--- old/pre-commit-4.5.1/tests/main_test.py 2025-12-16 22:13:56.000000000
+0100
+++ new/pre-commit-4.6.0/tests/main_test.py 2026-04-21 22:42:39.000000000
+0200
@@ -90,7 +90,7 @@
FNS = (
- 'autoupdate', 'clean', 'gc', 'hook_impl', 'install', 'install_hooks',
+ 'autoupdate', 'clean', 'gc', 'install', 'install_hooks',
'migrate_config', 'run', 'sample_config', 'uninstall',
'validate_config', 'validate_manifest',
)
@@ -169,6 +169,12 @@
assert arg.cmd == ['cmd', '--', 'f1', 'f2']
+def test_hook_impl(mock_store_dir):
+ with mock.patch.object(main, 'hook_impl') as mck:
+ main.main(('hook-impl', '--hook-type', 'pre-commit'))
+ assert mck.call_count == 1
+
+
def test_try_repo(mock_store_dir):
with mock.patch.object(main, 'try_repo') as patch:
main.main(('try-repo', '.'))