Subject: Re: [PATCH 2/8] builtin/multi-pack-index.c: support --stdin-packs mode

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Mon, 13 Sep 2021 00:32:40 +0200

On Sun, Sep 12 2021, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason <[email-masked]> writes:
>
>> Or maybe the whole approch of the string_list API is just a dead-end in
>> API design, i.e. it shouldn't have any "dup" mode, just nodup, if you
>> need something dup'd you xstrdup()-it.
>
> ;-)

I realize in practice that's a bit too much, i.e. it's very useful to be
able to use a string_list to account for a bunch of already-allocated
memory without strduping everything.

It's just unfortunate that you can't look at any code that works with
the API and understand whether it does an implicit xstrdup() or not
without tracking down its current state / where it got allocated at.