Re: [PATCH v2 02/19] parse-options-cb: implement parse_opt_pass_argv_array()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 10, 2015 at 7:16 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Almost the same comment as 01/19 applies to this comment.
>
> I think it makes good sense to have two variants, one that lets the
> last one win and pass only that last one (i.e. 01/19) and the other
> that accumulates them into an argv_array (i.e. this one).  But it
> feels iffy, given that the "acculate" version essentially creates an
> array of (char *), to make "the last one wins, leaving a single
> string" to use strbuf.  I'd find it much more understandable if 01/19
> took (char **) as opt->value instead of a strbuf.

I don't see how it feels iffy. The purpose of using strbufs (and
argv_arrays) is to avoid error-prone manual memory management.

> In any case, these two need to be added as a related pair to the API
> documentation.

Okay, I guess I could also add their macro functions as well.

Thanks,
Paul
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]