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:17 UTC
Message-ID
<xmqqoau6hz1t.fsf@gitster.dls.corp.google.com>
In-Reply-To
<xmqq1tr2jhg2.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
> SMTP transport may be CRLF-unsafe, so I have a suspicion that it may
> turn out that what you are trying to do might be an equilvalent of
>
> 	git format-patch ... |
>         # first lose all \r\n
>         dos2unix | 
> 	# then make everything \r\n
>         unix2dos |
>         # and apply
>         git am
>
> which is not workable in the first place.  I dunno.

This is a tangent, but if the problem were slightly different, I would be more sympathetic. For example

    A popular MUA, when asked to write out a message in the mbox
    format, ends _all_ the lines in its output with CRLF, whether
    the original was sent as LF-only or CRLF, and there is no way to
    convince it to use LF-only.  "git apply" fails to grok such an
    input.

could be, if the use of such an MUA is very prevalent, a common problem worth working around.

But then I would suspect that the workaround for such a case may not be "accept /dev/null\n and /dev/null\r\n equally". It is likely that the right workaround for such a case would be to "turn all \r\n into \n before processing".

Previous: Junio C Hamano
Message 15 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.