Skip to content

Split apply logic by fragment type #11

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

Closed
bluekeyes opened this issue May 3, 2020 · 0 comments · Fixed by #32
Closed

Split apply logic by fragment type #11

bluekeyes opened this issue May 3, 2020 · 0 comments · Fixed by #32
Labels
applying Issues related to applying patches

Comments

@bluekeyes
Copy link
Owner

The single Applier type does some messy internal state tracking to avoid mixing ApplyFile, ApplyTextFragment, and ApplyBinaryFragment. I think the following would be better:

  1. Create a TextApplier (in apply_text.go) and BinaryApplier (in apply_binary.go). Each of these has methods to apply single fragments (and multiple fragments, in the case of TextApplier.)
  2. Remove the Reset method and rename Flush to Close to better indicate that apply types are single-use
  3. Remove the Applier type and the ApplyFile method
  4. Move the logic for ApplyFile to the global Apply function. This is the convenience function to select an applier based on the file type and execute it.

This should reduce confusion and provides an obvious place for the eventual text-only options for fuzzy apply.

@bluekeyes bluekeyes added the applying Issues related to applying patches label May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
applying Issues related to applying patches
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant