git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] add -p: coalesce hunks before testing applicability

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Jun 3, 2019, 14:59 UTC
Message-ID
<3ac6c94c-edd5-b376-4d44-cbf7aebf37a0@gmail.com>
In-Reply-To
<nycvar.QRO.7.76.6.1906031229110.48@tvgsbejvaqbjf.bet>
Hi
On 03/06/2019 14:40, Johannes Schindelin wrote:
Show 39 quoted lines
> Hi Phillip,
> 
> On Sun, 2 Jun 2019, Phillip Wood wrote:
> 
>> 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, I left some comments on the commits on the add-p-in-c branch at https://github.com/dscho [1,2] before I saw your email. I've still got quite a few commits to look at so I'll leave any further comments on the git-for-windows repo instead.

Best Wishes

Phillip [1] https://github.com/dscho/git/commit/9b7d0fbb095e9e14491d4344981ae346c97e1692

[2] https://github.com/dscho/git/commit/74e058179ae7743a8a99e5a20d5362bf55563505

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 11 of 12 in “add -p: coalesce hunks before testing applicability”
  1. add -p: coalesce hunks before testing applicabilityJochen Sprickerhof, Aug 28, 2018
  2. Junio C HamanoAug 28, 2018
  3. Phillip WoodAug 30, 2018
  4. Junio C HamanoAug 30, 2018
  5. Jochen SprickerhofSep 3, 2018
  6. Phillip WoodSep 13, 2018
  7. Jochen SprickerhofSep 23, 2018
  8. Johannes SchindelinMar 22, 2019
  9. Phillip WoodJun 2, 2019
  10. Johannes SchindelinJun 3, 2019
  11. Phillip WoodJun 3, 2019
  12. Johannes SchindelinJun 4, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.