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

Stefan Sperling <stsp@stsp.name>
Re: tog yield commit reverted
Martin Pieuchot <mpi@openbsd.org>
Tue, 4 Feb 2020 12:38:27 +0100

Download raw body.

On Tue, Feb 04, 2020 at 12:04:25PM +0100, Martin Pieuchot wrote:
> That suggests that the "next match" isn't correctly communicated between
> the two threads.  Could you point me to the piece of code responsible for
> that?

There is no explicit signal for this.

The main thread sets 'search_next_done' when it has found a matching commit
in its list of commits.

2080                 err = match_commit(&have_match, entry->id, entry->commit,
2081                     &view->regex);
2082                 if (err)
2083                         break;
2084                 if (have_match) {
2085                         view->search_next_done = 1;

The log thread performs the same matching and simply stops adding more commits
as soon as a match is found, assuming the main thread will eventually see and
match the commit which the log thread has added to the list.

Pressing 'n' unconditionally sets search_next_done to zero, which could be why
'n' triggers a bug?