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

Re: What's cooking in git.git (Jan 2017, #02; Sun, 15)

From
Jeff King <peff@peff.net>
Date
Jan 17, 2017, 07:52 UTC
Message-ID
<20170117075254.h4nnnj2alricotcy@sigill.intra.peff.net>
In-Reply-To
<CA+P7+xqi8cXK8ZEdvy3U9jJ9wZwkGLYNR0j_xvvCJwq12B4G8g@mail.gmail.com>
On Mon, Jan 16, 2017 at 05:33:44PM -0800, Jacob Keller wrote:
Show 8 quoted lines
> > I am certainly sympathetic to the idea that the "?" is ugly and
> > potentially confusing. But I think it's at least a step forward for this
> > particular example.
> 
> Would it be possible to convert the CR to a literal \r printing? Since
> it's pretty common to show these characters as slash-escaped? (Or is
> that too much of a Unix world thing?) I know I'd find \r less
> confusing than '?'
I discussed this in the original commit message.

Yes, it's possible, but it's a little tricky. We want to fprintf() the whole thing as a unit (to increase the chances of it being done in an atomic write()). We don't want to use a dynamic buffer, since we might be called from a signal handler, or when malloc has failed, etc.

So I tried to stick to something that could reliably done in place. We could probably get by with 2 static buffers and copy from one to the other (if stack space is an issue, the current one is 4K, which is probably excessively large anyway).

Mostly I just assumed that it was highly unlikely anybody would see this escaping in the first place. So I tried to go with the simplest solution.

-Peff
Previous: Jacob KellerNext: Junio C Hamano
Message 19 of 28 in “What's cooking in git.git (Jan 2017, #02; Sun, 15)”
  1. Junio C HamanoJan 16, 2017
  2. Johannes SixtJan 16, 2017
  3. Junio C HamanoJan 16, 2017
  4. Johannes SchindelinJan 16, 2017
  5. Jeff KingJan 16, 2017
  6. Johannes SchindelinJan 16, 2017
  7. Johannes SixtJan 16, 2017
  8. Jeff KingJan 16, 2017
  9. Junio C HamanoJan 17, 2017
  10. Johannes SixtJan 18, 2017
  11. Junio C HamanoJan 18, 2017
  12. Johannes SchindelinJan 19, 2017
  13. Jeff KingJan 16, 2017
  14. CodingGuidelines: clarify multi-line brace styleJeff King, Jan 16, 2017
  15. Junio C HamanoJan 17, 2017
  16. Jeff KingJan 17, 2017
  17. Junio C HamanoJan 17, 2017
  18. Jacob KellerJan 17, 2017
  19. Jeff KingJan 17, 2017
  20. Junio C HamanoJan 17, 2017
  21. Jeff KingJan 17, 2017
  22. Junio C HamanoJan 17, 2017
  23. Jeff KingJan 17, 2017
  24. Johannes SchindelinJan 16, 2017
  25. Junio C HamanoJan 17, 2017
  26. Johannes SchindelinJan 18, 2017
  27. Johannes SchindelinJan 16, 2017
  28. 4/4 unpack-trees: support super-prefix optionStefan Beller, Jan 18, 2017

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.