Commit Briefs

a42e5f4ff9 Thomas Adam

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


b6b86fd1b9 Thomas Adam

remove trailing whitespace; patch by Josiah Frentsos


82c78e96f1 Thomas Adam

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@


25ec70067d Thomas Adam

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


dd2e2f52c1 Thomas Adam

move more opentemp out of diffreg.c

ok tracey


fdf3c2d387 Stefan Sperling

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.






24e87ea363 Stefan Sperling

remove unused function got_diffreg_prepared_files()


cb7c1b68b5 Stefan Sperling

remove unused function got_diff_blob_prepared_file()



62ad13c507 Stefan Sperling

remove unused empty function got_diff_dump_change()


fe621944e8 Stefan Sperling

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.



d136cfcb98 Stefan Sperling

show original file content in conflict markers


4c9641fdb6 Stefan Sperling

fix and simplify blame algorithm

Always diff against latest version of file. This is much easier since there is no need to keep track of lines shifting around.


ad7de6a516 Stefan Sperling

remove unused function got_diff_blob_file_lines_changed()


a7c9878d5b Stefan Sperling

make stage -p show the number of changes in a file


dc424a06a9 Stefan Sperling

initial 'got stage -p' implementation


7f1f93af75 Stefan Sperling

introduce got_diff_blob_file_lines_changed()


01a4495616 Stefan Sperling

declare conflict marker strings in got_lib_diff.h


57ee5d5084 Stefan Sperling

allow callers of diff3 code to detect merge conflicts


a551f2158d Stefan Sperling

diff3: make labels work and fix leaks