Re: [PATCH v2 4/8] merge-tree: implement real merges
- From
Elijah Newren <newren@gmail.com>
- Date
- Jan 7, 2022, 19:09 UTC
- Message-ID
- <CABPp-BFph66FFH26gHTHnMW1OQpZQ7nUJBfr7vWJ_ZmXRG+DcA@mail.gmail.com>
- In-Reply-To
- <CAP8UFD1jTgxCc-r8vzBGUt8SRS=h5jA1KSz6Fw1XpKXB5-XtoQ@mail.gmail.com>
On Fri, Jan 7, 2022 at 10:12 AM Christian Couder <christian.couder@gmail.com> wrote:
Show 26 quoted lines
>
> On Wed, Jan 5, 2022 at 6:27 PM Elijah Newren via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>
> > The only output is:
> > - the toplevel resulting tree printed on stdout
> > - exit status of 0 (clean) or 1 (conflicts present)
>
> I thought that the merge-ort API could (at least theoretically
> according to merge-ort.h) return something < 0 in case of internal
> error. In this case I would be interested in knowing what's the output
> of the command.
>
> > +The first form will merge the two branches, doing a full recursive
> > +merge with rename detection. If the merge is clean, the exit status
> > +will be `0`, and if the merge has conflicts, the exit status will be
> > +`1`.
>
> No mention of what happens in case of an internal error in the merge-ort API.
>
> > + merge_incore_recursive(&opt, merge_bases, parent1, parent2, &result);
> > + printf("%s\n", oid_to_hex(&result.tree->object.oid));
> > + merge_switch_to_result(&opt, NULL, &result, 0, 0);
> > + return result.clean ? 0 : 1;
>
> If result.clean can be < 0, this might pretend that the merge was clean.Ooh, these are very good points. Thanks for bringing them up; I'll try to address them in a re-roll.