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

Re: Stupid quoting...

From
Jeff King <peff@peff.net>
Date
Jun 24, 2007, 12:41 UTC
Message-ID
<20070624124125.GA18803@coredump.intra.peff.net>
In-Reply-To
<7vsl8htuin.fsf@assigned-by-dhcp.cox.net>
On Sun, Jun 24, 2007 at 05:19:12AM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> > ASCII-armoring of what amounts to binary files is the task of the mail
> > software.  Also working with encodings.  Escaping characters in the
> > diff headers but not in the file contents is not going to achieve
> > anything useful, anyway.
> 
> You misunderstood me.  The issue is not about transmitting
> without corruption.  Armoring would make it impossible to
> COMMENTING on the patch INLINE.
> 
> And that is where the pathname quoting git diff does originally
> comes from.
Then how about quoted-printable?

The point is that you're _already_ screwed by the fact that there can be up to three different encodings in a patch (commit message, pathnames, and file contents) but we only know one of them (the commit message). With the other two, trying to convert encodings is pointless, since we don't know the starting point. So we can either output them as-is as binary, or use some sort of quoting mechanism.

The quoting that happens now is:
  - sometimes unnecessary, and hurts people who are _not_ sending the
    diff through the mail
  - not recognized by any widely-used un-quoter. I can't comment on your
    diff very well if it changes the file "\a/f\303\263\303\266", and
    there's no viewer that will let me read that in a sane way.
    I think David's point is that by doing the quoting at the MIME
    level (using 8bit, or 7bit with QP), the recipient's MUA can at
    least show the binary characters.  Sure, that will totally break if
    you are using a bad mismatch of encodings, but there's nothing we
    can do to fix that, not knowing what the encodings are. At least it
    _will_ work in the case that your encodings are the same.

The only argument I see _for_ the current quoting is for parsing by non-mail programs (like patch or git-apply); in that case, it would seem only necessary only to quote tab, newline, backslash, and double quote. But at least those retain their human-readability.

-Peff
Previous: Junio C HamanoNext: Jan Hudec
Message 30 of 35 in “Stupid quoting...”
  1. David KastrupJun 13, 2007
  2. Alex RiesenJun 13, 2007
  3. Johannes SchindelinJun 13, 2007
  4. Steven GrimmJun 14, 2007
  5. Johannes SchindelinJun 14, 2007
  6. Steven GrimmJun 14, 2007
  7. Johannes SchindelinJun 14, 2007
  8. Junio C HamanoJun 14, 2007
  9. Jakub NarebskiJun 16, 2007
  10. David KastrupJun 18, 2007
  11. Jeff KingJun 18, 2007
  12. Johannes SchindelinJun 19, 2007
  13. David KastrupJun 19, 2007
  14. Johannes SchindelinJun 19, 2007
  15. Olivier GalibertJun 19, 2007
  16. Johannes SchindelinJun 14, 2007
  17. David KastrupJun 14, 2007
  18. Alex RiesenJun 14, 2007
  19. Alex RiesenJun 14, 2007
  20. Johannes SchindelinJun 20, 2007
  21. Junio C HamanoJun 20, 2007
  22. David KastrupJun 20, 2007
  23. Jakub NarebskiJun 20, 2007
  24. David KastrupJun 20, 2007
  25. Jan HudecJun 24, 2007
  26. Robin RosenbergJun 24, 2007
  27. Junio C HamanoJun 24, 2007
  28. David KastrupJun 24, 2007
  29. Junio C HamanoJun 24, 2007
  30. Jeff KingJun 24, 2007
  31. Jan HudecJun 24, 2007
  32. Robin RosenbergJun 24, 2007
  33. David KastrupJun 24, 2007
  34. Robin RosenbergJun 24, 2007
  35. David KastrupJun 24, 2007

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.