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

Allow diff command to be overriden #63

Open
aptituz opened this issue Oct 16, 2015 · 4 comments
Open

Allow diff command to be overriden #63

aptituz opened this issue Oct 16, 2015 · 4 comments

Comments

@aptituz
Copy link

aptituz commented Oct 16, 2015

Since different diff implementation support different feature sets (e.g. BSD find vs. GNU find), it would be helpful if one could chose which find binary is used. Could this feature be added?

@samg
Copy link
Owner

samg commented Oct 25, 2015

I'd definitely be open to a pull request if someone would create one. It seems like a useful feature, though I won't have time to work on it myself in the near future.

@bwl21
Copy link
Contributor

bwl21 commented May 20, 2017

We constantly have trouble with the external diff command, as it depends on user's installation which in big companies is not under full control of the user :-)

Would it be possible to have a mode which does not use an external diff command but integrates the code from lcs-diff ldiff?

@samg
Copy link
Owner

samg commented May 21, 2017

@bwl21 I think you suggestion is definitely possible. I considered doing this when I initially wrote diffy but found it was more straightforward to solve the problem by using diff. (Using diff-lcs seemed like it'd require reimplementing a lot of the text output aspects that diff provides)

Looking back through the source code it is possible to override the diff command used via an ENV['DIFFY_DIFF'] (though this doesn't seem to be documented anywhere outside the source and may not fully solve the issues raised in this ticket). https://github.com/samg/diffy/blob/master/lib/diffy/diff.rb#L147

@bwl21
Copy link
Contributor

bwl21 commented May 21, 2017

@samg I investigated the sources of diffy and discovered ENV[DIFFY_DIFF]. In our project, we have rake tasks to compare sets of doucuments. In this tasks we using indeed ENV['DIFFY_DIFF'] to point to a ldiff command which is provided by diff-lcs. Even if weset DIFFY_DIFF to the full path of ldiff.bat, for whatever reason (we still investigate why), it does not work in all cases.

Further on it opens another ruby sub process which is again somehow slow (it takes about 1 sec).

Therefore, we search for a better Integration which does not use a subprocess.

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

No branches or pull requests

3 participants