Re: [PATCH] add -p: coalesce hunks before testing applicability
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jun 3, 2019, 13:40 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1906031229110.48@tvgsbejvaqbjf.bet>
- In-Reply-To
- <a23789e9-ee99-d23b-ee25-1acef8d8d114@gmail.com>
Hi Phillip,
On Sun, 2 Jun 2019, Phillip Wood wrote:
Show 27 quoted lines
> On 22/03/2019 14:06, Johannes Schindelin wrote:
>
> > On Thu, 13 Sep 2018, Phillip Wood wrote:
> >
> > > On 03/09/2018 20:01, Jochen Sprickerhof wrote:
> > >
> > > > * Phillip Wood <phillip.wood@talktalk.net> [2018-08-30 14:47]:
> > > >
> > > > > We could restore the old test condition and coalesce the hunks
> > > > > by copying all the hunks and setting $hunk->{USE}=1 when
> > > > > creating the test patch if that turns out to be useful (it would
> > > > > be interesting to see if the test still passes with that
> > > > > change).
> > > >
> > > > We set USE=1 for $newhunk already, or where would you set it?
> > >
> > > To match the old test it needs to be set on the hunks we've skipped
> > > or haven't got to yet so they're all in the patch that's tested
> > > after editing a hunk.
> >
> > The way I fixed this in the C code is by teaching the equivalent of
> > the `coalesce_overlapping_hunks()` function to simply ignore the
> > equivalent of `$hunk->{USE}`: the function signature takes an
> > additional `use_all` parameter, which will override the `use` field.
>
> That sounds like a good solution. Thanks for working on the conversion
> to C, I'll try and find time look at the code on github.Please note that I did not update the Pull Requests on GitGitGadget lately, as I had no reviewer feedback on #170 and did not want to waste too much time on synchronizing my work between those PRs and Git for Windows (which now has the built-in `git add -i` as an opt-in feature).
So: the latest patches (as of time of writing) can be found here: https://github.com/git-for-windows/git/compare/9f09372011%5E...9f09372011%5E2
Thanks, Dscho