This regresses on hunks of form "@@ -n +m,l @@" and friends, so
I dropped it for now.
I've applied other three patches but with manual tweaks while I
demangled the linewrap, so please sanity check the result after
it mirrors out. I also noticed that we unconditionally give
blame link in "diff-tree --name-status" part of commitdiff, so
I've fixed it up as well.
I think you still leak control characters in commit messages and
htmlized blob text view; and perhaps others like blame. I have
made quot_cec into a separate sub that is callable from outside
esc_path, so these places should be able to reuse it to make
control characters "visible and safe" and keep the presentation
consistent. The non-path callers would not feed tabs into the
function (I haven't looked at the code but I suspect you would
replace them into runs of spaces to the next tab stop by hand),
but other controls need to be quoted.