Re: [PATCH 1/3] merge-ort: copy a few small helper functions from merge-recursive.c
- From
Elijah Newren <newren@gmail.com>
- Date
- Dec 16, 2020, 16:24 UTC
- Message-ID
- <CABPp-BHf=G7xgVLLF+6hSazHB-=botZ3k2EHNXrZREeMhK787A@mail.gmail.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.2012161710170.56@tvgsbejvaqbjf.bet>
On Wed, Dec 16, 2020 at 8:12 AM Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 33 quoted lines
>
> Hi Junio,
>
> On Tue, 15 Dec 2020, Junio C Hamano wrote:
>
> > "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
> >
> > > From: Elijah Newren <newren@gmail.com>
> > >
> > > In a subsequent commit, we will implement the traditional recursiveness
> > > that gave merge-recursive its name, namely merging non-unique
> > > merge-bases to come up with a single virtual merge base. Copy a few
> > > helper functions from merge-recursive.c that we will use in the
> > > implementation.
> > >
> > > Signed-off-by: Elijah Newren <newren@gmail.com>
> > > ...
> > > @@ -1462,5 +1492,7 @@ void merge_incore_recursive(struct merge_options *opt,
> > > struct commit *side2,
> > > struct merge_result *result)
> > > {
> > > + (void)reverse_commit_list;
> > > + (void)make_virtual_commit;
> >
> > To keep these symbols referenced? Cute ;-)
>
> I saw this technique used extensively in cURL. Note that we ourselves
> introduced the first such thing in 2fb330ca723 (packed_delete_refs():
> implement method, 2017-09-08).
>
> However, we seem to have the `MAYBE_UNUSED` macro specifically for such
> use cases (and use it in four instances as of time of writing). I wonder
> whether we want to settle one one strategy instead of keeping both?Ooh, MAYBE_UNUSED, I like it. Much more self-documenting. I'm sending another round to address Derrick's comment, so I'll include this change while at it.