-
Notifications
You must be signed in to change notification settings - Fork 104
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
diffy is incompatible with alpine linux/busybox linux diff #86
Comments
It is something with text encoding in the You can reproduce it with this code: #!/usr/bin/env ruby
require 'open3'
Open3.popen3('diff', '-U 10000', '/file1', '/file2') do |i, o, e|
puts "o = #{o.read}"
puts "e = #{e.read}"
end It outputs this:
A workaround is to pass a different value for
I've tested diff with |
Tried the solution on ruby-alpine 2.4.1. The solution works on command line, but in rails the generated HTML diff results in "unchanged" for all lines. Text output seems to work as expected: |
@erkolson |
is there a work around for :context ? It stops working again when I use :context.... |
I just found out that |
Ruby 2.4.1, diffy 3.2.0, BusyBox v1.24.2 (2017-11-23 08:52:33 GMT) multi-call binary.
|
for me works only if redefine ORIGINAL_DEFAULT_OPTIONS constant (used in html_formatter.rb) Diffy::Diff::ORIGINAL_DEFAULT_OPTIONS = {
:diff => '-U10000', # was :diff => '-U 10000',
:source => 'strings',
:include_diff_info => false,
:include_plus_and_minus_in_html => false,
:context => nil,
:allow_empty_diff => true,
}
Diffy::Diff.new("Hello!\n", "Hallo!\n", diff: '-U10000', include_plus_and_minus_in_html: true, include_diff_info: true).to_s(:html) Result => "<div class=\"diff\">\n <ul>\n <li class=\"diff-comment\"><span>--- /tmp/diffy20180321-96-sulp0x</span></li>\n <li class=\"diff-comment\"><span>+++ /tmp/diffy20180321-96-1tutkxl</span></li>\n <li class=\"diff-block-info\"><span>@@ -1 +1 @@</span></li>\n <li class=\"del\"><del><span class=\"symbol\">-</span>H<strong>e</strong>llo!</del></li>\n <li class=\"ins\"><ins><span class=\"symbol\">+</span>H<strong>a</strong>llo!</ins></li>\n </ul>\n</div>\n" |
Though the diff binary that ships with Alpine linux will produce output as expected for differing files, diffy fails to produce any output.
I've tested diffy with all output types =>
:text
,:color
,:html
, etc.I've also tested with variables and files.
After compiling gnu diff from source and installing in /usr/bin, diffy works!
The text was updated successfully, but these errors were encountered: