commit - 93f8a3371abdcbfdc9e411ff44942acb0198ca47
commit + fb280deb15e67b1bd8ef0f722a7430b8e9312871
blob - f19156ff60b8708acea73670fd8fd33b02ae8c31
blob + c79cf3b9c8bf97b4a0385e233df94c3f431f24d0
--- tog/tog.c
+++ tog/tog.c
pthread_cond_t need_commits;
pthread_cond_t commit_loaded;
int commits_needed;
+ int load_all;
struct got_commit_graph *graph;
struct commit_queue *commits;
const char *in_repo_path;
}
switch (ch) {
- case ERR:
- break;
case '\t':
if (view->child) {
view->focussed = 0;
if (s->thread_args.commits_needed == 0)
halfdelay(10); /* disable fast refresh */
- if (s->thread_args.commits_needed > 0) {
+ if (s->thread_args.commits_needed > 0 || s->thread_args.load_all) {
if (asprintf(&ncommits_str, " [%d/%d] %s",
entry ? entry->idx + 1 : 0, s->commits.ncommits,
(view->searching && !view->search_next_done) ?
halfdelay(1); /* fast refresh while loading commits */
- while (ta->commits_needed > 0) {
+ while (ta->commits_needed > 0 || ta->load_all) {
if (ta->log_complete)
break;
return (void *)err;
err = NULL;
done = 1;
- } else if (a->commits_needed > 0)
+ } else if (a->commits_needed > 0 && !a->load_all)
a->commits_needed--;
errcode = pthread_mutex_lock(&tog_mutex);
if (done)
a->commits_needed = 0;
else {
- if (a->commits_needed == 0) {
+ if (a->commits_needed == 0 && !a->load_all) {
errcode = pthread_cond_wait(&a->need_commits,
&tog_mutex);
if (errcode)
int begin_x = 0;
switch (ch) {
+ case ERR: /* no user input from wgetch() */
+ if (s->thread_args.load_all && s->thread_args.log_complete) {
+ s->thread_args.load_all = 0;
+ log_scroll_down(view, s->commits.ncommits);
+ s->selected = MIN(view->nlines - 2,
+ s->commits.ncommits - 1);
+ select_commit(s);
+ }
+ break;
case 'q':
s->quit = 1;
break;
case KEY_END: {
/* We don't know yet how many commits, so we're forced to
* traverse them all. */
- while (1) {
- if (s->thread_args.log_complete)
- break;
-
- s->thread_args.commits_needed++;
- err = trigger_log_thread(view, 1);
- if (err)
- return err;
+ if (!s->thread_args.log_complete) {
+ s->thread_args.load_all = 1;
+ return trigger_log_thread(view, 0);
}
log_scroll_down(view, s->commits.ncommits);
case KEY_BACKSPACE:
case CTRL('l'):
case 'B':
+ if (ch == KEY_BACKSPACE && s->thread_args.load_all) {
+ s->thread_args.load_all = 0;
+ break;
+ }
if (ch == KEY_BACKSPACE &&
got_path_is_root_dir(s->in_repo_path))
break;