Diff Utility

Introduction

The Diff utility in MPLAB X® compares two files and displays the results in textual and graphical views. The following will explain how to access the Diff Utility, how to view Diff utility results, and other features offered by MPLAB X Diff utility.


Accessing Diff Utility

To access the Diff utility to compare two files, complete the following steps:

1

From the Project tree, double click on the filename that you want to compare with. This will open the file in the Editor window.

2

In MPLAB X® IDE menu, go to Tools > Diff. This will open up a pop-up box with the title "Diff Filename To…".

Tools-Diff.png
Click image to enlarge.

3

Select the second file that you wish to compare with the first and click Diff.

By default, this will generate the graphical two-paned diff viewer that displays the two files side-by-side with the differences highlighted.

You can also select the Textual View mode by clicking on the Textual tab.

Graphical View

Diff%20-%20Graphical.png

Some of the highlights of this view are:

  • The differences in the two files are highlighted with color code (blue for actual differences, green where blank spaces are not ignored and pink where changes in inner white spaces are not ignored).
  • Total number of differences is indicated on the top of the page
  • The center arrows indicate locations of differences.

If you click on the center arrow, the file on the right side will instantly update with the corresponding contents in the file from the left side.


Textual View

Diff%20-%20Textual.png

The textual view displays the differences in a text format. The textual format is useful when the Diff file is to be shared with other users. MPLAB X can use the textual Diff file and modify a file with the Diff file instantly.


DIFF Viewer Menu

The Graphical and Textual Viewer also has an additional menu as shown below.

Diff%20-%20Menu.png
Diff%20-%20Graphical%20-%20Menutest.gif

DIFF Viewer Options

Additional options in the Diff view include the setting if the user wants to use the internal Diff utility provided in the MPLAB X or use external Diff tool such as Windiff®.

Under Internal Diff setting, you can also set the option to not use white spaces/changes within white spaces or case changes during Diff. The Diff results with these options selected are marked with color code as mentioned above.

The options menu can also be accessed within MPLAB X menu by Tools > Options > Diff tab.

Diff%20-%20Options.png
© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.