Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [RFC] solving a bug with hunks starting at line 1 in git apply

From: Matthieu Moy <hidden>
Date: 2016-06-15 23:05:05

Junio C Hamano [off-list ref] writes:
Matthieu Moy [off-list ref] writes:
quoted
quoted
@@ -1,1 +1,2 @@
+5
 10
@@ -1,3 +2,3 @@
 10
+15
-20
 30
With this one, I get:

$ git apply < p2.diff   
error: patch failed: pre.txt:1
error: pre.txt: patch does not apply
$ patch < p2.diff 
patching file pre.txt

=> no fuzzy matching for patch, git apply should actually work.
I am not sure what you are trying to do with that patch that tries
to touch the same line twice.  Is this the same old laziness coming
back to bite us, the one that we attempted to work around with
933e44d3 ("add -p": work-around an old laziness that does not
coalesce hunks, 2011-04-06)?
Indeed, "git apply" works with --allow-overlap in this case. But this is
not sufficient to fix "git add -p" which already uses it. So, there's
something else.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help