Re: [PATCH 09/16] promisor-remote: add 'local_name' to 'struct promisor_info'
On Thu, Mar 26, 2026 at 1:21 PM Patrick Steinhardt <ps@pks.im> wrote:
Show 8 quoted lines
>
> On Mon, Mar 23, 2026 at 09:05:12AM +0100, Christian Couder wrote:
> > In a following commit, we will store promisor remote information under
> > a remote name different than the one the server advertised.
> >
> > To prepare for this change, let's add a new 'char* local_name' member
>
> Micronit: s/char* local_name/char *local_name/
Fixed in the v2 I just sent.
Show 33 quoted lines
> > diff --git a/promisor-remote.c b/promisor-remote.c
> > index bdfc5e7608..da347fa2dc 100644
> > --- a/promisor-remote.c
> > +++ b/promisor-remote.c
> > @@ -434,15 +434,19 @@ static struct string_list *fields_stored(void)
> >
> > /*
> > * Struct for promisor remotes involved in the "promisor-remote"
> > - * protocol capability.
> > + * protocol capability:
> > *
> > - * Except for "name", each <member> in this struct and its <value>
> > - * should correspond (either on the client side or on the server side)
> > - * to a "remote.<name>.<member>" config variable set to <value> where
> > - * "<name>" is a promisor remote name.
> > + * - "name" is the name the server advertised.
> > + * - "local_name" is the name we use locally (may be auto-generated).
> > + *
> > + * Except for "name" and "local_name", each <member> in this struct
> > + * and its <value> should correspond (either on the client side or on
> > + * the server side) to a "remote.<name>.<member>" config variable set
> > + * to <value> where "<name>" is a promisor remote name.
> > */
> > struct promisor_info {
> > const char *name;
> > + const char *local_name;
> > const char *url;
> > const char *filter;
> > const char *token;
>
> I think it would be easier to follow if the struct-level comment applied
> to the general description of the struct, and individual members would
> then have their own comments describing their intent.Right, the diff looks like the following in the v2:
@@ -434,13 +434,14 @@ static struct string_list *fields_stored(void)
* Struct for promisor remotes involved in the "promisor-remote"
* protocol capability.
*
- * Except for "name", each <member> in this struct and its <value>
- * should correspond (either on the client side or on the server side)
- * to a "remote.<name>.<member>" config variable set to <value> where
- * "<name>" is a promisor remote name.
+ * Except for "name" and "local_name", each <member> in this struct
+ * and its <value> should correspond (either on the client side or on
+ * the server side) to a "remote.<name>.<member>" config variable set
+ * to <value> where "<name>" is a promisor remote name.
*/
struct promisor_info {
- const char *name;
+ const char *name; /* name the server advertised */
+ const char *local_name; /* name used locally (may be auto-generated) */
const char *url;
const char *filter;
const char *token;
Thanks.