Commit Briefs

ade7d17b61 Stefan Sperling

add -J option to usage() function of relevant commands


3333ce96c5 Stefan Sperling

make 'cvg commit' actually apply the -J option



d3901b506e Stefan Sperling

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.


aca784d0f6 Mark Jamsek

use got_object_id_queue_free() instead of hand-rolled code

ok stsp@


79917dd618 Mark Jamsek

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@


ebdd042fb1 Stefan Sperling

check for errors from telldir(3); suggested by jamsek


c0586da31b Stefan Sperling

make 'got import' output independent of readdir(3) entry order

ok jamsek


0bae7db616 Stefan Sperling

add a TODO item for 'gotadmin cleanup'


54859d1a7e Stefan Sperling

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.



77e47d3c8f Mark Jamsek

style(9) whitespace: don't indent got-build-regress.sh cases

ok stsp@


2094d9ad42 Mark Jamsek

util/got-build-regress.sh: add missing 'W' to optstring

ok stsp@


0f35fb6b3d Mark Jamsek

tog: don't clobber error with got_repo_close() error

While here, style(9) the adjacent block: remove function call from initializer. ok stsp@


919e5e7241 Mark Jamsek

tog: clamp selected idx to avoid showing negative indexes

In the rare case views are smaller in height than the first line number after the view's header lines (i.e., [2,5] depending on the view), we can decrement the selected entry index into negative values; clamp it to 0. Add a log view test case covering this path by opening a child tree view and toggling fullscreen. ok stsp@


b7045a4dd3 Mark Jamsek

fix NULL deref when scrolling small tog tree views down

In the rare case a tree view is smaller than four lines in height, the last_displayed_entry is NULL. Check this condition on a scroll down event with j/down arrow or ^f/pgdn to guard a NULL got_tree_entry from being passed to got_tree_entry_get_next() where it is dereferenced. And add a test case covering this path. ok stsp@


6bdea1b4f0 Mark Jamsek

tog: don't mark incorrect base commit in nested log views

If a nested log view is opened, don't reuse the work tree's base commit index from the initial `tog log` invocation because it is based on the initial commit queue. If it has become invalid, an incorrect log view commit entry is painted with the base commit marker. Reset the index whenever opening nested log views so that it is recomputed, and write a regression test to cover this case. ok stsp@


35c7ffa4d9 Mark Jamsek

regress/tog: ref view coverage of tag references

Test for the error case when selecting tags that point to non-commit objects. And test the valid case of selecting nested tags that resolve to commit objects. ok stsp@


c97fc5709b Mark Jamsek

regress/tog: add basic ref view tests; ok stsp@


f94d6a8310 Mark Jamsek

tog: make ref view selection of non-commit tags non-fatal

Tags can point to all git objects: commits, trees, blobs, and tags. Selecting a tag that points to any object other than a commit causes a fatal error. Instead, report a message to the status line. Similarly, nested tags may resolve to a commit, which currently errors. Instead, keep peeling till we reach the bottom and if it's a commit, use it for the requested view. ok stsp@


46f6a3467a Mark Jamsek

tog: plug object id leak in resolve_reflist_entry error path

ok stsp@



0b3936e0d1 Mark Jamsek

tog: fix log view race condition evinced by regress

When the commit graph has been traversed, we set the log_complete flag to signal the main thread that we've completed iterating commit history, which request_log_commits() checks and, if set, returns early instead of calling trigger_log_thread(). If called, trigger_log_thread() wakes the log thread, then waits on the log thread to unblock when another commit has been loaded. There's a race between the log thread setting the log_complete flag and request_log_commits() checking it, which causes trigger_load_thread() to wait on a signal that never unblocks because there are no more commits to be loaded. ok stsp@


2862fe8b5e Mark Jamsek

regress/tog: log view test for T keymap on worktree entry

Coverage for the case fixed in 74bea526c5. ok stsp@


74bea526c5 Mark Jamsek

fix NULL deref with T keymap on log view worktree entry

When the log view T keymap is used, the selected_entry is passed to browse_commit_tree() to open a tree view of the repository as at the selected commit, which passes the selected_entry->id member to open_tree_view() to open the commit. The id member, which is a NULL pointer in work tree entries, is dereferenced so we segfault. If the T keymap is used on a work tree entry, use the base commit id instead, which we must have if a work tree entry is selected. ok stsp@