Harald Nordgren sent a patch for the hint that 'git config' prints when given a single '<key>=<value>' argument whose value contains spaces. The suggested 'git config set' command, pasted into a shell, splits the value into two arguments and fails with 'wrong number of arguments'. The patch quotes the value when needed and puts the command on its own line, as other hints do.
Phillip Wood called the change very sensible. He asked that the tests also check that the key is quoted when needed. He was confused about post-processing the output of sq_quote_buf_pretty(). That function is meant to produce shell-quoted values for human consumption, he wrote, so if its output is not pretty enough it should be fixed for all callers rather than worked around. He added that the patch's post-processing removes the csh support the current output has.
Phillip also described how the helper could cater to other shells. Ideally it would take the current shell into account and emit different output for PowerShell or cmd.exe. For fish users, which he is, always backslash-escaping backslashes would make the output work in fish as well as POSIX shells and csh. A prettier option would be to escape only backslashes followed by a backslash or single quote. He said broader shell support need not hold up the patch.
Ben Knoble copied Nahid Hasan Sagor, who sent a similar patch for 'git push' suggestions. He asked whether the patches should assume a POSIX-like shell and whether they work on Windows, noting that Git for Windows ships a Bash environment. He suggested centralizing automatic quoting for suggested commands, and later said advice emitters must still remember to call the helper. He agreed this need not block either patch.
Junio Hamano said that although he invented the sq_quote() family, he did not know the sq_quote_buf_pretty() class could be changed without worrying about machine readability and output stability. The documentation says these helpers are for human-readable output only. He suggested making that note more prominent and observed that sq_dequote()'s limits matter less once output targets the user's shell.
The patch is still at v1. Whether the quoting fix should live in sq_quote_buf_pretty() or in callers remains open.