Re: [PATCH 2/5] sequencer: start removing private fields from public API
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 18, 2024, 20:42 UTC
- Message-ID
- <xmqqa5lqs8r7.fsf@gitster.g>
- In-Reply-To
- <2beedb4547013629a507d646d582ca6b3f420c2c.1713445918.git.phillip.wood@dunelm.org.uk>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 12 quoted lines
> +/*
> + * A 'struct replay_ctx' represents the private state of the sequencer.
> + */
> +struct replay_ctx {
> + /*
> + * Stores the reflog message that will be used when creating a
> + * commit. Points to a static buffer and should not be free()'d.
> + */
> + const char *reflog_message;
> +};
> +
> +struct replay_ctx* replay_ctx_new(void)Style.
Also if you intend to make the structure opaque and private, shouldn't you make this static to make it truly internal? The initializer of the containing replay_opts structure would be the only thing that needs to know how to instantiate it, no? Or does a replay_ctx has reason to exist outside the context of an instance of replay_opts?
i.e.
static struct replay_ctx *replay_ctx_new(void)
The remainder seem mechanical so I'll skip them.