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

[PATCH 2/5] format_trailer_info(): drop redundant unfold_value()

From
LGLinus Arver via GitGitGadget <gitgitgadget@gmail.com>
Date
Mar 15, 2024, 06:55 UTC
Message-ID
<5f9e444197468d065264b85c8cf7434df0e08070.1710485706.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1694.git.1710485706.gitgitgadget@gmail.com>
From: Linus Arver <linusa@google.com>
This is another preparatory refactor to unify the trailer formatters.

In the last patch we made format_trailer_info() use trailer_item objects instead of the "trailers" string array. This means that the call to unfold_value() here is redundant because the trailer_item objects are already unfolded in parse_trailers() which is a dependency of our caller, format_trailers_from_commit().

Remove the redundant call.
Signed-off-by: Linus Arver <linusa@google.com>
---
 trailer.c | 3 ---
 1 file changed, 3 deletions(-)
diff --git a/trailer.c b/trailer.c
index a74f05db55c..2c0dd8ac829 100644
--- a/trailer.c
+++ b/trailer.c
@@ -1101,9 +1101,6 @@ static void format_trailer_info(const struct process_trailer_options *opts,
 			strbuf_addstr(&val, item->value);
 
 			if (!opts->filter || opts->filter(&tok, opts->filter_data)) {
-				if (opts->unfold)
-					unfold_value(&val);
-
 				if (opts->separator && out->len != origlen)
 					strbuf_addbuf(out, opts->separator);
 				if (!opts->value_only)
-- 
gitgitgadget
Previous: Linus Arver via GitGitGadgetNext: Linus Arver via GitGitGadget
Message 3 of 16 in “Unify trailer formatting functions”
  1. 0/5 Unify trailer formatting functionsLinus Arver via GitGitGadget, Mar 15, 2024
  2. 1/5 format_trailer_info(): use trailer_item objectsLinus Arver via GitGitGadget, Mar 15, 2024
  3. 2/5 format_trailer_info(): drop redundant unfold_value()Linus Arver via GitGitGadget, Mar 15, 2024
  4. 3/5 format_trailer_info(): append newline for non-trailer linesLinus Arver via GitGitGadget, Mar 15, 2024
  5. Junio C HamanoMar 15, 2024
  6. 4/5 trailer: begin formatting unificationLinus Arver via GitGitGadget, Mar 15, 2024
  7. 5/5 trailer: finish formatting unificationLinus Arver via GitGitGadget, Mar 15, 2024
  8. Junio C HamanoMar 15, 2024
  9. Kristoffer HaugsbakkMar 15, 2024
  10. Junio C HamanoMar 15, 2024
  11. Linus ArverMar 15, 2024
  12. Junio C HamanoMar 15, 2024
  13. Johannes SchindelinJul 2, 2024
  14. Junio C HamanoMar 26, 2024
  15. Linus ArverApr 2, 2024
  16. Junio C HamanoApr 15, 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.