Context
Split out of #1299 during its own local-strict-review pass, which flagged this as a related but out-of-scope gap in the same fix.
The defect
matching_threads() in scripts/pr_review.py folds a typographic em dash (U+2014) and en dash (U+2013) to a single ASCII hyphen -, per #1299's fix. It does not fold the common two-hyphen ASCII stand-in for an em dash, --, to the same single hyphen.
So a thread body written with a real em dash and a --match pattern typed with the conventional double-hyphen stand-in still miss each other, and the reverse also misses: a body using -- does not match a pattern copied with a real em dash. Concretely, "foo—bar".translate(FOLD) in "foo--bar" is False, and "foo--bar" in "foo—bar".translate(FOLD) is also False.
This is the same class of failure #1299 fixed (a --match string that reads as the same words as the body but does not select the thread), just for a different pair of spellings of the same punctuation.
Suggested fix
Fold -- (two consecutive ASCII hyphens) to the same single - the em/en dash already fold to, so both spellings of a dash converge on the substring compare.
Why it is a separate issue rather than part of #1299
#1299 asked for the typographic dash characters themselves to fold to their ASCII equivalent, which is done. Folding an ASCII digraph is a distinct, slightly broader normalization decision, worth its own review rather than silently widening #1299's scope.
Context
Split out of #1299 during its own local-strict-review pass, which flagged this as a related but out-of-scope gap in the same fix.
The defect
matching_threads()inscripts/pr_review.pyfolds a typographic em dash (U+2014) and en dash (U+2013) to a single ASCII hyphen-, per #1299's fix. It does not fold the common two-hyphen ASCII stand-in for an em dash,--, to the same single hyphen.So a thread body written with a real em dash and a
--matchpattern typed with the conventional double-hyphen stand-in still miss each other, and the reverse also misses: a body using--does not match a pattern copied with a real em dash. Concretely,"foo—bar".translate(FOLD) in "foo--bar"isFalse, and"foo--bar" in "foo—bar".translate(FOLD)is alsoFalse.This is the same class of failure #1299 fixed (a
--matchstring that reads as the same words as the body but does not select the thread), just for a different pair of spellings of the same punctuation.Suggested fix
Fold
--(two consecutive ASCII hyphens) to the same single-the em/en dash already fold to, so both spellings of a dash converge on the substring compare.Why it is a separate issue rather than part of #1299
#1299 asked for the typographic dash characters themselves to fold to their ASCII equivalent, which is done. Folding an ASCII digraph is a distinct, slightly broader normalization decision, worth its own review rather than silently widening #1299's scope.