Skip to content

Commit ee4b1d1

Browse files
codexByron
authored andcommitted
docs: warn about Actor regex performance (#2220)
Document that searching long malformed identities with the compatibility regex can take quadratic time, and point maintainers to the delimiter-based parser used internally. Validation: - test/test_actor.py: 8 passed - ruff check and format checks passed
1 parent 8b9e9d6 commit ee4b1d1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

git/util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,8 @@ class Actor:
858858
committers and authors or anything with a name and an email as mentioned in the git
859859
log entries."""
860860

861+
# Kept for compatibility only: searching long malformed strings with this regex can
862+
# take quadratic time. ``_from_string`` deliberately uses delimiter scans instead.
861863
name_email_regex = re.compile(r"(.*) <(.*?)>")
862864

863865
# ENVIRONMENT VARIABLES

0 commit comments

Comments
 (0)