Repository navigation
fix: restore Actor.name_email_regex - #2221
Merged
Byron merged 1 commit into
main from
re-add-regex
Aug 28, 2026
Merged
Conversation
Copy link
Copy Markdown
Member
Tasks
This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.
Everything below this line was generated by Codex GPT-5.
Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
Fixes #2220
Summary
- Restore the historical
Actor.name_email_regex class member used by downstream projects such as python-semantic-release.
- Deprecate access while preserving the original compiled-pattern API.
- Warn that searching long malformed strings with the regex can take quadratic time and recommend
Actor._from_string() or direct string parsing.
- Keep
Actor._from_string independent of the regex so malformed identities retain the linear-time parsing introduced for GHSA-g5vv-9gxw-82hx .
Validation
test/test_actor.py: 8 passed on Python 3.12.13.
- Actor-related
test/test_util.py coverage passed before the deprecation-only follow-up.
ruff check git/util.py test/test_actor.py
ruff format --check git/util.py test/test_actor.py
basedpyright git/util.py: no errors.
- Codex review of commit
40825453: no findings.
Copilot PR reviewer
Copilot
AI
lite review requested due to automatic review settings
August 28, 2026 06:39
Copilot PR reviewer
Copilot
AI
reviewed
Aug 28, 2026
Copilot
AI
left a comment
Copy link
Copy Markdown
Contributor
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more .
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Copilot PR reviewer
Copilot
AI
review requested due to automatic review settings
August 28, 2026 06:42
Copilot PR reviewer
Copilot
AI
reviewed
Aug 28, 2026
Copilot
AI
left a comment
Copy link
Copy Markdown
Contributor
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more .
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Byron
force-pushed
the
re-add-regex
branch
from
ee4b1d1 to
8afd1fd
Compare
August 28, 2026 08:50
Copilot PR reviewer
Copilot
AI
review requested due to automatic review settings
August 28, 2026 08:53
Copilot PR reviewer
Copilot
AI
reviewed
Aug 28, 2026
Copilot
AI
left a comment
Copy link
Copy Markdown
Contributor
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more .
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
fix: restore Actor.name_email_regex (#2220)
bc63b02
<!-- agent -->
GitPython 3.1.60 removed the Actor.name_email_regex class attribute while
replacing internal actor parsing, which broke downstream consumers such as
python-semantic-release.
Bring back the historical compiled pattern for downstream compatibility,
but emit DeprecationWarning whenever the class member is accessed. The warning
explains its quadratic behavior on long malformed strings and points callers to
the public Actor(name, email) constructor when fields are separate, or direct
string parsing when they are not.
Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <codex@openai.com>
# 252a84ac Add public Actor.from_string constructor (#2220)
Add public Actor.from_string constructor (#2220)
Promote the existing actor identity parser to Actor.from_string while retaining _from_string as a compatibility alias. Point the name_email_regex deprecation warning to the new public constructor or Actor(name, email).
Validation:
- actor-related test/test_actor.py and test/test_util.py cases: 12 passed
- ruff check and format checks passed
- basedpyright git/util.py: no errors
Co-authored-by: Codex GPT-5 <codex@openai.com>
# dd2181d8 Address review feedback about Actor subclasses
Address review feedback about Actor subclasses
Review feedback: Actor.from_string() should preserve the class on which the public classmethod is called instead of always returning a base Actor.
Construct through cls on both parsing paths and cover subclass construction directly.
Validation:
- actor-related test/test_actor.py and test/test_util.py cases: 13 passed
- ruff check and format checks passed
- basedpyright git/util.py: no errors
# fcf1ecb1 Address review feedback about constructor typing
Address review feedback about constructor typing
Review feedback: Actor.from_string() constructs subclasses at runtime but its Actor return annotation prevents type checkers from preserving subclass-specific members.
Use the project existing Python 3.7-compatible bound TypeVar pattern so the declared return type follows cls.
Validation:
- actor-related test/test_actor.py and test/test_util.py cases: 13 passed
- ruff check and format checks passed
- basedpyright git/util.py: no errors
Co-authored-by: Codex GPT-5 <codex@openai.com>
Byron
force-pushed
the
re-add-regex
branch
from
4082545 to
bc63b02
Compare
August 28, 2026 09:39
Copilot PR reviewer
Copilot
AI
review requested due to automatic review settings
August 28, 2026 09:39
Copilot PR reviewer
Copilot
AI
reviewed
Aug 28, 2026
Copilot
AI
left a comment
Copy link
Copy Markdown
Contributor
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more .
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Byron
merged commit
d81336b
into
main
Aug 28, 2026
53 checks passed
Byron
deleted the
re-add-regex
branch
August 28, 2026 10:57
ramundomario
mentioned this pull request
Aug 28, 2026
fix(config): replace removed Actor.name_email_regex from GitPython
python-semantic-release/python-semantic-release#1477
Merged
Sign up for free
to join this conversation on GitHub .
Already have an account?
Sign in to comment
Labels
None yet
2 participants