From: Stefan Sperling Subject: Re: implement tog ref command To: Christian Weisgerber Cc: gameoftrees@openbsd.org Date: Tue, 24 Nov 2020 22:52:15 +0100 On Mon, Nov 23, 2020 at 11:41:36PM +0100, Christian Weisgerber wrote: > Stefan Sperling: > > > This adds a reference view to tog. > > Excellent! > > There are a few teething problems: > > * tog ref, /search for name, hit return, and tog is stuck with > commit ........................................ [0/0] loading... > This doesn't happen if you j/k move to a particular entry. Thanks! Should be fixed by this patch: diff 2b8db489e8480a17bc3d329234cf659f4939adae /home/stsp/src/got blob - c0a85cd49ea9763190a0f4d11960ac7a8175b043 file + tog/tog.c --- tog/tog.c +++ tog/tog.c @@ -2340,6 +2340,7 @@ done: static const struct got_error * show_log_view(struct tog_view *view) { + const struct got_error *err; struct tog_log_view_state *s = &view->state.log; if (s->thread == NULL) { @@ -2347,6 +2348,15 @@ show_log_view(struct tog_view *view) &s->thread_args); if (errcode) return got_error_set_errno(errcode, "pthread_create"); + if (s->thread_args.commits_needed > 0) { + err = trigger_log_thread(view, 1, + &s->thread_args.commits_needed, + &s->thread_args.log_complete, + &s->thread_args.need_commits, + &s->thread_args.commit_loaded); + if (err) + return err; + } } return draw_commits(view, &s->last_displayed_entry, > * If I run tog ref in a repository and window where the number of > refs (r) compares to the number of window lines (w) like > w < r < 2w, then page down from the initial position displays the > next to last entry on the bottom line and no entry is selected. I cannot reproduce this, sorry. In a small xterm with something like 6 lines visible, and a repository with 25 refs, page-down seems to do the right thing. Can you give me step-by-step instructions? Does this bug also affect the tree view? > * Too much copy-paste. cmd_ref() still calls usage_tree(). Fixed, thanks! > Immediate feature request: opening a tree view directly from a ref > view. Will do.