Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15

Re: git-apply{,mbox,patch} should default to --unidiff-zero

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:43:19


On Fri, 6 Jul 2007, Johannes Schindelin wrote:
With --unidiff-zero, also _adding_ lines will be handled as if there were 
no problem.

Yes, in your case it fixes a problem.

Yet, in other cases it introduces a problem.
Well, we could make the rule be that ew require --unidiff-zero only if 
there really is _no_ old data to verify in a hunk. No deleted lines, and 
no context around it.

Adrian has a point in that if there are lines to be deleted, that in 
itself is context, and then the strict behaviour of "git-apply" is 
arguably unnecessaily strict.

That said, I do absolutely _hate_ how GNU patch will basically apply 
random line noise without complaints. So git-apply is designed to be much 
stricter on _so_ many levels. The thing that I personally always really 
detested about GNU patch was how it would apply part of a patch, then fail 
half-way, and leave the partial patch applied!

git-apply is about a million times better than standard "patch", exactly 
because it tries to make sure that what it does makes sense, and you 
actually need to use explicit flags to make it do things that may be hard 
to undo or slightly questionable.

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help