Commit Briefs
tog: don't make users wait for the worktree diff to quit (main)
Reported by naddy: if the user opens tog and quickly quits before the log thread has finished fetching work tree state for displaying dirty work tree entries, the main thread waits for the log thread to finish before acting on the user's quit input. This produces a noticeable lag between entering 'q' and tog actually terminating. Pass a pointer to the quit flag to the worktree diff cancel callback so we can act on it immediately without making the user wait. tested by naddy who confirmed it greatly reduces the lag
do not delete objects reached via nested tags during 'gotadmin cleanup'
Make gotadmin cleanup resolve multiple levels of nested tags, in order to ensure that objects referenced via nested tags will not get deleted. Add test coverage for this edge case.
do not delete directly referenced trees and blobs during 'gotadmin cleanup'
We only considered referenced commit and tag objects during cleanup. Directly referenced trees or blobs were seen as unreferenced, and deleted during cleanup. Add test coverage for this problem and fix it.
plug memleak and ensure fd is valid before passing to close(2)
While here, fix potential NULL deref in gotadmin cleanup and pack error paths. ok stsp@
make gotadmin cleanup pack the repository before cleaning
Our cleanup implementation is only safe to use after everything referenced has been packed into a single pack file. Otherwise, the algorithm we use for checking pack redundancy might remove small packs which contain objects that other objects depend on. The easy fix for this issue is to have 'gotadmin cleanup' create the required pack file before cleaning up, making cleanup safe by default. This happens to be what 'git gc' does as well. ok jamsek
switch to fseeko() and tweak error checking in file_is_binary()
provided by mark during review of previous change
remove full content comparison loop from got status
We are going to run modified files through the diff engine anyway. As a bonus speed-up tweak, skip conflict marker detection in binary files found on disk.
skip full content comparison in 'got status' if file sizes differ
Speeds up 'got status' in work trees that contain large files which are modified. This change exposes bugs in 'got revert' which now manifest as test failures. One bug where the size recorded in the file index is not updated during revert, and another where a wrong base commit is recorded in the file index entry during revert. Fix those bugs, too. ok jamsek
rename gotwebd "socket" processes to "server"
This name is more inuitive and matches the documentation of the prefork parameter in gotwebd.conf. ok jamsek
make gotwebd's parent process drop root privileges
Once the configuration has been applied the parent process does nothing which would require root privileges. ok jamsek
add ssh -i identity-file support to commands which use the network
Add a -i option to got clone, fetch, send, as well as cvg clone, update, commit. This allows ad-hoc use of SSH private keys without having to create entries in ~/.ssh/config. The test suite for an upcoming gotsysd(8) daemon needs this to log into temporary test VMs with temporary SSH keys, both generated by the test suite. ok jamsek
try to improve http-server startup/teardown in regress
Let tests fail if http-server fails to start up within 5 seconds. Make http-server report its process ID in its log file such that tests can kill it by PID. Prompted by semi-regular failures on my arm64 regress builder.
tog: don't apply count modifier to the H, &, p keymaps
It's annoying to have the help (H) and limit (&) keymaps repeatedly fire after closing their respective views if accidentally preceded by a count modifier, and doesn't seem like a valid use case. Similarly, writing N patch files to /tmp is wasteful. ok stsp@
make seq(1) invocations in test_log_commit_keywords() portable
The OpenBSD version of seq defaults to an increment value of -1 here. On Debian we have to set the increment value to -1 explicitly. Otherwise, seq produces no output at all and the test fails.