Results 1 to 7 of 7
  1. #1
    Guest

    Default Actually Ignoring Unimportant Diff.s

    I've tried "everything" & I can't get it to do this as well as it alleges to.
    We really need this for team VCS use w/o formatting legislation.
    (java)
    eg: the diff. betw/ block braces being on their own line or not
    (Yes, I *have* tried the various line-end stuff, but...)

  2. #2
    Guest

    Default Re: Actually Ignoring Unimportant Diff.s

    IIRC, bc does a line-by-line compare, so if one file has a line like
    foo; }
    and the other file has this as 2 lines
    foo;
    }
    Then I would *expect* bc to consider these different.

    One way around this would be to use a helper program to provide uniform formatting as input to bc. A pretty printer, for instance. This is similar to some of the techniques I've seen for, as an example, excel files.

    Good luck!

    /dps

  3. #3
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,584

    Default Re: Actually Ignoring Unimportant Diff.s

    Yes, the best way to deal with comparison of files with line break differences is to use something to format the code before it is opened in Beyond Compare.

    For Java we already have an Add On Rule to do this. Try the Jalopy rule from:
    http://www.scootersoftware.com/downl...c=kb_morerules
    Chris K Scooter Software

  4. #4
    Join Date
    Feb 2013
    Posts
    11

    Default Possible to ignore brace differences?

    Is possible to add a rule to BC in order to be able to mark a change like the one mentioned above:

    Code:
    foo; }
    and the other file has this as 2 lines
    foo;
    }
    as an unimportant difference? This way I can hide them with the "Ignore Unimportant Differences" option?

  5. #5
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,584

    Default

    Beyond Compare can't ignore differences that go across line breaks. This is still on our wish list for a future version of BC.

    The best workaround is to find a source code formatting tool for whatever programming language you're using, then run the files through it before opening them for comparison in BC.

    If you find a command line code formatter that works with your files, you can have BC automatically run it before files are compared. To specify a command line text processor, select "Tools > File Formats". Select the format that matches your files. Go to the Conversion tab. Change Conversion from "None" to "External program (Unicode filenames)". In the "Loading" edit, enter the path to your conversion tool, followed by %s and %t to pass the source (original) and target (output) filenames to the utility.

    For an example of a file format that already uses an external conversion utility, see the PDF Documents file format that comes with Beyond Compare. It runs PDF files through a text extraction tool, then outputs the results to temporary text file that BC opens in the Text Compare.
    Chris K Scooter Software

  6. #6
    Join Date
    Oct 2017
    Posts
    1

    Default

    Quote Originally Posted by Chris View Post
    Beyond Compare can't ignore differences that go across line breaks. This is still on our wish list for a future version of BC.

    The best workaround is to find a source code formatting tool for whatever programming language you're using, then run the files through it before opening them for comparison in BC.

    If you find a command line code formatter that works with your files, you can have BC automatically run it before files are compared. To specify a command line text processor, select "Tools > File Formats". Select the format that matches your files. Go to the Conversion tab. Change Conversion from "None" to "External program (Unicode filenames)". In the "Loading" edit, enter the path to your conversion tool, followed by %s and %t to pass the source (original) and target (output) filenames to the utility.

    For an example of a file format that already uses an external conversion utility, see the PDF Documents file format that comes with Beyond Compare. It runs PDF files through a text extraction tool, then outputs the results to temporary text file that BC opens in the Text Compare.
    Is this feature already available in the latest version?

  7. #7
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,384

    Default

    No, you would still need to use a conversion, like HTML Tidy or XML Tidy, to reformat the line breaks and then compare them line by line.
    Aaron P Scooter Software

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •