Commit Briefs

Omar Polo

change add_delta to take an off_t instead of size_t.

add_delta already calls got_delta_open casting the size_t to off_t, and all the add_delta callers pass an off_t anyway; fixes an implicit off_t truncation. ok stsp@



Omar Polo

check size before calling mmap(2)

It's only a preparatory step, as checking whether a size_t is less than SIZE_MAX is moot. In a follow-up commit, however, the `filesize' field of the struct got_pack will become off_t and these checks will kick in. This also makes consistent how we guard mmap(2) against empty files. ok and improvements stsp@



Christian Weisgerber

fix off_t type mismatch

off_t is a signed type and depending on the platform, it can be "long" or "long long", so cast to long long for printf().


Omar Polo

change got_pack_parse_offset_delta tslen argument to size_t

The tslen argument is always in the (1..9) range so `int' is technically fine (even int8_t would be!) but all the callers are passing a size_t, so change the type accordingly. ok stsp@


Stefan Sperling

close parent's end of imsg pipe before waiting for a child process to exit

Prevents a dead-lock in 'tog log' where tog wants to exit (e.g. because the user pressed Ctrl-C) while a got-read-pack child process wants to send more commits. Closing the parent's pipe descriptor makes writes to the pipe fail in the child process. The child then unwinds via an ERR_EOF error and exits, instead of forever polling its end of the pipe in order to write more data. ok jamsek




Christian Weisgerber

fix off_t type mismatches

off_t is a signed type and depending on the platform, it can be "long" or "long long", so cast to long long for printf(). ok stsp



Stefan Sperling

open temporary files needed for delta application in got_repo_open()

This prepares for callers of got_repo_open() that cannot afford to open files in /tmp, such as gotwebd. In a follow-up change, we could ask such callers to pass in the required amount of open temporary files. One consequence is that got_repo_open() now requires the "cpath" pledge promise. Add the "cpath" promise to affected callers and remove it once the repository has been opened. ok tracey




Stefan Sperling

store deltas in compressed form while packing, both in memory and cache file

This reduces memory and disk space consumption during packing. with tweaks + memleak on error fix from op@ ok op@