Commit Briefs
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
use Patience diff for merging during cherrypick/backout/histedit/rebase
This has been shown to prevent mis-merges in some cases. It's probably not a final solution. We should look at what Git's "recursive merge" is doing and implement something similar. Keep using Myers during update/unstage. The advantage of Myers is that it produces smaller conflict chunks, and there are no known cases of mis-merges which affect update/unstage.
in addblk(), only read data into buffer1 if we will compare it to buffer2
suggested by and ok naddy@
check a block's hash as well as its length before expensive comparisons
suggested by + ok naddy, and Ori agrees
fix unrelated changes being merged by got cherrypick/backout/rebase/histedit
This was a long-standing and very annoying bug. The two xfail tests in the cherrypick test suite are passing now.
add an xfail test for a cherrypick bug where unrelated changes get merged
The test case I am using here is a bit large but I could not yet find a way to make it smaller. If someone knows a smaller test case, please let me know. naddy caught a small bug in the new test code I had written, thanks!
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
validate reference names in open_ref()
This catches invalid reference names passed to 'got ref -l' and will also be needed to validate reference names passed to a future 'gotadmin pack' command. ok naddy@
add checksum support to got_deflate_to_file()
This will eventually be used by 'gotadmin pack'. Checksum init and finalization will need to be done by the caller since many objects will be written out in compressed form while we are computing checksums across the entire pack file. ok millert, naddy
plug a memory leak in got_ref_list_free()
Code which inserts a reference into a reflist passes ownership of this reference to the list. However, got_ref_list_free() never closed such references, which resulted in a memory leak. ok tracey