Re: [PATCH v1 1/1] correct apply for files commited with CRLF

2017-08-04 Thread Junio C Hamano
Junio C Hamano writes: > The "previous" in the context of running "git apply" (which does not > look at the index) is _not_ what is in the index, on the other hand. > Instead of "struct index_state *", convert_to_git() needs to be > fixed to take something else that can be queried for the "previo

Re: [PATCH v1 1/1] correct apply for files commited with CRLF

2017-08-04 Thread Junio C Hamano
Torsten Bögershausen writes: > Back to the fix, the read_old_data() from below works on the working tree, > yes, but after convert_to_git(). > And that is why we need the index, to fix this very case. But "git apply" (without "--cached" or "--index") is to work on the working tree file only. Th

Re: [PATCH v1 1/1] correct apply for files commited with CRLF

2017-08-04 Thread Torsten Bögershausen
On 08/02/2017 11:13 PM, Junio C Hamano wrote: tbo...@web.de writes: From: Torsten Bögershausen git apply does not find the source lines when files have CRLF in the index and core.autocrlf is true: These files should not get the CRLF converted to LF. Because cmd_apply() does not load the ind

Re: [PATCH v1 1/1] correct apply for files commited with CRLF

2017-08-02 Thread Junio C Hamano
tbo...@web.de writes: > From: Torsten Bögershausen > > git apply does not find the source lines when files have CRLF in the index > and core.autocrlf is true: > These files should not get the CRLF converted to LF. Because cmd_apply() > does not load the index, this does not work, CRLF are convert

[PATCH v1 1/1] correct apply for files commited with CRLF

2017-08-02 Thread tboegi
From: Torsten Bögershausen git apply does not find the source lines when files have CRLF in the index and core.autocrlf is true: These files should not get the CRLF converted to LF. Because cmd_apply() does not load the index, this does not work, CRLF are converted into LF and apply fails. Fix t