Home GnuPG

Apply edit smoothing to prose diffs
a64328ab3d62Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Apply edit smoothing to prose diffs

Summary:
Ref T7643. Currently, when you edit one word into another word which shares some letters, we produce a very choppy diff. The edit from "says" into "remarks" on T7643 is one example.

These are technically correct (they minimize edit distance), but not how a human would diff them. A human can more easily parse an entire word change than the technically-more-accurate character-by-character diff.

Apply "smoothing" on these word-level and character-level diffs to avoid producing runs of changes when some characters are shared in a word edit.

We already do this in arc for normal intraline diffs (and have for years) and it seems to work well. I'll update that code to use this same method.

Test Plan:
Add unit tests, ran unit tests.

Got a better diff in the UI for this class of edit:

{F1678867}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7643

Differential Revision: https://secure.phabricator.com/D16068

Details

Provenance
epriestley <git@epriestley.com>Authored on Jun 7 2016, 5:14 PM
Parents
rPHUTILc637bdba3985: Give prose diffs some basic test coverage
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUTILa64328ab3d62: Apply edit smoothing to prose diffs (authored by epriestley <git@epriestley.com>).Jun 7 2016, 5:56 PM