Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves the patch heuristic #655

Merged
merged 3 commits into from
Dec 30, 2019
Merged

Improves the patch heuristic #655

merged 3 commits into from
Dec 30, 2019

Conversation

arcanis
Copy link
Member

@arcanis arcanis commented Dec 30, 2019

What's the problem this PR addresses?

The current heuristic for located patched hunks within a file diverges significantly from the original, and that makes applying a patch to different versions of a same dependency pretty difficult.

In particular, the patch generated from TypeScript 3.7 can only be applied with a 500+ offset on TypeScript 3.6, and 800+ offset on TypeScript 3.5.

How did you fix it?

The heuristic is now much closer from the original one in that we no longer look in a fixed amount of lines around the hunk, and instead locate it wherever it is in the file then use that to constraint futur patches to a smaller subset of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant