[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-patch] patch cannot handle >3 lines of context

From: Jörn Engel
Subject: Re: [bug-patch] patch cannot handle >3 lines of context
Date: Tue, 4 Aug 2015 13:10:01 -0700
User-agent: Mutt/1.5.23 (2014-03-12)

On Sat, Jul 18, 2015 at 05:46:17PM -0700, Jörn Engel wrote:
> On Sat, Jul 18, 2015 at 10:25:52PM +0200, Andreas Grünbacher wrote:
> > 
> > I have tried removing this heuristic in the past. The result was lots
> > of misapplied patches. I couldn't think of a better heuristic either.
> > Changing these kinds of things is difficult: for example, distributions
> > are using patch for applying hundreds of thousands of patches
> > automatically during package builds. These kinds of mis-applied
> > patches are relatively likely not to not lead to subsequent errors
> > (like syntax errors in a C file).
> I agree it is hard.  Another weird effect we saw was with repetitive
> code.  The context for a patch existed twice in the same C file.  Git
> picked one of them, patch the other.  Because some of us use git
> quiltimport and other use quilt we eventually noticed the problem.  And
> only because we had a compiler error - backtracking from runtime
> failures to misapplied patches would be a nightmare.

Just occurred to me.  For my problem at least, there should be a
--paranoid option and mode.  When paranoid you look for multiple
locations to apply the patch.  If you find more than one, treat it like
a conflict and ask a human to intervene.

Almost certain to slow things down, but running it once in a while to
catch problems would be useful.  Or as a parallel verification step
while distro build is ongoing or something.


Was there any time in human history where democratic forms continued
when the citizens could not credibly defend their rights?
-- Daniel Suarez

reply via email to

[Prev in Thread] Current Thread [Next in Thread]