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

Re: [PATCH 4/6] log: do not set up extra_headers for non-email formats

From
Kristoffer Haugsbakk <code@khaugsbakk.name>
Date
Mar 22, 2024, 22:04 UTC
Message-ID
<ad20990e-1328-458a-a142-7d2d93bda170@app.fastmail.com>
In-Reply-To
<20240320003139.GD904136@coredump.intra.peff.net>
On Wed, Mar 20, 2024, at 01:31, Jeff King wrote:
Show 11 quoted lines
> The commit pretty-printer code has an "after_subject" parameter which it
> uses to insert extra headers into the email format. In show_log() we set
> this by calling log_write_email_headers() if we are using an email
> format, but otherwise default the variable to the rev_info.extra_headers
> variable.
>
> Since the pretty-printer code will ignore after_subject unless we are
> using an email format, this default is pointless. We can just set
> after_subject directly, eliminating an extra variable.
>
> Signed-off-by: Jeff King <peff@peff.net>

Good. I did feel like the code was kind of daisy-chaining assignments for no obvious reason.

> ---
> This one is enabled by the previous commits. And after this now both
> callers of log_write_email_headers() directly pass in "after_subject",
> which makes the next steps easy.
Yep, these changes are being done in a nice progression.
-- 
Kristoffer Haugsbakk
Previous: Jeff KingNext: Jeff King
Message 22 of 34 in “format-patch: teach `--header-cmd`”
  1. 0/3 format-patch: teach `--header-cmd`Kristoffer Haugsbakk, Mar 7, 2024
  2. 1/3 log-tree: take ownership of pointerKristoffer Haugsbakk, Mar 7, 2024
  3. Jeff KingMar 12, 2024
  4. Kristoffer HaugsbakkMar 12, 2024
  5. Jeff KingMar 13, 2024
  6. Kristoffer HaugsbakkMar 13, 2024
  7. 2/3 format-patch: teach `--header-cmd`Kristoffer Haugsbakk, Mar 7, 2024
  8. Kristoffer HaugsbakkMar 8, 2024
  9. Jean-Noël AvilaMar 11, 2024
  10. Kristoffer HaugsbakkMar 12, 2024
  11. 3/3 format-patch: check if header output looks validKristoffer Haugsbakk, Mar 7, 2024
  12. 0/3 format-patch: teach `--header-cmd`Kristoffer Haugsbakk, Mar 19, 2024
  13. 1/3 revision: add a per-email field to rev-infoKristoffer Haugsbakk, Mar 19, 2024
  14. Jeff KingMar 19, 2024
  15. Kristoffer HaugsbakkMar 19, 2024
  16. Jeff KingMar 20, 2024
  17. 1/6 shortlog: stop setting pp.print_email_subjectJeff King, Mar 20, 2024
  18. 2/6 pretty: split oneline and email subject printingJeff King, Mar 20, 2024
  19. Kristoffer HaugsbakkMar 22, 2024
  20. 3/6 pretty: drop print_email_subject flagJeff King, Mar 20, 2024
  21. 4/6 log: do not set up extra_headers for non-email formatsJeff King, Mar 20, 2024
  22. Kristoffer HaugsbakkMar 22, 2024
  23. 5/6 format-patch: return an allocated string from log_write_email_headers()Jeff King, Mar 20, 2024
  24. Kristoffer HaugsbakkMar 22, 2024
  25. 6/6 format-patch: simplify after-subject MIME header handlingJeff King, Mar 20, 2024
  26. Kristoffer HaugsbakkMar 22, 2024
  27. Jeff KingMar 20, 2024
  28. Kristoffer HaugsbakkMar 22, 2024
  29. 7/6 format-patch: fix leak of empty header stringJeff King, Mar 22, 2024
  30. Kristoffer HaugsbakkMar 22, 2024
  31. Junio C HamanoMar 22, 2024
  32. Kristoffer HaugsbakkMar 22, 2024
  33. 2/3 format-patch: teach `--header-cmd`Kristoffer Haugsbakk, Mar 19, 2024
  34. 3/3 format-patch: check if header output looks validKristoffer Haugsbakk, Mar 19, 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.