From: Christian Couder Date: Tue, 26 Apr 2016 20:13:47 GMT Subject: Re: [PATCH 33/83] builtin/apply: move 'root' global into 'struct apply_state' Message-ID: In-Reply-To: On Mon, Apr 25, 2016 at 11:50 PM, Stefan Beller wrote: > On Sun, Apr 24, 2016 at 6:33 AM, Christian Couder > wrote: > >> @@ -4630,9 +4644,10 @@ static int option_parse_whitespace(const struct option *opt, >> static int option_parse_directory(const struct option *opt, >> const char *arg, int unset) >> { >> - strbuf_reset(&root); >> - strbuf_addstr(&root, arg); >> - strbuf_complete(&root, '/'); >> + struct apply_state *state = opt->value; > > Or even > > struct strbuf root = ((state*)opt->value)->root; > > and then keep the next lines as is? I found it more coherent to have all the option_parse_*() functions do: struct apply_state *state = opt->value; as their first instruction.