Diff Utility
We have provided a file gitlet/Diff.java
in the skeleton, which will compare
two sequences of lines read from files, and compute the edits needed
to convert one to the other. You will have to read its comments and
figure out how to use it to produce the desired output format.
This utility works by finding a longest common subsequence of lines in the two files—a subsequence that appears in both files, but not necesaarily in the same place. The lines of the subsequence may be scattered in different ways in the two files (they are not necessarily adjacent to each other), but the lines appear in the same order in each. From such a subsequence, the utility is able to figure out how to change one file into the other by modifying a minimal number of lines.