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

From:
Martin Pieuchot <mpi@openbsd.org>
Subject:
Re: tog(1) log by default++
To:
gameoftrees@openbsd.org
Date:
Fri, 28 Feb 2020 15:02:08 +0100

Download raw body.

Thread
On 20/02/20(Thu) 17:53, Stefan Sperling wrote:
> On Thu, Feb 20, 2020 at 05:24:12PM +0100, Stefan Sperling wrote:
> > Here is a diff that shows how I would implement this if we really want it.
> 
> Note that my patch has one particular problem which cannot be
> easily fixed:
> 
> > +	if (error && error->code != GOT_ERR_CANCELLED) {
> > +		if (is_implicit_log_cmd &&
> > +		    error->code == GOT_ERR_NO_TREE_ENTRY) {
> 
> Here, we don't actually know whether GOT_ERR_NO_TREE_ENTRY was raised
> because the user passed a bad path, or because the library raised this
> error internally somewhere.

Well one could argue that's related to error handling.  If the internals
do not make difference between errors and failures that can be seen as
entropy creation and the tool cannot go back ;)

> I do understand why you want this. But from a maintainer's perspective
> I am not a fan of this hack. This special case introduces side effects
> that are not very straightforward to contain. I'd rather avoid the
> ambiguity and force people to type the command they want to run because
> this makes it easier to provide reasonable behaviour when errors occur.

You call this a hack.  I call this a feature :)  Why should I type more
than necessary?  Aren't tool supposed to make my life easier?