Re: [RFC PATCH 1/2] remote: move remote group resolution to remote.c
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 6, 2026, 18:12 UTC
- Message-ID
- <xmqqcy1g25fl.fsf@gitster.g>
- In-Reply-To
- <20260305223248.170785-2-usmanakinyemi202@gmail.com>
Usman Akinyemi <usmanakinyemi202@gmail.com> writes:
Show 17 quoted lines
> diff --git a/remote.h b/remote.h
> index fc052945ee..fa38f951a2 100644
> --- a/remote.h
> +++ b/remote.h
> @@ -347,6 +347,18 @@ int branch_has_merge_config(struct branch *branch);
>
> int branch_merge_matches(struct branch *, int n, const char *);
>
> +/* list of the remote in a group as configured */
> +struct remote_group_data {
> + const char *name;
> + struct string_list *list;
> +};
> +
> +int get_remote_group(const char *key, const char *value,
> + const struct config_context *ctx UNUSED,
> + void *priv);It is dubious to carry UNUESD over to an external declaration in a public header file, unless it is a "static inline" definition that comes with the implementation.
Other than that, move looks correct and it is generally a good idea.
When moving functions and types that have been private to the implementation of a subsystem to public namespace, we need to be careful to consider if the names of these things are specific enough. With "remote_group" in them, they are all good as-is in this case, and can go public without giving them "better" names.
Thanks.