From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id B0F8E1F51C for ; Mon, 21 May 2018 02:39:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752698AbeEUCjQ (ORCPT ); Sun, 20 May 2018 22:39:16 -0400 Received: from cloud.peff.net ([104.130.231.41]:47440 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752680AbeEUCjQ (ORCPT ); Sun, 20 May 2018 22:39:16 -0400 Received: (qmail 14452 invoked by uid 109); 21 May 2018 02:39:16 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Mon, 21 May 2018 02:39:16 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 25346 invoked by uid 111); 21 May 2018 02:39:23 -0000 Received: from sigill.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.7) by peff.net (qpsmtpd/0.94) with (ECDHE-RSA-AES256-GCM-SHA384 encrypted) SMTP; Sun, 20 May 2018 22:39:23 -0400 Authentication-Results: peff.net; auth=none Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Sun, 20 May 2018 19:39:14 -0700 Date: Sun, 20 May 2018 19:39:14 -0700 From: Jeff King To: Junio C Hamano Cc: Jacob Keller , Martin =?utf-8?B?w4VncmVu?= , Git mailing list , Elijah Newren , Ben Peart , Phillip Wood , Johannes Schindelin Subject: Re: Re*: [PATCH v4 3/4] string-list: provide `string_list_appendf()` Message-ID: <20180521023913.GB16236@sigill.intra.peff.net> References: <77b025bb47869478e3eef1c3c34d379164f5d91c.1526810549.git.martin.agren@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, May 21, 2018 at 09:25:01AM +0900, Junio C Hamano wrote: > Junio C Hamano writes: > > > I have a feeling that argv_array might be a better fit for the > > purpose of keeping track of to_free[] strings in the context of this > > series. Moving away from string_list would allow us to sidestep the > > storage ownership issues the API has, and we do not need the .util > > thing string_list gives us (which is one distinct advantage string_list > > has over argv_array, if the application needs that feature). > > > > We would need to make _pushf() and friends return "const char *" if > > we go that route to make the resulting API more useful, though. > > ... and redoing the 4/4 patch using argv_array_pushf() makes the > result look like this, which does not look too bad. Agreed. -Peff