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

2014-09-24 Thread Junio C Hamano
Laszlo Ersek writes: > Thank you for taking the time to describe this. It does look like the > by-the-book solution. > > Obviously, I can't implement it myself -- first, I have no experience > with the git codebase, ... Oh, I wasn't expecting that anyway ;-). The reason I outlined a possible ap

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

2014-09-24 Thread Laszlo Ersek
On 09/23/14 23:35, Junio C Hamano wrote: > Laszlo Ersek writes: > >> [...] > The important thing to note here is that use of text/plain for > patches, if you want to have distinction between CRLF and LF in your > payload, is not designed to work over e-mails. That's good to know, thanks! > Now

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

2014-09-23 Thread Junio C Hamano
Laszlo Ersek writes: > In summary: This is not entirely correct, though. But it suggests an avenue for a possible enhancement. > - the email infrastructure turns all line terminators into CRLFs Yes, but that is within MTAs and is expected to be invisible at MUA level. Typically mailbox files

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

2014-09-23 Thread Laszlo Ersek
On 09/23/14 22:40, Junio C Hamano wrote: > Laszlo Ersek writes: > >> On 09/23/14 21:56, Junio C Hamano wrote: >>> Laszlo Ersek 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 >>>

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

2014-09-23 Thread Laszlo Ersek
On 09/23/14 22:35, Junio C Hamano wrote: > Laszlo Ersek writes: > >> On 09/23/14 22:02, Junio C Hamano wrote: >>> Laszlo Ersek writes: >>> On 09/23/14 20:54, Junio C Hamano wrote: ... > SMTP transport may be CRLF-unsafe, so I have a suspicion that it may > turn out that what yo

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

2014-09-23 Thread Junio C Hamano
Laszlo Ersek writes: > On 09/23/14 21:56, Junio C Hamano wrote: >> Laszlo Ersek 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 hand

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

2014-09-23 Thread Laszlo Ersek
On 09/23/14 21:56, Junio C Hamano wrote: > Laszlo Ersek 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 th

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

2014-09-23 Thread Laszlo Ersek
On 09/23/14 22:02, Junio C Hamano wrote: > Laszlo Ersek writes: > >> On 09/23/14 20:54, Junio C Hamano wrote: >> ... >>> 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 ... | >

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

2014-09-23 Thread Junio C Hamano
Laszlo Ersek writes: > On 09/23/14 22:02, Junio C Hamano wrote: >> Laszlo Ersek writes: >> >>> On 09/23/14 20:54, Junio C Hamano wrote: >>> ... 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

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

2014-09-23 Thread Junio C Hamano
Junio C Hamano writes: > 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 > u

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

2014-09-23 Thread Junio C Hamano
Laszlo Ersek writes: > On 09/23/14 20:54, Junio C Hamano wrote: > ... >> 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 >> dos2un

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

2014-09-23 Thread Junio C Hamano
Laszlo Ersek 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 mat

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

2014-09-23 Thread Laszlo Ersek
On 09/23/14 20:54, Junio C Hamano wrote: > Laszlo Ersek writes: > >> git format-patch master..branch1 > > The output from this has these (excerpt from "od -xc" output): > > 360 f 2 \n \n d i f f - - g i t >66200a32640a66692066

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

2014-09-23 Thread Junio C Hamano
Laszlo Ersek writes: > git format-patch master..branch1 The output from this has these (excerpt from "od -xc" output): 360 f 2 \n \n d i f f - - g i t 66200a32640a666920662d2d69672074 400 a / f 2 b

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

2014-09-22 Thread Laszlo Ersek
The edk2 (EFI Development Kit II) project at uses CRLF line endings. The following small reproducer demonstrates how gitdiff_verify_name() breaks when it meets the usual git patches workflow in combination with CRLF line endings: 1. Prepare the test repo: m