Announcement

Collapse
No announcement yet.

Feature suggestion - show _only_ files with unimportant differences

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Feature suggestion - show _only_ files with unimportant differences

    A common scenario when editing code is to accidentally add blank lines/whitespace/change line-endings. Some revision control systems handle this better than others - e.g "p4 revert -a" could automatically undo these kinds of changes. Git support is.... well let's just say it's painful.

    This is an area where Perforce could help out by providing a "show _only_ files with unimportant differences" so I could quickly revert them all by copying from left to right. (Or alternatively just get a list of these files from the report function so I can feed it to a script.)



  • #2
    Thanks for the suggestion. This could be a little tricky since whitespace within a grammar will follow that grammar (such as within Comments, Strings, etc) as Important or Unimportant.

    To find only whitespace differences, would a behavior closer to swapping the file format to Everything Else, and setting Everything Else Text as Unimportant, and Leading/Embedded/Trailing Whitespace as Important help? This could be done with a combination of options in the Folder Compare's Session menu -> Session Settings, Misc tab, disable all applicable file formats (leaving only Everything Else). Then open a pair of files and in the Text Compare update the Importance tab settings to mark only whitespace as important, then update the dropdown from Use only for this view to Use for all files in parent session. A rules-based scan from the Folder Compare should then help pick out this case.

    Does this workflow help?
    Aaron P Scooter Software

    Comment


    • #3
      Doh - it appears the "Same" button does exactly this (helps to have the "Minor button - ie "ignore uinmportant differences" enabled).

      Comment


      • #4
        Hah, yes, if you have Ignore Unimportant Differences enabled, then Unimportant Only files will show as black equal files, and Show Same will show them. Since you called from a vcs as a difftool, theoretically it was only passing in different files, so this is a great solution to then find only the unimportant different ones.

        You might still have Space characters that are Important Different that are within other grammar definitions that are Important, such as Strings by default, as something to consider. These would be removed from view when Show Same is used.
        Aaron P Scooter Software

        Comment


        • #5
          >Thanks for the suggestion.
          Appears you were answering as I was typing. The mistake I made was to assume that this would be one of the "Diff" button options rather than using the "Same" button which actually does exactly what I'm requesting (and more flexibly since it does allow for custom grammars so can highlight files that only have comment changes for example!)

          Comment


          • #6
            Well, technically, you've told the program to ignore those style of changes. Alternatively, you can go to the Text Compare's Session menu -> Session Settings, Importance tab: checked items are Important and unchecked items are Unimportant. If you flip the switches, then the Diffs button would find the important differences. These settings can then apply upwards to a folder compare rules-based scan, if you wanted to generate a report that shows them as "differences" literally instead of reviewing "same"
            Aaron P Scooter Software

            Comment

            Working...
            X