sq_quote_buf_pretty() produces shell-quoted output meant for human readers. Phillip Wood's RFC says it quotes multibyte strings and strings containing '~', '{' or '}' more than necessary. It also adds empty quote pairs when a string starts or ends with a single quote. The patch replaces the reuse of sq_quote_buf() with a dedicated routine. Tilde would be quoted only as the first character. Braces would be quoted only when opening and closing braces are unbalanced, or when they contain a comma or a character that needs quoting.

Nahid hasan Sagor said he might be misreading it, but a leading '~' appears to be lost after the 'p++' and never copied by strbuf_add(), so '~foo' would come out as 'foo' in quotes. Junio Hamano agreed that the leading tilde is lost.

Junio had several other findings. Bash, zsh and ksh93 expand sequence expressions such as '{1..5}' without a comma, and because '.' is not treated as needing quotes the function leaves '{1..5}' unquoted, so pasting it into those shells yields five arguments. He also noted that these shells expand a tilde that is not at the start of a word when the whole thing looks like a variable assignment, as in 'P=A:~/B:C', and asked whether that corner case should be handled.

In the brace-handling path, quote_it stays true after a backslash-escaped character, so an empty segment can be emitted inside a pair of single quotes. He gave '{a'!b}' and a string ending in an unclosed brace as examples, and pointed to the same problem after the loop. He suggested a short helper or macro that emits a quoted segment only when it is non-empty. He also noted that the commit message should say the special characters are a single quote or an exclamation point, as the 'danger!' entry in Phillip's table shows.

Phillip has not yet answered these specific points in the excerpts; the thread shows a further copy of the patch. A revised version is the likely next step.