Re: git format-patch produces invalid patch if the commit adds an empty file?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 20, 2021, 21:09 UTC
- Message-ID
- <xmqqbl5ru8kl.fsf@gitster.g>
- In-Reply-To
- <YR9Iaj/FqAyCMade@tilde.club>
Gwyneth Morgan <gwymor@tilde.club> writes:
> GNU patch chokes in this case with an unquoted filename with spaces.
When we settled what bytes (not characters) in a pathname will cause it to be quoted and how the quoting is done between us and GNU diff and patch maintainer back in Oct 2005, I thought that we excluded whitespace from the bytes that need quoting [*]. And I do not recall us changing the rule for pathname quoting since then (other than introduction of core.quotepath to disable quoting bytes with the 8th bit set).
It may be a "recent" change on the GNU patch side, and I do not think we mind tweaking our diff output to be more accomodating iff that observation is true. I however understand that spaces in pathnames are not so uncommon especially among non-programmers and they may feel irritating having to see any pathname with spaces quoted.
[Reference]
* https://lore.kernel.org/git/Pine.LNX.4.64.0510111121030.14597@g5.osdl.org/