You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Oh my. If I'm reading this code correctly, it looks like applyPatch currently ignores context lines altogether. Oh, no. Oh, deary dear.
From the original patch man page:
-F max-fuzz, --fuzz max-fuzz
Sets the maximum fuzz factor. This option only applies to con-
text diffs, and causes patch to ignore up to that many lines in
looking for places to install a hunk. Note that a larger fuzz
factor increases the odds of a faulty patch. The default fuzz
factor is 2, and it may not be set to more than the number of
lines of context in the context diff, ordinarily 3.
The applyPatch function should have some smarts over determining where to apply the patch (or if the patch should even apply at all). I'd actually kind of like a fuzzFactor that can be specified in units other than lines, too (so, for example, it's OK to match when 80% of the line is the same, or when there are only two word differences, or no instances where lines are added/removed or a word is replaced with multiple words or vice versa, or something like that).
The text was updated successfully, but these errors were encountered:
I'm looking at reworking the patch implementation for 2.1. I'm thinking that there should be a callback to allow the caller to approve or reject in case of the line being different. Will update here as that idea evolves.
Oh my. If I'm reading this code correctly, it looks like applyPatch currently ignores context lines altogether. Oh, no. Oh, deary dear.
From the original
patch
man page:The applyPatch function should have some smarts over determining where to apply the patch (or if the patch should even apply at all). I'd actually kind of like a fuzzFactor that can be specified in units other than lines, too (so, for example, it's OK to match when 80% of the line is the same, or when there are only two word differences, or no instances where lines are added/removed or a word is replaced with multiple words or vice versa, or something like that).
The text was updated successfully, but these errors were encountered: