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

Re: [PATCH v6 2/4] trailer: move process_trailers to trailer.h

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 5, 2025, 17:38 UTC
Message-ID
<xmqqv7jol6qb.fsf@gitster.g>
In-Reply-To
<20251105142944.73061-3-me@linux.beauty>
Li Chen <me@linux.beauty> writes:
> From: Li Chen <chenl311@chinatelecom.cn>
>
> This function would be used by trailer_process
> in following commits.

Please make sure that the body is understandable without the title of the commit. Are you going to use process_trailers() from trailer_process()? Can the pair be named less confusingly?

> Subject: Re: [PATCH v6 2/4] trailer: move process_trailers to trailer.h

Declaring a helper that used to be a file-scope static to a public header file is better described as "make process_trailers() public".

Show 8 quoted lines
> diff --git a/trailer.h b/trailer.h
> index 4740549586..44d406b763 100644
> --- a/trailer.h
> +++ b/trailer.h
> @@ -202,4 +202,7 @@ void trailer_iterator_release(struct trailer_iterator *iter);
>   */
>  int amend_file_with_trailers(const char *path, const struct strvec *trailer_args);
>  

Befero the function, instruct potential future callers what this function is about, what parameters it expects, and what side effect it makes. As pointed out in the previous step, "sb" definitely has to be renamed if this becomes public.

> +void process_trailers(const struct process_trailer_options *opts,
> +		      struct list_head *new_trailer_head,
> +		      struct strbuf *sb, struct strbuf *out);
>  #endif /* TRAILER_H */
Previous: Li ChenNext: Li Chen
Message 9 of 24 in “rebase: support --trailer”
  1. 0/4 rebase: support --trailerLi Chen, Nov 5, 2025
  2. 1/4 interpret-trailers: factor out buffer-based processing to process_trailers()Li Chen, Nov 5, 2025
  3. Junio C HamanoNov 5, 2025
  4. Phillip WoodNov 10, 2025
  5. Li ChenNov 10, 2025
  6. Junio C HamanoNov 10, 2025
  7. Li ChenNov 10, 2025
  8. 2/4 trailer: move process_trailers to trailer.hLi Chen, Nov 5, 2025
  9. Junio C HamanoNov 5, 2025
  10. 3/4 trailer: append trailers in-process and drop the fork to `interpret-trailers`Li Chen, Nov 5, 2025
  11. Junio C HamanoNov 5, 2025
  12. Li ChenNov 10, 2025
  13. Phillip WoodNov 10, 2025
  14. Li ChenNov 10, 2025
  15. Li ChenFeb 24, 2026
  16. Phillip WoodNov 11, 2025
  17. 4/4 rebase: support --trailerLi Chen, Nov 5, 2025
  18. Phillip WoodNov 12, 2025
  19. Kristoffer HaugsbakkNov 24, 2025
  20. Junio C HamanoJan 20, 2026
  21. Junio C HamanoNov 5, 2025
  22. Li ChenNov 10, 2025
  23. Phillip WoodNov 12, 2025
  24. Li ChenNov 17, 2025

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.