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

Re: [PATCH for-maint] apply: gitdiff_verify_name(): accept "/dev/null\r"

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 23, 2014, 20:40 UTC
Message-ID
<xmqqbnq6hxyt.fsf@gitster.dls.corp.google.com>
In-Reply-To
<5421D900.7060607@redhat.com>
Laszlo Ersek <lersek@redhat.com> writes:
Show 21 quoted lines
> On 09/23/14 21:56, Junio C Hamano wrote:
>> Laszlo Ersek <lersek@redhat.com> writes:
>> 
>>> What do you think about accepting only "/dev/null\n" and "/dev/null\r\n"?
>> 
>> I thought we agreed that what you are doing is not workable in the
>> first place, no?
>> 
>> I suspect one way to handle "In this project, the files that are
>> checked out must be with CRLF line endings no matter what the
>> platform is" might be to use the line ending attributes to force
>> that while keeping the in-repository data with LF line endings.  The
>> diff output (format-patch output is just one of them) comes from
>> comparing the in-repository representation, so you won't have \r\n
>> that will be stripped via MTA in it, "apply" and "am" will apply the
>> patch without having to worry about \r\n, _and_ the line ending
>> attributes would end the lines in your in-working-tree files with
>> CRLF that way.
>
> This would be a perfect solution if the git repository was not a mirror
> of a Subversion repository that contains all files with embedded CRLFs.
Yikes.
> Anyway I accept defeat, thanks for your time.

I do not consider that a "defeat". It is just I do not think it is the right solution for the problem you are having to butcher "apply". You'd need to find some other way to solve it, and other people on the list may be able to offer a solution neither of us thought of in this thread.

Perhaps those who are on Windows have more experience in situations like yours?

Previous: Laszlo ErsekNext: Laszlo Ersek
Message 6 of 15 in “apply: gitdiff_verify_name(): accept "/dev/null\r"”
  1. apply: gitdiff_verify_name(): accept "/dev/null\r"Laszlo Ersek, Sep 23, 2014
  2. Junio C HamanoSep 23, 2014
  3. Laszlo ErsekSep 23, 2014
  4. Junio C HamanoSep 23, 2014
  5. Laszlo ErsekSep 23, 2014
  6. Junio C HamanoSep 23, 2014
  7. Laszlo ErsekSep 23, 2014
  8. Junio C HamanoSep 23, 2014
  9. Laszlo ErsekSep 23, 2014
  10. Junio C HamanoSep 23, 2014
  11. Laszlo ErsekSep 23, 2014
  12. Junio C HamanoSep 23, 2014
  13. Laszlo ErsekSep 24, 2014
  14. Junio C HamanoSep 24, 2014
  15. Junio C HamanoSep 23, 2014

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.