GeezerVison is showing github.com — fix: restore Actor.name_email_regex by Byron · Pull Request #2221 · gitpython-developers/GitPython
Conversation
Byron
commented
Aug 28, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
<!-- 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 <[email protected]>
# 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 <[email protected]>
# 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 <[email protected]>
There was a problem hiding this comment.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|