Re: [PATCH] Try URI quoting for embedded TAB and LF in pathnames
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:08
Junio C Hamano [off-list ref] writes:
Robert Fitzsimons [off-list ref] writes:quoted
'\t' becomes %09 '\n' becomes %10 '%' becomes %25 Signed-off-by: Robert Fitzsimons <redacted>This would break existing setup where people *has* per-cent letter in their pathname -- which I think is worse than the backslash proposal.
Having said that, I think something along the lines of backslash or URI encoding is the cleanest way to go in the long run, with one condition: diffs generated with git-diff should be applicable with 'GNU patch', especially if there is no funnies like renames and the recipient does not mind losing mode information. Although 'GNU patch' has --quoting-style flag, it seems to be used only on its output side (i.e. reporting which file it is patching, etc.). If we can sell changes to teach the filename encoding convention to its util.c::fetchname() upstream, we could tell people that 'diff --git' can be applied with newer 'GNU patch' when the patch is about a file whose name contains '%' character (which is not that unusual, compared to TAB and LF). While we are selling those changes to 'GNU patch', we might be even be able to sell the other extended 'diff --git' metainformation support. The same filename quoting rules change should probably be sold to 'GNU diff' as well, so that plain diff can natively quote funny characters in its output without forcing us to fake it by using the -L flag. If all of the above is what we aim for, I would say that is a good direction to go in the longer term. The double-slash hack was just to avoid all these hassles of having to muck with other people's tools.