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

Re: [BUG] You can't have single quote in your username

From
Jeff King <peff@peff.net>
Date
Sep 2, 2019, 15:47 UTC
Message-ID
<20190902154732.GD18593@sigill.intra.peff.net>
In-Reply-To
<20190831131748.GA13001@instance-1.europe-west6-a.c.vaulted-journal-250706.internal>
On Sat, Aug 31, 2019 at 01:17:48PM +0000, Giuseppe Crinò wrote:
Show 19 quoted lines
> On Mon, Aug 26, 2019 at 03:14:55PM -0400, Jeff King wrote:
> > We'd still want to keep the low-level removal of "<>\n", since those are
> > syntactically significant to Git (i.e., if they sneak in you end up with
> > a broken commit object).
> 
> Would it work to change `strbuf_addstr_without_crud()` such that instead of
> removing crud from the beginning and *then* crud from the end, it removes crud
> as long as it's palindromic? Then the function proceeds to remove "<>\n" from
> the string as before.
> 
> That would implement the following _mappings_:
> 
> 'Foo bar' => Foo bar
> Micheal Jr. => Micheal Jr.
> Mr. McDonalds => Mr. McDonalds
> "John Baz" => John Baz
> "JJ\x0a" => JJ
> 
> What do you think?

I think we don't have enough data to really know how much it will help or hurt. :)

On the plus side, it is less risky than dropping the end-point crud removal entirely.

But it still risks losing a case where some code path relies on the crud cleanup for odd cases (mismatched delimiters, or interleaved delimiters, or non-delimiter crud mixed in with delimiters).

On the one hand, I am actually OK with dropping the crud removal entirely and seeing what happens, and this is a lesser form of that. On the other hand, it puts us in a funny in-between situation where tools can _usually_ get away without cleaning up the names, but occasionally get bit. It might be easier to just say that we don't do cleanup.

So I dunno. There is no patch to be discussed, and I am not volunteering to write one. So I think whoever chooses to do so has a lot of control over what is proposed. :)

-Peff
Previous: Giuseppe CrinòNext: Junio C Hamano
Message 21 of 26 in “[BUG] You can't have single quote in your username”
  1. Giuseppe CrinòAug 22, 2019
  2. Pratyush YadavAug 22, 2019
  3. Junio C HamanoAug 22, 2019
  4. Giuseppe CrinòAug 23, 2019
  5. Michal SuchánekAug 23, 2019
  6. René ScharfeAug 22, 2019
  7. Bryan TurnerAug 22, 2019
  8. Emily ShafferAug 22, 2019
  9. Pratyush YadavAug 22, 2019
  10. SZEDER GáborAug 23, 2019
  11. Giuseppe CrinòAug 23, 2019
  12. SZEDER GáborAug 23, 2019
  13. Giuseppe CrinòAug 24, 2019
  14. Giuseppe CrinòAug 25, 2019
  15. Jeff KingAug 26, 2019
  16. Giuseppe Crino'Aug 27, 2019
  17. Michal SuchánekAug 27, 2019
  18. Giuseppe Crino'Aug 28, 2019
  19. Jeff KingAug 28, 2019
  20. Giuseppe CrinòAug 31, 2019
  21. Jeff KingSep 2, 2019
  22. Junio C HamanoSep 2, 2019
  23. Michal SuchánekSep 2, 2019
  24. Giuseppe CrinòSep 3, 2019
  25. Michal SuchánekSep 3, 2019
  26. SZEDER GáborAug 23, 2019

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.