Skip to content
PHP Ecosystem
Explore

MultimatchCleanup

API reference › Diff › MultimatchCleanup

enumPHPForge\Diff\MultimatchCleanup
Sourcesrc/MultimatchCleanup.php

Holds the limits of Git’s cleanup of multi-matched lines, which LineDiffer applies before the alignment so that lines repeated all over the other input do not anchor it.

The values match those of Git’s xprepare.c.

See also: https://github.com/git/git/blob/master/xdiff/xprepare.c (Git’s xprepare.c.).

ConstantValueDescriptionDefined by
KEEP_RUN4Multi-matched lines are discarded when they make up less than 1 / KEEP_RUN of the run of unmatched and multi-matched lines around them.MultimatchCleanup
MAX_EQUAL_LIMIT1024Upper bound of the occurrence count from which a line counts as multi-matched; below it the bound is the approximate square root of the line count.MultimatchCleanup
SCAN_WINDOW100Number of lines examined on each side of a multi-matched line when deciding whether to discard it.MultimatchCleanup