Re: [PATCH 2/5] builtin/config.c: support `--type=<type>` as preferred alias for `--type`
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Apr 26, 2018, 06:00 UTC
- Message-ID
- <20180426060023.GA39448@syl.local>
- In-Reply-To
- <xmqq7eou35ev.fsf@gitster-ct.c.googlers.com>
On Thu, Apr 26, 2018 at 02:25:44PM +0900, Junio C Hamano wrote:
Show 6 quoted lines
> Taylor Blau <me@ttaylorr.com> writes: > > > Subject: Re: [PATCH 2/5] builtin/config.c: support `--type=<type>` as preferred alias for `--type` > > I'd retitle while queuing, as the last 'type' is a placeholder for > concrete types like <type> above.
Good idea. I amended v2 in this fashion.
Show 12 quoted lines
> > +...
> > + new_type = opt->defval;
> > + if (!new_type) {
> > +...
> > + }
> > +
> > + *to_type = opt->value;
>
> But this is wrong, no? You meant opt->value points at an integer
> variable that receives the type we discover by parsing, i.e.
>
> to_type = opt->value;Oof. You're absolutely right. I fixed this and moved the assignment to the declaration at the top of this function.
Thanks, Taylor