Skip to content

Allow diff command to be overriden #63

Open

Description

@aptituz

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?

Activity

  1. samg commented on Oct 25, 2015

    @samg
    Owner

    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.

  2. bwl21 commented on May 20, 2017

    @bwl21
    Contributor

    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?

  3. samg commented on May 21, 2017

    @samg
    Owner

    @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

  4. bwl21 commented on May 21, 2017

    @bwl21
    Contributor

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions