Commits


portable: add FreeBSD support This adds the capability to compile got-portable on FreeBSD.


portable: initial Linux compilation This commit modifies the GoT main branch to be able to compile it under linux.


rename got_fetch_parse_uri() to got_dial_parse_uri() This function is now being used by both 'got fetch' and 'got send' so its former name was misleading.


de-duplicate a constant used by both 'got fetch' and 'got send' Both GOT_FETCH_PKTMAX and GOT_SEND_PKTMAX had the same value. Declare this value as GOT_PKT_MAX in got_lib_pkt.h instead.


move duplicated dial_ssh() and dial_git() functions into a common file These functions are used by 'got send' and 'got fetch' in order to open network connections to a server. Move them into new file lib/dial.c and declare relevant functions in got_dial.h and lib/got_lib_dial.h. No functional change.


use socketpair(2) instead of pipe(2) for bi-directional communication On Linux, pipes returned from pipe(2) only work in one direction. This broke 'got clone' over ssh in the -portable version because got-fetch-pack assumes it can use its fetchfd for both reading and writing. I wrote a complicated diff to use two pipe(2) calls instead of one, but millert suggested a simpler solution: Use socketpair(2) instead of pipe(2). ok millert jrick tracey


dial_git(): fix memory leak and simplify Simplify dial_git() by formatting the initial Git protocol packet with dprintf, suggested by millert, and stop leaking an asprintf buffer. ok stsp


fix error checking in dial_ssh()


make close(2) failure checks consistent; check 'close() == -1' everywhere ok millert, naddy


switch reflist to TAILQ; insert elements more efficiently for sorted input ok naddy


avoid signed vs unsigned comparisons in fetch.c ssizeof() macro idea courtesy of millert@ ok millert@


use size_t for loop indices to avoid signedness warnings; from emaste@freebsd


use fchmod(2) instead of chmod(2). it is less racy, and we just opened the descriptor. ok naddy@ stsp@


fix permissions mode bits for fetched pack files; patch by Alisdair MacLeod


handle failed connection attempts to git:// servers; patch by jrick


strip trailing slashes from repository path in got_fetch_parse_uri()


remove redundant leading slashes from repository path when parsing URIs


Stop including <sys/syslimits.h> directly. POSIX says the limits defined there are available from <limits.h>, which almost all affected source files already included anyway. ok millert stsp


use the POSIX standard endian functions and explicitly include <endian.h> ok stsp


do not rely on <zlib.h> to pull in <unistd.h> ok stsp


don't override port configuration with explicit argument if the url doesn't contains it it permits to .ssh/config to be honored same diff from stsp@


stop verifying pack file checksum in the main process during clone/fetch Both got-fetch-pack and got-index-pack now verify the pack file checksum. This means we can avoid reading the entire pack file in the main process just to verify its checksum and avoid a noticable stall between fetching and indexing on slow machines.


represent packfile hash as byte array in the privsep layer, not as object ID


always initialize pack hash output parameter of got_fetch_pack()


add support for fetching arbitrary references to 'got clone' and 'got fetch'