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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: improve got log cancellation behaviour
To:
Christian Weisgerber <naddy@mips.inka.de>
Cc:
gameoftrees@openbsd.org
Date:
Sun, 8 Aug 2021 10:57:05 +0200

Download raw body.

Thread
On Sat, Aug 07, 2021 at 09:58:35PM +0200, Christian Weisgerber wrote:
> Stefan Sperling:
> 
> > Once 'got log' starts printing such a long message it won't stop
> > until everything has been printed, even when the user tries to
> > abort the process with Ctrl-C. This patch fixes this issue.
> 
> ok naddy@
> 
> This whole catch-sigint-and-check-later architecture is a bit weird.
> Can't we just die when we receive SIGINT?  What resources are we
> holding?

None in this case. But we need it catch SIGINT to cleanly cancel
operations which modify the repository or a work tree. And having
different approaches for read vs. write operations would be complicated.

> Your patch also reduces the output encountered when aborting a
> "got log -R" in a repository with a lot of history (OpenBSD src.git),
> but the behavior is still odd.  got is sitting there, I ^C it, and
> only _then_ does it print a random commit message before exiting.

This could probably be fixed by adding more cancellation points
into loops in the print_commits() function?