Commit Briefs

Thomas Adam

refactor got log -d and tog diffstat to compute diff once

This eliminates the previous performance cost by making 'got log -d' and tog diff view compute the diffstat while building the diff in a temp file like we do with 'got diff -d'. Also, keep the current 'got log -d' UI as per stsp's suggestion. ok stsp@


Thomas Adam

got: expand diffstat -d option to 'got diff'

Like got log -d, add the switch to 'got diff' to display a diffstat of changes; as per stsp's suggestion, we always include diff output with the diffstat. Disabled in gotwebd (for now :) Includes tweaks from op@ ok stsp@


Thomas Adam

got: implement diffstat for got log and tog diff view

Add new got_diff_blob_cb() implementation to compute added/removed line metrics for a given diff. This enables displaying a diffstat with 'got log -d'. As per suggestion from stsp, change tog diff view to display the diffstat by default. ok stsp@


Thomas Adam

show file mode for new added files in work tree diffs

Make work tree diffs of local changes on disk display the file mode of new added files like other versions of `got diff` currently do. ok stsp@


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@


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


Thomas Adam

move more opentemp out of diffreg.c

ok tracey


Thomas Adam

move got_opentempfd() out of lib/diff.c again

ok tracey


Thomas Adam

build with -Wwrite-strings

Throwing this into the mix for a while, we can always get rid of it again if it becomes annoying. No objections from stsp@


Thomas Adam

move creation of tempfiles outside of lib/diff.c

ok tracey


Thomas Adam

implement 'got diff -c' for diffing commits with optional filtering by path

Need for filtering by path sugggested by kn@ ok naddy@



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.


Stefan Sperling

show a list of paths changed in a commit with 'got log -P', and in tog

requested by matthieu@







Stefan Sperling

whitespace formatting fixes in include/




Stefan Sperling

show commit timestamps in diff headers



Stefan Sperling

use a constant for max diff context size