An application that prints the diff between two given files. Prints human-readable instructions for transforming file1 into file2. The app uses the Myers algorithm for computing the instructions.
- .NET 9.
- For Windows (x64)
dotnet publish -r win-x64 -c Release --self-contained true
- For macOS (ARM)
dotnet publish -r osx-arm64 -c Release --self-contained true
FileDiff <file1> <file2>
FileDiff/
│
├─ Common/
│ └─ OffsetArray.cs # An array that can be accessed using an offset index
│
├─ Diff/
│ └─ FileComparer.cs # Returns grouped diff instructions with the desired output format
│ │
│ └─ Algorithm
│ │ └─ MyersComparer.cs # Returns single-line diff instructions using the Myers algorithm
│ │
│ └─ Data
│ └─ Instruction.cs # Base class for the instructions the app uses
│ └─ InsertInstruction.cs # Instruction insterting new lines
│ └─ RemoveInstruction.cs # Instruction for removing new lines
│
└─ Program.cs # Application entry point
- Myers Algorithm Explanation by James Coglan.