Running file differences reports

File differences reports include the differences between two or more versions of a text file. You can run these reports when viewing file history. See Viewing file history.

If you need to create patches for distributing source code updates, run a differences report and save the output as a text file. This text file contains the patch code. You can send the file to a customer to apply to their copy of the source file using GNU Project's Patch utility. See Tips for Making and Using Patches for information.

1. Select a file and choose Activities > History.

The History dialog box opens.

You can also view file differences in a History report. See Creating history reports.

2. Select the files to include in the report.

3. Click the Differences Report button.

The Generate File Differences Report dialog box opens.

4. Select a Version to Include option.

  • Selected version to selected version displays differences between the file versions selected in the History dialog box. For example, if you select versions 2 and 3, the report displays the differences between the two versions. If you select versions 2, 3, and 5, the report displays differences between versions 2 and 3, and versions 3 and 5.
  • Selected version to previous version displays differences between the selected file version and the previous version. For example, if you select version 3, the report displays differences between versions 2 and 3. If you select versions 2, 3, and 5, the report displays differences between versions 1 and 2, versions 2 and 3, and versions 4 and 5.
  • All versions in this branch displays the differences between all file versions in the branch. For example, if the branch contains 5 versions of the file, the report displays differences between versions 1 and 2, versions 2 and 3, versions 3 and 4, and versions 4 and 5.

5. Select any additional report Options.

  • Ignore case differences in file contents excludes differences in character case.
  • Ignore whitespace excludes any whitespace differences (spaces and tabs).
  • Ignore changes in the amount of whitespace excludes additions or deletions to existing whitespace (spaces and tabs).
  • Ignore blank lines excludes inserted or deleted blank lines.
  • Include report header information includes a header with the report date, branch, repository, and file.

6. Select an Output Format.

When you view differences, you may also want to see the parts of the files near the lines that differ to help you understand what changed. This is the context.

If you are distributing new versions of files in the form of diff output, use one of the output formats that show context so users can easily apply the differences.

  • Enter the number of Output lines of context to display before and after each change. The default is 3 lines.
  • Select Unified format to display the differences with limited context lines. This format excludes redundant context lines.
  • Select Context format to display the differences with context lines. This format shows several lines of context around the lines that differ. It is the standard format for distributing updates to source code.

7. Click OK.

The report opens.

8. Click Save As to save the report or Print to print it.

9. Click OK when you finish.

Symbol meanings

The following symbols indicate differences in a differences report.

Symbol Meaning
! A line that is part of a group of lines that changed between the two versions (context format only)
+ Inserted line
- Deleted line