Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ Comparing and Merging Files - Table of Contents

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Comparing and Merging Files - Table of Contents

Comparing and Merging Files

diff, diff3, sdiff, cmp, and patch

Edition 1.3, for diff 2.5 and patch 2.1

September 1993

by David MacKenzie, Paul Eggert, and Richard Stallman


  • Overview
  • 1. What Comparison Means
    • 1.1 Hunks
    • 1.2 Suppressing Differences in Blank and Tab Spacing
    • 1.3 Suppressing Differences in Blank Lines
    • 1.4 Suppressing Case Differences
    • 1.5 Suppressing Lines Matching a Regular Expression
    • 1.6 Summarizing Which Files Differ
    • 1.7 Binary Files and Forcing Text Comparisons
  • 2. diff Output Formats
    • 2.1 Two Sample Input Files
    • 2.2 Showing Differences Without Context
      • 2.2.1 Detailed Description of Normal Format
      • 2.2.2 An Example of Normal Format
    • 2.3 Showing Differences in Their Context
      • 2.3.1 Context Format
        • 2.3.1.1 Detailed Description of Context Format
        • 2.3.1.2 An Example of Context Format
        • 2.3.1.3 An Example of Context Format with Less Context
      • 2.3.2 Unified Format
        • 2.3.2.1 Detailed Description of Unified Format
        • 2.3.2.2 An Example of Unified Format
      • 2.3.3 Showing Which Sections Differences Are in
        • 2.3.3.1 Showing Lines That Match Regular Expressions
        • 2.3.3.2 Showing C Function Headings
      • 2.3.4 Showing Alternate File Names
    • 2.4 Showing Differences Side by Side
    • 2.5 Controlling Side by Side Format
      • 2.5.1 An Example of Side by Side Format
    • 2.6 Making Edit Scripts
      • 2.6.1 ed Scripts
        • 2.6.1.1 Detailed Description of ed Format
        • 2.6.1.2 Example ed Script
      • 2.6.2 Forward ed Scripts
      • 2.6.3 RCS Scripts
    • 2.7 Merging Files with If-then-else
      • 2.7.1 Line Group Formats
      • 2.7.2 Line Formats
      • 2.7.3 Detailed Description of If-then-else Format
      • 2.7.4 An Example of If-then-else Format
  • 3. Comparing Directories
  • 4. Making diff Output Prettier
    • 4.1 Preserving Tabstop Alignment
    • 4.2 Paginating diff Output
  • 5. diff Performance Tradeoffs
  • 6. Comparing Three Files
    • 6.1 A Third Sample Input File
    • 6.2 Detailed Description of diff3 Normal Format
    • 6.3 diff3 Hunks
    • 6.4 An Example of diff3 Normal Format
  • 7. Merging From a Common Ancestor
    • 7.1 Selecting Which Changes to Incorporate
    • 7.2 Marking Conflicts
    • 7.3 Generating the Merged Output Directly
    • 7.4 How diff3 Merges Incomplete Lines
    • 7.5 Saving the Changed File
  • 8. Interactive Merging with sdiff
    • 8.1 Specifying diff Options to sdiff
    • 8.2 Merge Commands
  • 9. Merging with patch
    • 9.1 Selecting the patch Input Format
    • 9.2 Applying Imperfect Patches
      • 9.2.1 Applying Patches with Changed White Space
      • 9.2.2 Applying Reversed Patches
      • 9.2.3 Helping patch Find Inexact Matches
    • 9.3 Removing Empty Files
    • 9.4 Multiple Patches in a File
    • 9.5 Messages and Questions from patch
  • 10. Tips for Making Patch Distributions
  • 11. Invoking cmp
    • 11.1 Options to cmp
  • 12. Invoking diff
    • 12.1 Options to diff
  • 13. Invoking diff3
    • 13.1 Options to diff3
  • 14. Invoking patch
    • 14.1 Applying Patches in Other Directories
    • 14.2 Backup File Names
    • 14.3 Reject File Names
    • 14.4 Options to patch
  • 15. Invoking sdiff
    • 15.1 Options to sdiff
  • 16. Incomplete Lines
  • 17. Future Projects
    • 17.1 Suggested Projects for Improving GNU diff and patch
      • 17.1.1 Handling Changes to the Directory Structure
      • 17.1.2 Files that are Neither Directories Nor Regular Files
      • 17.1.3 File Names that Contain Unusual Characters
      • 17.1.4 Arbitrary Limits
      • 17.1.5 Handling Files that Do Not Fit in Memory
      • 17.1.6 Ignoring Certain Changes
    • 17.2 Reporting Bugs
  • Concept Index


This document was generated on 27 January 1999 using texi2html 1.55k.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026