Re: git rm / format-patch / am fails on my file: patch does not apply

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: git rm / format-patch / am fails on my file: patch does not apply

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:59:13

Ken Tanzer [off-list ref] writes:
ASCII text, with very long lines, with CRLF, CR, LF line terminators
I am not very much surprised if such a file misbehaves, because the
"format-patch | am" pipeline is designed to be used on patches that
can be transferred in plain-text e-mail safely.  Long lines should
probably be OK, but mixed CRLF, CR and LF may be problematic.

Having said that...
I've confirmed with the following test case on three machines, so it
seems reproducible:

mkdir temp_test_case
cd temp_test_case
git init
# my file.  Sorry--couldn't find a saner link!
wget -O jquery-ui-1.8.custom.min.js
http://sourceforge.net/p/agency/code/ci/9358ea4dbe8e1540ec0b8bebfc7770f1bf8be0ec/tree/jquery-ui-1.8.custom.min.js?format=raw
git add jquery-ui-1.8.custom.min.js
git commit -m 'Adding jquery-ui'
git rm jquery-ui-1.8.custom.min.js
git commit -m 'Removing jquery-ui'
git format-patch HEAD~1
git reset --hard HEAD~1
git am 0001*
... this does not break at all for me.

Re: git rm / format-patch / am fails on my file: patch does not apply

From: Stefan Beller <hidden>
Date: 2016-06-15 22:59:13

On 11.11.2013 20:04, Junio C Hamano wrote:
Ken Tanzer [off-list ref] writes:
quoted
ASCII text, with very long lines, with CRLF, CR, LF line terminators
I am not very much surprised if such a file misbehaves, because the
"format-patch | am" pipeline is designed to be used on patches that
can be transferred in plain-text e-mail safely.  Long lines should
probably be OK, but mixed CRLF, CR and LF may be problematic.

Having said that...
quoted
I've confirmed with the following test case on three machines, so it
seems reproducible:

mkdir temp_test_case
cd temp_test_case
git init
# my file.  Sorry--couldn't find a saner link!
wget -O jquery-ui-1.8.custom.min.js
http://sourceforge.net/p/agency/code/ci/9358ea4dbe8e1540ec0b8bebfc7770f1bf8be0ec/tree/jquery-ui-1.8.custom.min.js?format=raw
git add jquery-ui-1.8.custom.min.js
git commit -m 'Adding jquery-ui'
git rm jquery-ui-1.8.custom.min.js
git commit -m 'Removing jquery-ui'
git format-patch HEAD~1
git reset --hard HEAD~1
git am 0001*
... this does not break at all for me.
--
Here it breaks, though it doesn't break when using
	 git am --ignore-whitespace 0001*

I do have this global config
	core.safecrlf=warn
regarding line endings.

I was using 1.8.5.rc1.17.g0ecd94d

Trying to understand the problem,
Stefan

Re: git rm / format-patch / am fails on my file: patch does not apply

From: Ken Tanzer <hidden>
Date: 2016-06-15 22:59:14

I am not very much surprised if such a file misbehaves, because the
"format-patch | am" pipeline is designed to be used on patches that
can be transferred in plain-text e-mail safely.  Long lines should
probably be OK, but mixed CRLF, CR and LF may be problematic.
I'm not sure I understand this comment.  format-patch seems to work
fine on binary files.  So if it can handle any random collection of
bytes, why not text files with (admittedly funky) CRs and LFs?

Cheers,
Ken

On Mon, Nov 11, 2013 at 11:04 AM, Junio C Hamano [off-list ref] wrote:
Ken Tanzer [off-list ref] writes:
quoted
ASCII text, with very long lines, with CRLF, CR, LF line terminators
I am not very much surprised if such a file misbehaves, because the
"format-patch | am" pipeline is designed to be used on patches that
can be transferred in plain-text e-mail safely.  Long lines should
probably be OK, but mixed CRLF, CR and LF may be problematic.

Having said that...
quoted
I've confirmed with the following test case on three machines, so it
seems reproducible:

mkdir temp_test_case
cd temp_test_case
git init
# my file.  Sorry--couldn't find a saner link!
wget -O jquery-ui-1.8.custom.min.js
http://sourceforge.net/p/agency/code/ci/9358ea4dbe8e1540ec0b8bebfc7770f1bf8be0ec/tree/jquery-ui-1.8.custom.min.js?format=raw
git add jquery-ui-1.8.custom.min.js
git commit -m 'Adding jquery-ui'
git rm jquery-ui-1.8.custom.min.js
git commit -m 'Removing jquery-ui'
git format-patch HEAD~1
git reset --hard HEAD~1
git am 0001*
... this does not break at all for me.


-- 
AGENCY Software
A data system that puts you in control
100% Free Software
http://agency-software.org/
ken.tanzer@agency-software.org
(253) 245-3801

Subscribe to the mailing list to
learn more about AGENCY or
follow the discussion.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help