git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Phillip WoodNext: Phillip Wood
Message 4 of 10 in “rebase -m: fix --signoff with conflicts”
  1. 0/5 rebase -m: fix --signoff with conflictsPhillip Wood, Apr 18, 2024
  2. 1/5 sequencer: always free "struct replay_opts"Phillip Wood, Apr 18, 2024
  3. 2/5 sequencer: start removing private fields from public APIPhillip Wood, Apr 18, 2024
  4. Junio C HamanoApr 18, 2024
  5. 3/5 sequencer: move current fixups to private contextPhillip Wood, Apr 18, 2024
  6. Junio C HamanoApr 18, 2024
  7. 4/5 sequencer: store commit message in private contextPhillip Wood, Apr 18, 2024
  8. Junio C HamanoApr 18, 2024
  9. 5/5 rebase -m: fix --signoff with conflictsPhillip Wood, Apr 18, 2024
  10. Junio C HamanoApr 18, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.