* [PATCH] string-list.[ch]: remove string_list_init() compatibility function
@ 2021-09-28 12:49 Ævar Arnfjörð Bjarmason
2021-09-28 18:00 ` Jeff King
2021-09-28 21:43 ` Junio C Hamano
0 siblings, 2 replies; 3+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-09-28 12:49 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Jeff King, Ævar Arnfjörð Bjarmason
Remove this function left over to accommodate in-flight changes, see
770fedaf9fb (string-list.[ch]: add a string_list_init_{nodup,dup}(),
2021-07-01) for the recent change to add
"string_list_init_{nodup,dup}()" initializers.
There was only one user of the API left in remote-curl.c. I don't know
why I didn't include this change to remote-curl.c in
bc40dfb10a0 (string-list.h users: change to use *_{nodup,dup}(),
2021-07-01), perhaps I just missed it.
In any case, let's change that one user to use the new API, as of
writing this there are no in-flight changes that use, so this seems
like a good time to drop this before we get any new users of this
compatibility API.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
remote-curl.c | 4 ++--
string-list.c | 8 --------
string-list.h | 5 -----
3 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/remote-curl.c b/remote-curl.c
index 598cff7cde6..3f5688e4262 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -1478,8 +1478,8 @@ int cmd_main(int argc, const char **argv)
options.verbosity = 1;
options.progress = !!isatty(2);
options.thin = 1;
- string_list_init(&options.deepen_not, 1);
- string_list_init(&options.push_options, 1);
+ string_list_init_dup(&options.deepen_not);
+ string_list_init_dup(&options.push_options);
/*
* Just report "remote-curl" here (folding all the various aliases
diff --git a/string-list.c b/string-list.c
index 43576ad1265..549fc416d68 100644
--- a/string-list.c
+++ b/string-list.c
@@ -13,14 +13,6 @@ void string_list_init_dup(struct string_list *list)
memcpy(list, &blank, sizeof(*list));
}
-void string_list_init(struct string_list *list, int strdup_strings)
-{
- if (strdup_strings)
- string_list_init_dup(list);
- else
- string_list_init_nodup(list);
-}
-
/* if there is no exact match, point to the index where the entry could be
* inserted */
static int get_entry_index(const struct string_list *list, const char *string,
diff --git a/string-list.h b/string-list.h
index 0d6b4692396..267d6e5769d 100644
--- a/string-list.h
+++ b/string-list.h
@@ -104,11 +104,6 @@ struct string_list {
void string_list_init_nodup(struct string_list *list);
void string_list_init_dup(struct string_list *list);
-/**
- * TODO remove: For compatibility with any in-flight older API users
- */
-void string_list_init(struct string_list *list, int strdup_strings);
-
/** Callback function type for for_each_string_list */
typedef int (*string_list_each_func_t)(struct string_list_item *, void *);
--
2.33.0.1340.ge9f77250f2b
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] string-list.[ch]: remove string_list_init() compatibility function
2021-09-28 12:49 [PATCH] string-list.[ch]: remove string_list_init() compatibility function Ævar Arnfjörð Bjarmason
@ 2021-09-28 18:00 ` Jeff King
2021-09-28 21:43 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Jeff King @ 2021-09-28 18:00 UTC (permalink / raw)
To: Ævar Arnfjörð Bjarmason; +Cc: git, Junio C Hamano
On Tue, Sep 28, 2021 at 02:49:45PM +0200, Ævar Arnfjörð Bjarmason wrote:
> Remove this function left over to accommodate in-flight changes, see
> 770fedaf9fb (string-list.[ch]: add a string_list_init_{nodup,dup}(),
> 2021-07-01) for the recent change to add
> "string_list_init_{nodup,dup}()" initializers.
>
> There was only one user of the API left in remote-curl.c. I don't know
> why I didn't include this change to remote-curl.c in
> bc40dfb10a0 (string-list.h users: change to use *_{nodup,dup}(),
> 2021-07-01), perhaps I just missed it.
Yeah, both calls definitely existed then. I agree it was probably just
missed (at least there is no obvious reason not to have included it
then).
> In any case, let's change that one user to use the new API, as of
> writing this there are no in-flight changes that use, so this seems
> like a good time to drop this before we get any new users of this
> compatibility API.
Yeah, this seems like a good idea. The patch itself is as advertised.
-Peff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] string-list.[ch]: remove string_list_init() compatibility function
2021-09-28 12:49 [PATCH] string-list.[ch]: remove string_list_init() compatibility function Ævar Arnfjörð Bjarmason
2021-09-28 18:00 ` Jeff King
@ 2021-09-28 21:43 ` Junio C Hamano
1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2021-09-28 21:43 UTC (permalink / raw)
To: Ævar Arnfjörð Bjarmason; +Cc: git, Jeff King
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> Remove this function left over to accommodate in-flight changes, see
> 770fedaf9fb (string-list.[ch]: add a string_list_init_{nodup,dup}(),
> 2021-07-01) for the recent change to add
> "string_list_init_{nodup,dup}()" initializers.
>
> There was only one user of the API left in remote-curl.c. I don't know
> why I didn't include this change to remote-curl.c in
> bc40dfb10a0 (string-list.h users: change to use *_{nodup,dup}(),
> 2021-07-01), perhaps I just missed it.
>
> In any case, let's change that one user to use the new API, as of
> writing this there are no in-flight changes that use, so this seems
> like a good time to drop this before we get any new users of this
> compatibility API.
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-28 21:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28 12:49 [PATCH] string-list.[ch]: remove string_list_init() compatibility function Ævar Arnfjörð Bjarmason
2021-09-28 18:00 ` Jeff King
2021-09-28 21:43 ` Junio C Hamano
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.