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

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: tog log in shallow Git repositories
To:
Stefan Sperling <stsp@stsp.name>
Cc:
gameoftrees@openbsd.org
Date:
Mon, 11 Jul 2022 12:45:14 +0200

Download raw body.

Thread
Stefan Sperling <stsp@stsp.name> wrote:
> In a Git repository cloned with git clone --depth=1, tog hangs
> on startup and is unresponsive to any input. This requires a
> kill -9 to recover from.
> 
> The patch below fixes this such that 'tog log' displays the same
> error message as 'got log' in such a repository:
> 
> $ got log
> got: open: /tmp/test-got-clone-shallow/.git/objects/23/0e1f1bfa1d7bbd0dee0217e22bc2817e848ad0: No such file or directory
> $ tog
> tog: open: /tmp/test-got-clone-shallow/.git/objects/23/0e1f1bfa1d7bbd0dee0217e22bc2817e848ad0: No such file or directory
> $ 
> 
> To do this properly we need to synchronize start-up of the log thread
> with view_input(), otherwise tog will still hang forever in case the log
> thread executes in parallel, and runs into an error in queue_commits(), and
> exits before we even start waiting for its signal in trigger_log_thread().
> This in turns means that mutex locking/unlocking in the log thread needs
> to be revised.
> 
> Any errors from the log thread need to be propagated up via view_close()
> to become visible when tog closes all active views during exit.
> 
> There is now a global tog_thread_error flag which should cause tog to
> exit and which could also be used to improve error handling for other
> threads in the future.
> 
> ok?

The diff reads fine and it fixes the issue for me too, thanks!

ok op@