Commits


switch diff output mode from "edscript" to "plain" for diff3 getchange() in diff3.c takes any line that starts with an integer and treats it as a hunk header. It doesn't actually require ed script instructions, and traditional ed script diff output would break it. Thus, changing Got's diff3 to rely on plain diff output mode paves the way for implementing traditional ed-script style output in diff.git. Patch by Tom Jones


remove trailing whitespace; patch by Josiah Frentsos


tog: keymaps to jump to next/prev file/hunk in the diff Add () and {} key maps to navigate to the previous and next file or hunk in the diff. This required changing Got's diff API to collect line type metadata in addition to the line offsets already produced as prompted by stsp. ok stsp@


switch 'tog diff' and 'tog blame' to Myers diff for speed Make the choice of diff algorithm configurable by diff API users. The got and gotweb programs keep using Patience diffs which are prettier than Myers. But tog should be as fast as possible since it is being used interactively. If performance of Patience diff gets improved later we can consider switching tog back over to it. ok tracey jamsek


move more opentemp out of diffreg.c ok tracey


use Patience diff for merging during cherrypick/backout/histedit/rebase This has been shown to prevent mis-merges in some cases. It's probably not a final solution. We should look at what Git's "recursive merge" is doing and implement something similar. Keep using Myers during update/unstage. The advantage of Myers is that it produces smaller conflict chunks, and there are no known cases of mis-merges which affect update/unstage.


make merge_file() accept FILEs instead of paths for orig and deriv inputs


consistently label removed files as "/dev/null" in diff headers


handle binary files in got/tog diff commands; add -a options to force text


allow for configuring a custom file atomizer with got_diff_get_config()


remove unused function got_diffreg_prepared_files()


remove unused function got_diff_blob_prepared_file()


simply got_diff_prepare_file() by letting callers worry about file creation


remove unused empty function got_diff_dump_change()


merge new diff implementation from the git.gameoftrees.org diff.git repository This new diff implementation was started by Neels Hofmeyr during the u2k20 hackathon and now replaces diffreg.c code lifted from the OpenBSD base system. The integration of this code into Got was done by me. Got now uses the patience diff algorithm by default. The diff.git repository will remain the primary repository for the diff code, which already compiles and runs on other operating systems such as Linux. Any fixes and improvements for files inherited from the diff.git repository should be written against that repository and synced to got.git afterwards.