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

Re: [PATCH] format-patch: fix ignored encode_email_headers for cover letter

From
Jeff King <peff@peff.net>
Date
Nov 10, 2023, 21:48 UTC
Message-ID
<20231110214859.GE2758295@coredump.intra.peff.net>
In-Reply-To
<VTz8XT3MCqWUh1HFQon62NxmGJiYFfNmBeWTtR8MwmeuaSkovfBJ02P-S79GsD94XwlxlrL6W80YZ8OwfpDd1BqA0E4GwFQlDKN5DWq0Qtg=@emersion.fr>
On Fri, Nov 10, 2023 at 10:36:22AM +0000, Simon Ser wrote:
Show 6 quoted lines
> > I don't think that answering those questions needs to hold up your
> > patch. We can take it as a quick fix for a real bug, and then anybody
> > interested can dig further as a separate topic on top.
> 
> These are good questions indeed. Unfortunately I don't hink I'll have time to
> work on this though.
That's OK. I think it's fine to stop here for now.
Show 15 quoted lines
> > Some of these long lines (and the in-string newlines!) make this ugly
> > and hard to read. But it is also just copying the already-ugly style of
> > nearby tests. So I'm OK with that. But a prettier version might be:
> > 
> >   test_expect_success 'cover letter respects --encode-email-headers' '
> >         test_config branch.rebuild-1.description "Café?" &&
> >         git checkout rebuild-1 &&
> >         git format-patch --stdout --encode-email-headers \
> >                 --cover-letter --cover-from-description=subject \
> >                 main >actual &&
> >         ...
> >   '
> 
> Yeah, that sounds better indeed. Let me know if you want me to resend a cleaner
> version of the test.
I don't have a strong opinion, so I'd leave it up to you.
Show 10 quoted lines
> > I also wondered if we could be just be testing this much more easily
> > with another header like "--to". But I guess that would be found in both
> > the cover letter and the actual patches (we also don't seem to encode
> > it even in the regular patches; is that a bug?).
> 
> That sounds like another bug indeed… But maybe that'll be harder to fix. To
> Q-encode this field one needs to split off the full name and actual mail
> address ("André <andre@example.org>" would be split into "André" and
> "andre@example.org"), then Q-encode the full name, then join the strings
> together again. In particular, it's incorrect to Q-encode the full string.

Yeah, without even looking at the code, I had a suspicion that this would be an issue. I doubt that format-patch is doing much parsing at all of what we feed it via --to.

-Peff
Previous: Simon SerNext: René Scharfe
Message 4 of 6 in “format-patch: fix ignored encode_email_headers for cover letter”
  1. format-patch: fix ignored encode_email_headers for cover letterSimon Ser, Nov 9, 2023
  2. Jeff KingNov 9, 2023
  3. Simon SerNov 10, 2023
  4. Jeff KingNov 10, 2023
  5. René ScharfeNov 12, 2023
  6. Jeff KingNov 13, 2023

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.