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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: got add recursion ignore ignores
To:
Tracey Emery <tracey@traceyemery.net>
Cc:
gameoftrees@openbsd.org
Date:
Thu, 5 Dec 2019 18:57:12 +0100

Download raw body.

Thread
On Thu, Dec 05, 2019 at 10:22:43AM -0700, Tracey Emery wrote:
> Hello,
> 
> The diff below adds -I to disregard ignores. Adding flags to the
> got_worktree struct seemed like the simplest approach. If there is a
> better alternative, let me know what you think.

Would it work to add a new 'int' argument to worktree_status() instead?
It seems no_ignores could be passed from got_worktree_schedule_add()
to worktree_status(). All other callers of worktree_status() would pass 0.

Adding this information to a new flags field in struct got_worktree
essentially creates a global variable. I'd prefer to pass arguments so
that it becomes easier to see where the values get used further down
the call chain. And should use of the variable change later, auditing for
unused function arguments is easier than auditing for unnecessary checks
of a global flag.