Skip to main content

Module diff

Module diff 

Source
Expand description

Line diffs of DECRYPTED content, computed where the key is: in the CLI (gunnar crypt diff) and in the browser console’s wasm. The server never sees plaintext, so it cannot diff an encrypted repository; there are no pre-made diffs either (they would only cost space). Both sides run this same function, so a diff reads the same in the terminal and in the browser.

The shape matches the console’s server-side diff (gunnar-ui-server git/diff.rs): histogram diff, 3 lines of context, hunks closer than 7 lines merged, git’s @@ numbering.

Structs§

FileDiff
A whole-file comparison.
Hunk
A run of changed lines with its context.
Line
One line of a hunk.

Enums§

LineKind
What one line of a hunk is.

Constants§

CONTEXT
Lines of unchanged context around a change.
MERGE_GAP
Two changes closer than this share one hunk.

Functions§

hunks
Line-level hunks between two texts.
unified
The hunks as unified-diff text (@@ -a,b +c,d @@, then /+/- lines).