Commit Briefs



Christian Weisgerber

add a missing include for uint8_t and switch from <inttypes.h> to <stdint.h>

ok millert stsp


Stefan Sperling

allow diff API users to atomize files separately

This is a breaking API change (not that we care about that at this point). This can avoid redundant work spent on atomizing a file multiple times. There are use cases where one particular file must be compared to other files over and over again, such as when blaming file history. The old API gave access to both versions of the file to the atomizer just in case a future atomizer implementation needs this. This can still be achieved by passing a second file via the atomizer's private data pointer.


Neels Hofmeyr

reflect ignore-whitespace in atom hash



Stefan Sperling

fix off-by-one access beyond mapped file in diff_data_atomize_text_lines_mmap()

Thread 1 received signal SIGSEGV, Segmentation fault. 0x0000013992a89eca in diff_data_atomize_text_lines_mmap (d=0x13b9b455668) \ at /home/stsp/src/got/got/../lib/diff_atomize_text.c:134 134 if (line_end[0] == '\r' (gdb) p pos $1 = (const uint8_t *) 0x13be402006d "" (gdb) p end $2 = (const uint8_t *) 0x13be4023000 <error: Cannot access memory at \ address 0x13be4023000> (gdb) p end-1 $3 = (const uint8_t *) 0x13be4022fff "" (gdb) p line_end $4 = (const uint8_t *) 0x13be4023000 <error: Cannot access memory at \ address 0x13be4023000>




Neels Hofmeyr

rename diff_atom->d to diff_atom->root, because it always is

The idea was that for each diff box within the files, the atoms would have a backpointer to the current layer of diff_data (indicating the current section), but it is not actually needed to update the backpointer in each atom to the current diff_data. That is why the current code always points atom->d to the root diff_data for the entire file. Clarify by proper name. Constructs like atom->d->root->foo are redundant, just use atom->root->foo.



Stefan Sperling

repair DEBUG build




Stefan Sperling

return error instead of abort()


Stefan Sperling

rename 'debug.h' to 'diff_debug.h'





Neels Hofmeyr

KNF: use max 80 columns



Neels Hofmeyr

Kill unused variables


Neels Hofmeyr

initial commit