Commit Briefs

7a52a8bcab Stefan Sperling

remove casts which make older gcc versions unhappy

../lib/diffreg.c:44: error: initializer element is not constant ../lib/diffreg.c:51: error: initializer element is not constant ../lib/diffreg.c:59: error: initializer element is not constant ../lib/diffreg.c:66: error: initializer element is not constant reported by Red on Libera IRC, and by sthen@ who pointed out such failures appearing in landry's sparc64 bulk build logs.


e72b098390 Stefan Sperling

sync file with diff.git 279d77aa1e4b921090e702a6a8a5a94a98a062b1 and

use the faster headers-only mode for diff3


d671c3138b Stefan Sperling

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


5e91dae4dd Stefan Sperling

remove trailing whitespace; patch by Josiah Frentsos


c7d5c43caf Mark Jamsek

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@


4b752015b5 Stefan Sperling

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


49d4a01751 Stefan Sperling

move more opentemp out of diffreg.c

ok tracey


d7b5a0e827 Stefan Sperling

inline struct got_object_id in struct got_object_qid

Saves us from doing a malloc/free call for every item on the list. ok op@


56b63ca4ab Stefan Sperling

make fclose(3) failure checks consistent; check 'fclose() == EOF' everywhere

ok millert, naddy





24e87ea363 Stefan Sperling

remove unused function got_diffreg_prepared_files()



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.



ac9e7fddf6 Tracey Emery

create temporary workaround to opening /dev/null during diffing.

this will need to be reworked later. ok stsp


303e14b5e9 Stefan Sperling

Add missing includes for time() and ctime()

These headers were implicitly used on OpenBSD, but building on Linux revealed that <time.h> wasn't included directly. diffreg.c uses ctime(), which additionally needs <sys/types.h>.


83290b45b0 Stefan Sperling

Remove return value from diffreg's fetch()

The last use of this was removed in 0165cdf03ffac4c24334979832ad27554913d54c over a year ago.


8fbe07c208 Stefan Sperling

Remove unused variable in diffreg's fetch()


14ed98fdf9 Stefan Sperling

remove unused 'oldfile' parameter from diffreg.c's fetch()


dc424a06a9 Stefan Sperling

initial 'got stage -p' implementation


3043f6a395 Stefan Sperling

remove accidental assignment in diffreg.c


8cbe58099b Stefan Sperling

plug /dev/null file descriptor leaks in diffreg.c