Commits


make 'got rebase' find a merge base with topological sorting if needed Fixes a problematic case of spurious conflicts encountered by naddy@ on landry's firefox package git repository. The current implementation of toposort is expensive, so this might make rebase appear to run slowly on large repositories. However, this is better than letting users deal with spurious conflicts. ok op@


make 'got send' detect connections that are unexpectedly closed by the server ok op@


Begin cvg


plug a leak in insert_sendable_ref error path from op@


simplify lib/send.c reference handling Reorganize the reference validation and pathlist generation by removing the reflist and building a pathlist directly. The pathlist entries record the object id in their extra data pointer, which also allows several redundant reference lookups to be skipped. This will eventually simplify sending target reference names that do not match the local repo by adding another parameter to insert_sendable_ref for a remote reference. This remote name will be added to the pathlist, but validation and object id lookups will continue to be performed with the local reference. ok jamsek


fix sending merge commits; with a regression test by James Cook


significantly reduce the amount of code linked into gitwrapper By moving got_serve_parse_command() from lib/serve.c into lib/dial.c as got_dial_parse_command(), we can significantly reduce the amount of symbols gitwrapper depends on indirectly. As a downside, gotsh now needs to link to dial.c. But it only uses the same parsing routine, and any other routines in dial.c would likely cause pledge violations in gotsh if used. No functional change.


rename lib/sha1.c to lib/hash.c It will soon grow functions to deal with sha256 too. stsp@ agrees.


include sha2.h too where sha1.h is included In preparation for wide sha256 support; stsp@ agrees. Change done mechanically with find . -iname \*.[cy] -exec sam {} + X ,x/<sha1\.h>/i/\n#include <sha2.h>


unbreak send.sh regress from recent ref-delta changes fix argument order typo in flags passed to got_pack_create()


gotadmin pack: add a -D flag to force using ref-delta Intended mostly for the regress suite, so we'll be able to test also the ref-delta code paths. ok stsp@


got: minor refactor of got_pathlist_free() API Accept flag parameter to optionally specify which pointers to free. This saves callers looping through the list to free pointers. ok + fix stsp@


got send: show server error Print the error message reported by the remote server when failing to update a branch (for e.g. because of a server-side check.) Reported by gonzalo@, with help and ok stsp@.


let callers of got_pack_create() configure rate-limiting of progress reporting Needed by future gotd(8), where progress reports will be sent to a network socket, rather than a local terminal.


move got_opentempfd() call out of got_pack_create() Future gotd(8) needs to run got_pack_create() in a chroot environment, so we can no longer open new temporary files inside got_pack_create(). ok op@


make got_pack_create() write to a file descriptor instead of a stdio FILE The old code required a seekable output file. This conflicts with requirements of future gotd(8), which will write pack file data to network sockets. ok op@


Correctly track if we sent more data since the last time we looked. With the narrow scope of bytes_sent_cur it would always be zero, and we would always update progress. Found by llvm's scan-build (Dead store). OK stsp


print additional progress information while packing ok op@


fix regression where 'got send -T' failed if same tag already exists on server Problem reported and fix tested by Omar Polo.


use RB_TREE instead of STAILQ to manage packindex bloom filters; much faster


make it possible to merge vendor branches with 'got merge'


fix another instance of 'got send' sending branches the server already has


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.


make realloc_ids() malloc-like and do not overallocate Let realloc_ids() take as argument the number of entries to allocate. Do not allocate an extra chunk. ok stsp


drop realloc_ids() initialization calls, one of which had a typo realloc_ids() is called again in the loops that assign to the ID arrays, before the first assignment. ok stsp