Ignore whitespace differences

Anonymous
2009-09-01
2013-10-28
  • Anonymous - 2009-09-01

    I'd sure like to be able to see how two files are different, but not have differences in whitespace appear to be changes. Often I use KDIFF3 not to determine how to merge two files, but just to see what changed. E.g., I might compare trace output of two program executions, and I don't care about changes to the formatting of the traces.

     
    • Joachim Eibl

      Joachim Eibl - 2009-09-02

      You can disable the highlighting of white space changes via the menu "Diff view"->"Show white space". If this is not enough you might want to check the diff-options where you can select to "ignore numbers" etc. More sophisticated suppression of differences is possible by using a preprocessor. Please see the KDiff3-documentation for that.
      Cheers,
      Joachim

       
  • Carlos Ibarra

    Carlos Ibarra - 2012-02-03

    In Settings, Configure KDiff3, Diff tab, set Preprocessor command to the
    following to ignore all whitespace:

    perl -p -e "s/+/ /g"

     
  • Anonymous - 2012-03-30

    Thanks for the suggestions (Joachim: "show white space"; and ibarrac: perl
    ...). And Joachim, thanks for an excellent program.

    However this issue is still very much a problem for me, and I suspect for many
    other users. Both solutions above do not help when doing a directory diff. For
    example when I do a directory diff of a website with say, 250 files, I get the
    red merge-manual indicator for about 175 files, virtually all of which have
    only line-ending differences. I have to click on each one of them to be able
    to tell if the issue was purely white-space or a more serious diff.

    A previous version of Kdiff3 (0.9.92) had an option on the Diff page,
    "Preserve Carriage Return" which looks like it might have accomplished this,
    however this option is no longer there in the current version (0.9.96).

    In summary it would be REALLY useful to be able to do directory diffs with an
    'ignore line-endings' or something like that to get a broad-brush view of
    differences between two directories.

    Thanks Again!

     
  • Jen

    Jen - 2013-10-28

    I have to strongly agree with the previous post. I love KDIFF, but won't be able to use it effectively unless this issue is addressed of there is a workaround. Every single file in my project is showing up as a diff because of an empty line or two. I cannot zero in on the real diffs ....

     
  • Joachim Eibl

    Joachim Eibl - 2013-10-28

    There exists an option in the directory settings "Full analysis" (instead of binary comparison). It will take longer, but will give you information of whitespace differences too. It will also use the preprocessors if specified.
    And in the latest git-version there is again some support for "Preserve carriage return". You might want to try that.

    Joachim

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks