"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Mark Jamsek <mark@jamsek.com>
Subject:
tog: todo item #2 respond to key presses while "loading..."
To:
Game of Trees <gameoftrees@openbsd.org>
Date:
Fri, 12 Aug 2022 23:51:32 +1000

Download raw body.

Thread
I thought I'd have a quick look at this before zzz but I'm not sure it
can be so simple so I'm looking for further testing.

I've been playing with this in src.git for a bit and it appears to work
as you'd expect: you can open other views, navigate the log, and even
quit tog while all ~221k commits are loading. Once they're all loaded,
if you {are in,return to} the log view, the last commit is selected.

This was a great suggestion btw, it's a huge boon for large repos!

diff /home/mark/src/got
commit - df68a56be62fb658f8307fc5321e12b7b9fce746
path + /home/mark/src/got
blob - 031ac318e747e847486fee09904105717f3d1a39
file + tog/tog.c
--- tog/tog.c
+++ tog/tog.c
@@ -3179,7 +3179,7 @@ log_move_cursor_down(struct tog_view *view, int page)
 			++s->selected;
 		else
 			err = log_scroll_down(view, 1);
-	} else if (s->thread_args.load_all) {
+	} else if (s->thread_args.load_all && s->thread_args.log_complete) {
 		struct commit_queue_entry *entry;
 		int n;
 
@@ -3311,7 +3311,8 @@ input_log_view(struct tog_view **new_view, struct tog_
 			err = log_move_cursor_down(view, s->commits.ncommits);
 			s->thread_args.load_all = 0;
 		}
-		return err;
+		if (err)
+			return err;
 	}
 
 	eos = nscroll = view->nlines - 1;

-- 
Mark Jamsek <fnc.bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68