git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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/
Previous: Adam Williamson
Message 6 of 6 in “git format-patch produces invalid patch if the commit adds an empty file?”
  1. Adam WilliamsonAug 17, 2021
  2. Junio C HamanoAug 19, 2021
  3. Adam WilliamsonAug 19, 2021
  4. Gwyneth MorganAug 20, 2021
  5. Adam WilliamsonAug 20, 2021
  6. Junio C HamanoAug 20, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.