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?

Reply via email to