Re: [PATCH v3] merge-tree: add -X strategy option
- From
Elijah Newren <newren@gmail.com>
- Date
- Sep 16, 2023, 03:21 UTC
- Message-ID
- <CABPp-BFDzn=3NzCKyL6aHK0ADbXXBoDhF_sGF8DRdj_VLKQ3SQ@mail.gmail.com>
- In-Reply-To
- <CAFWsj_UeK-5uyCtBfLYeRZXRMdAD_eFassxEo6FvgeVzmwqLNQ@mail.gmail.com>
On Fri, Sep 15, 2023 at 7:27 PM 唐宇奕 <winglovet@gmail.com> wrote:
> > Thanks for your advice! > I've fixed those blocking issues.
Thanks, you did fix most of them. I left a comment on a few things on V3.
> However, regarding the global variable issue, I'm not familiar with C > and git code and don't know how to solve this. I think perhaps we need > something like closure to parse opt into a local variable?
You could merely make xopts, xopts_nr, and xopts_alloc local variables, and pass them around as needed. Closures would make things look cleaner perhaps, but certainly aren't necessarily.
But, I don't think the globals thing is a blocking issue, especially since we already have a number of unnecessary globals in that file already.
Show 5 quoted lines
> Our usecase is to achieve something like 'range-diff', we first use > merge-tree to merge new patchset's base commit with old patchset's > source commit, then use the merge result to diff against new > patchset's source commit. So we only need to make sure conflict's are > handled automatically, leaving other diff features to the second step.
If you're trying to do something like range-diff, then I don't see why there's any point in creating a merge at all. I'm afraid I don't follow your explanations about the steps you are taking and more importantly why you are taking them, and how it helps you achieve your goal of doing "something like 'range-diff'". Could you elaborate?